Skip to content

Commit 7ecef14

Browse files
JoePerchestorvalds
authored andcommitted
ocfs2: neaten do_error, ocfs2_error and ocfs2_abort
These uses sometimes do and sometimes don't have '\n' terminations. Make the uses consistently use '\n' terminations and remove the newline from the functions. Miscellanea: o Coalesce formats o Realign arguments Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d0c97d5 commit 7ecef14

14 files changed

Lines changed: 163 additions & 202 deletions

File tree

‎fs/ocfs2/alloc.c‎

Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -909,27 +909,25 @@ static int ocfs2_validate_extent_block(struct super_block *sb,
909909

910910
if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) {
911911
rc = ocfs2_error(sb,
912-
"Extent block #%llu has bad signature %.*s",
913-
(unsigned long long)bh->b_blocknr, 7,
914-
eb->h_signature);
912+
"Extent block #%llu has bad signature %.*s\n",
913+
(unsigned long long)bh->b_blocknr, 7,
914+
eb->h_signature);
915915
goto bail;
916916
}
917917

918918
if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) {
919919
rc = ocfs2_error(sb,
920-
"Extent block #%llu has an invalid h_blkno "
921-
"of %llu",
922-
(unsigned long long)bh->b_blocknr,
923-
(unsigned long long)le64_to_cpu(eb->h_blkno));
920+
"Extent block #%llu has an invalid h_blkno of %llu\n",
921+
(unsigned long long)bh->b_blocknr,
922+
(unsigned long long)le64_to_cpu(eb->h_blkno));
924923
goto bail;
925924
}
926925

927926
if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) {
928927
rc = ocfs2_error(sb,
929-
"Extent block #%llu has an invalid "
930-
"h_fs_generation of #%u",
931-
(unsigned long long)bh->b_blocknr,
932-
le32_to_cpu(eb->h_fs_generation));
928+
"Extent block #%llu has an invalid h_fs_generation of #%u\n",
929+
(unsigned long long)bh->b_blocknr,
930+
le32_to_cpu(eb->h_fs_generation));
933931
goto bail;
934932
}
935933
bail:
@@ -1446,8 +1444,7 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et,
14461444
while(le16_to_cpu(el->l_tree_depth) > 1) {
14471445
if (le16_to_cpu(el->l_next_free_rec) == 0) {
14481446
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
1449-
"Owner %llu has empty "
1450-
"extent list (next_free_rec == 0)",
1447+
"Owner %llu has empty extent list (next_free_rec == 0)\n",
14511448
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
14521449
status = -EIO;
14531450
goto bail;
@@ -1456,9 +1453,7 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et,
14561453
blkno = le64_to_cpu(el->l_recs[i].e_blkno);
14571454
if (!blkno) {
14581455
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
1459-
"Owner %llu has extent "
1460-
"list where extent # %d has no physical "
1461-
"block start",
1456+
"Owner %llu has extent list where extent # %d has no physical block start\n",
14621457
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), i);
14631458
status = -EIO;
14641459
goto bail;
@@ -1788,8 +1783,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci,
17881783
while (el->l_tree_depth) {
17891784
if (le16_to_cpu(el->l_next_free_rec) == 0) {
17901785
ocfs2_error(ocfs2_metadata_cache_get_super(ci),
1791-
"Owner %llu has empty extent list at "
1792-
"depth %u\n",
1786+
"Owner %llu has empty extent list at depth %u\n",
17931787
(unsigned long long)ocfs2_metadata_cache_owner(ci),
17941788
le16_to_cpu(el->l_tree_depth));
17951789
ret = -EROFS;
@@ -1814,8 +1808,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci,
18141808
blkno = le64_to_cpu(el->l_recs[i].e_blkno);
18151809
if (blkno == 0) {
18161810
ocfs2_error(ocfs2_metadata_cache_get_super(ci),
1817-
"Owner %llu has bad blkno in extent list "
1818-
"at depth %u (index %d)\n",
1811+
"Owner %llu has bad blkno in extent list at depth %u (index %d)\n",
18191812
(unsigned long long)ocfs2_metadata_cache_owner(ci),
18201813
le16_to_cpu(el->l_tree_depth), i);
18211814
ret = -EROFS;
@@ -1836,8 +1829,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci,
18361829
if (le16_to_cpu(el->l_next_free_rec) >
18371830
le16_to_cpu(el->l_count)) {
18381831
ocfs2_error(ocfs2_metadata_cache_get_super(ci),
1839-
"Owner %llu has bad count in extent list "
1840-
"at block %llu (next free=%u, count=%u)\n",
1832+
"Owner %llu has bad count in extent list at block %llu (next free=%u, count=%u)\n",
18411833
(unsigned long long)ocfs2_metadata_cache_owner(ci),
18421834
(unsigned long long)bh->b_blocknr,
18431835
le16_to_cpu(el->l_next_free_rec),
@@ -2116,8 +2108,7 @@ static int ocfs2_rotate_subtree_right(handle_t *handle,
21162108

21172109
if (left_el->l_next_free_rec != left_el->l_count) {
21182110
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
2119-
"Inode %llu has non-full interior leaf node %llu"
2120-
"(next free = %u)",
2111+
"Inode %llu has non-full interior leaf node %llu (next free = %u)\n",
21212112
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
21222113
(unsigned long long)left_leaf_bh->b_blocknr,
21232114
le16_to_cpu(left_el->l_next_free_rec));
@@ -2256,8 +2247,7 @@ int ocfs2_find_cpos_for_left_leaf(struct super_block *sb,
22562247
* If we got here, we never found a valid node where
22572248
* the tree indicated one should be.
22582249
*/
2259-
ocfs2_error(sb,
2260-
"Invalid extent tree at extent block %llu\n",
2250+
ocfs2_error(sb, "Invalid extent tree at extent block %llu\n",
22612251
(unsigned long long)blkno);
22622252
ret = -EROFS;
22632253
goto out;
@@ -2872,8 +2862,7 @@ int ocfs2_find_cpos_for_right_leaf(struct super_block *sb,
28722862
* If we got here, we never found a valid node where
28732863
* the tree indicated one should be.
28742864
*/
2875-
ocfs2_error(sb,
2876-
"Invalid extent tree at extent block %llu\n",
2865+
ocfs2_error(sb, "Invalid extent tree at extent block %llu\n",
28772866
(unsigned long long)blkno);
28782867
ret = -EROFS;
28792868
goto out;
@@ -3224,7 +3213,7 @@ static int ocfs2_rotate_tree_left(handle_t *handle,
32243213
if (le16_to_cpu(el->l_next_free_rec) == 0) {
32253214
ret = -EIO;
32263215
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
3227-
"Owner %llu has empty extent block at %llu",
3216+
"Owner %llu has empty extent block at %llu\n",
32283217
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
32293218
(unsigned long long)le64_to_cpu(eb->h_blkno));
32303219
goto out;
@@ -3954,7 +3943,7 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
39543943
next_free = le16_to_cpu(el->l_next_free_rec);
39553944
if (next_free == 0) {
39563945
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
3957-
"Owner %llu has a bad extent list",
3946+
"Owner %llu has a bad extent list\n",
39583947
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
39593948
ret = -EIO;
39603949
return;
@@ -4379,10 +4368,7 @@ static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
43794368
bh = path_leaf_bh(left_path);
43804369
eb = (struct ocfs2_extent_block *)bh->b_data;
43814370
ocfs2_error(sb,
4382-
"Extent block #%llu has an "
4383-
"invalid l_next_free_rec of "
4384-
"%d. It should have "
4385-
"matched the l_count of %d",
4371+
"Extent block #%llu has an invalid l_next_free_rec of %d. It should have matched the l_count of %d\n",
43864372
(unsigned long long)le64_to_cpu(eb->h_blkno),
43874373
le16_to_cpu(new_el->l_next_free_rec),
43884374
le16_to_cpu(new_el->l_count));
@@ -4437,8 +4423,7 @@ static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
44374423
bh = path_leaf_bh(right_path);
44384424
eb = (struct ocfs2_extent_block *)bh->b_data;
44394425
ocfs2_error(sb,
4440-
"Extent block #%llu has an "
4441-
"invalid l_next_free_rec of %d",
4426+
"Extent block #%llu has an invalid l_next_free_rec of %d\n",
44424427
(unsigned long long)le64_to_cpu(eb->h_blkno),
44434428
le16_to_cpu(new_el->l_next_free_rec));
44444429
status = -EINVAL;
@@ -4994,10 +4979,9 @@ static int ocfs2_split_and_insert(handle_t *handle,
49944979
split_index = ocfs2_search_extent_list(el, cpos);
49954980
if (split_index == -1) {
49964981
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
4997-
"Owner %llu has an extent at cpos %u "
4998-
"which can no longer be found.\n",
4999-
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
5000-
cpos);
4982+
"Owner %llu has an extent at cpos %u which can no longer be found\n",
4983+
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
4984+
cpos);
50014985
ret = -EROFS;
50024986
goto out;
50034987
}
@@ -5182,10 +5166,9 @@ int ocfs2_change_extent_flag(handle_t *handle,
51825166
index = ocfs2_search_extent_list(el, cpos);
51835167
if (index == -1) {
51845168
ocfs2_error(sb,
5185-
"Owner %llu has an extent at cpos %u which can no "
5186-
"longer be found.\n",
5187-
(unsigned long long)
5188-
ocfs2_metadata_cache_owner(et->et_ci), cpos);
5169+
"Owner %llu has an extent at cpos %u which can no longer be found\n",
5170+
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
5171+
cpos);
51895172
ret = -EROFS;
51905173
goto out;
51915174
}
@@ -5252,9 +5235,7 @@ int ocfs2_mark_extent_written(struct inode *inode,
52525235
cpos, len, phys);
52535236

52545237
if (!ocfs2_writes_unwritten_extents(OCFS2_SB(inode->i_sb))) {
5255-
ocfs2_error(inode->i_sb, "Inode %llu has unwritten extents "
5256-
"that are being written to, but the feature bit "
5257-
"is not set in the super block.",
5238+
ocfs2_error(inode->i_sb, "Inode %llu has unwritten extents that are being written to, but the feature bit is not set in the super block\n",
52585239
(unsigned long long)OCFS2_I(inode)->ip_blkno);
52595240
ret = -EROFS;
52605241
goto out;
@@ -5538,8 +5519,7 @@ int ocfs2_remove_extent(handle_t *handle,
55385519
index = ocfs2_search_extent_list(el, cpos);
55395520
if (index == -1) {
55405521
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
5541-
"Owner %llu has an extent at cpos %u which can no "
5542-
"longer be found.\n",
5522+
"Owner %llu has an extent at cpos %u which can no longer be found\n",
55435523
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
55445524
cpos);
55455525
ret = -EROFS;
@@ -5604,7 +5584,7 @@ int ocfs2_remove_extent(handle_t *handle,
56045584
index = ocfs2_search_extent_list(el, cpos);
56055585
if (index == -1) {
56065586
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
5607-
"Owner %llu: split at cpos %u lost record.",
5587+
"Owner %llu: split at cpos %u lost record\n",
56085588
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
56095589
cpos);
56105590
ret = -EROFS;
@@ -5620,8 +5600,7 @@ int ocfs2_remove_extent(handle_t *handle,
56205600
ocfs2_rec_clusters(el, rec);
56215601
if (rec_range != trunc_range) {
56225602
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
5623-
"Owner %llu: error after split at cpos %u"
5624-
"trunc len %u, existing record is (%u,%u)",
5603+
"Owner %llu: error after split at cpos %u trunc len %u, existing record is (%u,%u)\n",
56255604
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
56265605
cpos, len, le32_to_cpu(rec->e_cpos),
56275606
ocfs2_rec_clusters(el, rec));
@@ -7236,8 +7215,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
72367215
!(le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL) ||
72377216
!ocfs2_supports_inline_data(osb)) {
72387217
ocfs2_error(inode->i_sb,
7239-
"Inline data flags for inode %llu don't agree! "
7240-
"Disk: 0x%x, Memory: 0x%x, Superblock: 0x%x\n",
7218+
"Inline data flags for inode %llu don't agree! Disk: 0x%x, Memory: 0x%x, Superblock: 0x%x\n",
72417219
(unsigned long long)OCFS2_I(inode)->ip_blkno,
72427220
le16_to_cpu(di->i_dyn_features),
72437221
OCFS2_I(inode)->ip_dyn_features,

‎fs/ocfs2/aops.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page,
227227
struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
228228

229229
if (!(le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL)) {
230-
ocfs2_error(inode->i_sb, "Inode %llu lost inline data flag",
230+
ocfs2_error(inode->i_sb, "Inode %llu lost inline data flag\n",
231231
(unsigned long long)OCFS2_I(inode)->ip_blkno);
232232
return -EROFS;
233233
}
@@ -237,7 +237,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page,
237237
if (size > PAGE_CACHE_SIZE ||
238238
size > ocfs2_max_inline_data_with_xattr(inode->i_sb, di)) {
239239
ocfs2_error(inode->i_sb,
240-
"Inode %llu has with inline data has bad size: %Lu",
240+
"Inode %llu has with inline data has bad size: %Lu\n",
241241
(unsigned long long)OCFS2_I(inode)->ip_blkno,
242242
(unsigned long long)size);
243243
return -EROFS;

‎fs/ocfs2/dir.c‎

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -481,29 +481,25 @@ static int ocfs2_check_dir_trailer(struct inode *dir, struct buffer_head *bh)
481481
trailer = ocfs2_trailer_from_bh(bh, dir->i_sb);
482482
if (!OCFS2_IS_VALID_DIR_TRAILER(trailer)) {
483483
rc = ocfs2_error(dir->i_sb,
484-
"Invalid dirblock #%llu: "
485-
"signature = %.*s\n",
486-
(unsigned long long)bh->b_blocknr, 7,
487-
trailer->db_signature);
484+
"Invalid dirblock #%llu: signature = %.*s\n",
485+
(unsigned long long)bh->b_blocknr, 7,
486+
trailer->db_signature);
488487
goto out;
489488
}
490489
if (le64_to_cpu(trailer->db_blkno) != bh->b_blocknr) {
491490
rc = ocfs2_error(dir->i_sb,
492-
"Directory block #%llu has an invalid "
493-
"db_blkno of %llu",
494-
(unsigned long long)bh->b_blocknr,
495-
(unsigned long long)le64_to_cpu(trailer->db_blkno));
491+
"Directory block #%llu has an invalid db_blkno of %llu\n",
492+
(unsigned long long)bh->b_blocknr,
493+
(unsigned long long)le64_to_cpu(trailer->db_blkno));
496494
goto out;
497495
}
498496
if (le64_to_cpu(trailer->db_parent_dinode) !=
499497
OCFS2_I(dir)->ip_blkno) {
500498
rc = ocfs2_error(dir->i_sb,
501-
"Directory block #%llu on dinode "
502-
"#%llu has an invalid parent_dinode "
503-
"of %llu",
504-
(unsigned long long)bh->b_blocknr,
505-
(unsigned long long)OCFS2_I(dir)->ip_blkno,
506-
(unsigned long long)le64_to_cpu(trailer->db_blkno));
499+
"Directory block #%llu on dinode #%llu has an invalid parent_dinode of %llu\n",
500+
(unsigned long long)bh->b_blocknr,
501+
(unsigned long long)OCFS2_I(dir)->ip_blkno,
502+
(unsigned long long)le64_to_cpu(trailer->db_blkno));
507503
goto out;
508504
}
509505
out:
@@ -602,9 +598,9 @@ static int ocfs2_validate_dx_root(struct super_block *sb,
602598

603599
if (!OCFS2_IS_VALID_DX_ROOT(dx_root)) {
604600
ret = ocfs2_error(sb,
605-
"Dir Index Root # %llu has bad signature %.*s",
606-
(unsigned long long)le64_to_cpu(dx_root->dr_blkno),
607-
7, dx_root->dr_signature);
601+
"Dir Index Root # %llu has bad signature %.*s\n",
602+
(unsigned long long)le64_to_cpu(dx_root->dr_blkno),
603+
7, dx_root->dr_signature);
608604
}
609605

610606
return ret;
@@ -644,8 +640,8 @@ static int ocfs2_validate_dx_leaf(struct super_block *sb,
644640
}
645641

646642
if (!OCFS2_IS_VALID_DX_LEAF(dx_leaf)) {
647-
ret = ocfs2_error(sb, "Dir Index Leaf has bad signature %.*s",
648-
7, dx_leaf->dl_signature);
643+
ret = ocfs2_error(sb, "Dir Index Leaf has bad signature %.*s\n",
644+
7, dx_leaf->dl_signature);
649645
}
650646

651647
return ret;
@@ -808,9 +804,9 @@ static int ocfs2_dx_dir_lookup_rec(struct inode *inode,
808804

809805
if (el->l_tree_depth) {
810806
ret = ocfs2_error(inode->i_sb,
811-
"Inode %lu has non zero tree depth in "
812-
"btree tree block %llu\n", inode->i_ino,
813-
(unsigned long long)eb_bh->b_blocknr);
807+
"Inode %lu has non zero tree depth in btree tree block %llu\n",
808+
inode->i_ino,
809+
(unsigned long long)eb_bh->b_blocknr);
814810
goto out;
815811
}
816812
}
@@ -826,10 +822,11 @@ static int ocfs2_dx_dir_lookup_rec(struct inode *inode,
826822
}
827823

828824
if (!found) {
829-
ret = ocfs2_error(inode->i_sb, "Inode %lu has bad extent "
830-
"record (%u, %u, 0) in btree", inode->i_ino,
831-
le32_to_cpu(rec->e_cpos),
832-
ocfs2_rec_clusters(el, rec));
825+
ret = ocfs2_error(inode->i_sb,
826+
"Inode %lu has bad extent record (%u, %u, 0) in btree\n",
827+
inode->i_ino,
828+
le32_to_cpu(rec->e_cpos),
829+
ocfs2_rec_clusters(el, rec));
833830
goto out;
834831
}
835832

0 commit comments

Comments
 (0)