]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.suse/reiserfs-reiserfs-warning.diff
Add ignored *.diff files of the xen patches
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.suse / reiserfs-reiserfs-warning.diff
1 From: Jeff Mahoney <jeffm@suse.com>
2 Subject: reiserfs: rework reiserfs_warning
3
4 ReiserFS warnings can be somewhat inconsistent.
5 In some cases:
6 * a unique identifier may be associated with it
7 * the function name may be included
8 * the device may be printed separately
9
10 This patch aims to make warnings more consistent. reiserfs_warning() prints
11 the device name, so printing it a second time is not required. The function
12 name for a warning is always helpful in debugging, so it is now automatically
13 inserted into the output. Hans has stated that every warning should have
14 a unique identifier. Some cases lack them, others really shouldn't have them.
15 reiserfs_warning() now expects an id associated with each message. In the
16 rare case where one isn't needed, "" will suffice.
17
18 Signed-off-by: Jeff Mahoney <jeffm@suse.com>
19
20 --
21 fs/reiserfs/bitmap.c | 52 +++-----
22 fs/reiserfs/do_balan.c | 40 +++---
23 fs/reiserfs/file.c | 2
24 fs/reiserfs/fix_node.c | 14 +-
25 fs/reiserfs/inode.c | 60 ++++-----
26 fs/reiserfs/item_ops.c | 60 +++++----
27 fs/reiserfs/journal.c | 174 +++++++++++++++-------------
28 fs/reiserfs/lbalance.c | 12 +
29 fs/reiserfs/namei.c | 45 +++----
30 fs/reiserfs/objectid.c | 5
31 fs/reiserfs/prints.c | 11 +
32 fs/reiserfs/procfs.c | 5
33 fs/reiserfs/stree.c | 107 ++++++++---------
34 fs/reiserfs/super.c | 257 ++++++++++++++++++++++--------------------
35 fs/reiserfs/tail_conversion.c | 6
36 fs/reiserfs/xattr.c | 21 ++-
37 include/linux/reiserfs_fs.h | 9 -
38 17 files changed, 454 insertions(+), 426 deletions(-)
39
40 --- a/fs/reiserfs/bitmap.c
41 +++ b/fs/reiserfs/bitmap.c
42 @@ -64,8 +64,8 @@ int is_reusable(struct super_block *s, b
43 unsigned int bmap_count = reiserfs_bmap_count(s);
44
45 if (block == 0 || block >= SB_BLOCK_COUNT(s)) {
46 - reiserfs_warning(s,
47 - "vs-4010: is_reusable: block number is out of range %lu (%u)",
48 + reiserfs_warning(s, "vs-4010",
49 + "block number is out of range %lu (%u)",
50 block, SB_BLOCK_COUNT(s));
51 return 0;
52 }
53 @@ -79,30 +79,29 @@ int is_reusable(struct super_block *s, b
54 b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1;
55 if (block >= bmap1 &&
56 block <= bmap1 + bmap_count) {
57 - reiserfs_warning(s, "vs: 4019: is_reusable: "
58 - "bitmap block %lu(%u) can't be freed or reused",
59 + reiserfs_warning(s, "vs-4019", "bitmap block %lu(%u) "
60 + "can't be freed or reused",
61 block, bmap_count);
62 return 0;
63 }
64 } else {
65 if (offset == 0) {
66 - reiserfs_warning(s, "vs: 4020: is_reusable: "
67 - "bitmap block %lu(%u) can't be freed or reused",
68 + reiserfs_warning(s, "vs-4020", "bitmap block %lu(%u) "
69 + "can't be freed or reused",
70 block, bmap_count);
71 return 0;
72 }
73 }
74
75 if (bmap >= bmap_count) {
76 - reiserfs_warning(s,
77 - "vs-4030: is_reusable: there is no so many bitmap blocks: "
78 - "block=%lu, bitmap_nr=%u", block, bmap);
79 + reiserfs_warning(s, "vs-4030", "bitmap for requested block "
80 + "is out of range: block=%lu, bitmap_nr=%u",
81 + block, bmap);
82 return 0;
83 }
84
85 if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) {
86 - reiserfs_warning(s,
87 - "vs-4050: is_reusable: this is root block (%u), "
88 + reiserfs_warning(s, "vs-4050", "this is root block (%u), "
89 "it must be busy", SB_ROOT_BLOCK(s));
90 return 0;
91 }
92 @@ -154,8 +153,8 @@ static int scan_bitmap_block(struct reis
93 /* - I mean `a window of zero bits' as in description of this function - Zam. */
94
95 if (!bi) {
96 - reiserfs_warning(s, "NULL bitmap info pointer for bitmap %d",
97 - bmap_n);
98 + reiserfs_warning(s, "jdm-4055", "NULL bitmap info pointer "
99 + "for bitmap %d", bmap_n);
100 return 0;
101 }
102
103 @@ -400,11 +399,8 @@ static void _reiserfs_free_block(struct
104 get_bit_address(s, block, &nr, &offset);
105
106 if (nr >= reiserfs_bmap_count(s)) {
107 - reiserfs_warning(s, "vs-4075: reiserfs_free_block: "
108 - "block %lu is out of range on %s "
109 - "(nr=%u,max=%u)", block,
110 - reiserfs_bdevname(s), nr,
111 - reiserfs_bmap_count(s));
112 + reiserfs_warning(s, "vs-4075", "block %lu is out of range",
113 + block);
114 return;
115 }
116
117 @@ -416,9 +412,8 @@ static void _reiserfs_free_block(struct
118
119 /* clear bit for the given block in bit map */
120 if (!reiserfs_test_and_clear_le_bit(offset, bmbh->b_data)) {
121 - reiserfs_warning(s, "vs-4080: reiserfs_free_block: "
122 - "free_block (%s:%lu)[dev:blocknr]: bit already cleared",
123 - reiserfs_bdevname(s), block);
124 + reiserfs_warning(s, "vs-4080",
125 + "block %lu: bit already cleared", block);
126 }
127 apbi[nr].free_count++;
128 journal_mark_dirty(th, s, bmbh);
129 @@ -477,9 +472,8 @@ static void __discard_prealloc(struct re
130 BUG_ON(!th->t_trans_id);
131 #ifdef CONFIG_REISERFS_CHECK
132 if (ei->i_prealloc_count < 0)
133 - reiserfs_warning(th->t_super,
134 - "zam-4001:%s: inode has negative prealloc blocks count.",
135 - __func__);
136 + reiserfs_warning(th->t_super, "zam-4001",
137 + "inode has negative prealloc blocks count.");
138 #endif
139 while (ei->i_prealloc_count > 0) {
140 reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block);
141 @@ -515,9 +509,9 @@ void reiserfs_discard_all_prealloc(struc
142 i_prealloc_list);
143 #ifdef CONFIG_REISERFS_CHECK
144 if (!ei->i_prealloc_count) {
145 - reiserfs_warning(th->t_super,
146 - "zam-4001:%s: inode is in prealloc list but has no preallocated blocks.",
147 - __func__);
148 + reiserfs_warning(th->t_super, "zam-4001",
149 + "inode is in prealloc list but has "
150 + "no preallocated blocks.");
151 }
152 #endif
153 __discard_prealloc(th, ei);
154 @@ -631,8 +625,8 @@ int reiserfs_parse_alloc_options(struct
155 continue;
156 }
157
158 - reiserfs_warning(s, "zam-4001: %s : unknown option - %s",
159 - __func__, this_char);
160 + reiserfs_warning(s, "zam-4001", "unknown option - %s",
161 + this_char);
162 return 1;
163 }
164
165 --- a/fs/reiserfs/do_balan.c
166 +++ b/fs/reiserfs/do_balan.c
167 @@ -1752,15 +1752,16 @@ static void store_thrown(struct tree_bal
168 int i;
169
170 if (buffer_dirty(bh))
171 - reiserfs_warning(tb->tb_sb,
172 - "store_thrown deals with dirty buffer");
173 + reiserfs_warning(tb->tb_sb, "reiserfs-12320",
174 + "called with dirty buffer");
175 for (i = 0; i < ARRAY_SIZE(tb->thrown); i++)
176 if (!tb->thrown[i]) {
177 tb->thrown[i] = bh;
178 get_bh(bh); /* free_thrown puts this */
179 return;
180 }
181 - reiserfs_warning(tb->tb_sb, "store_thrown: too many thrown buffers");
182 + reiserfs_warning(tb->tb_sb, "reiserfs-12321",
183 + "too many thrown buffers");
184 }
185
186 static void free_thrown(struct tree_balance *tb)
187 @@ -1771,8 +1772,8 @@ static void free_thrown(struct tree_bala
188 if (tb->thrown[i]) {
189 blocknr = tb->thrown[i]->b_blocknr;
190 if (buffer_dirty(tb->thrown[i]))
191 - reiserfs_warning(tb->tb_sb,
192 - "free_thrown deals with dirty buffer %d",
193 + reiserfs_warning(tb->tb_sb, "reiserfs-12322",
194 + "called with dirty buffer %d",
195 blocknr);
196 brelse(tb->thrown[i]); /* incremented in store_thrown */
197 reiserfs_free_block(tb->transaction_handle, NULL,
198 @@ -1877,13 +1878,12 @@ static void check_internal_node(struct s
199 }
200 }
201
202 -static int locked_or_not_in_tree(struct buffer_head *bh, char *which)
203 +static int locked_or_not_in_tree(struct tree_balance *tb,
204 + struct buffer_head *bh, char *which)
205 {
206 if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) ||
207 !B_IS_IN_TREE(bh)) {
208 - reiserfs_warning(NULL,
209 - "vs-12339: locked_or_not_in_tree: %s (%b)",
210 - which, bh);
211 + reiserfs_warning(tb->tb_sb, "vs-12339", "%s (%b)", which, bh);
212 return 1;
213 }
214 return 0;
215 @@ -1902,18 +1902,19 @@ static int check_before_balancing(struct
216 /* double check that buffers that we will modify are unlocked. (fix_nodes should already have
217 prepped all of these for us). */
218 if (tb->lnum[0]) {
219 - retval |= locked_or_not_in_tree(tb->L[0], "L[0]");
220 - retval |= locked_or_not_in_tree(tb->FL[0], "FL[0]");
221 - retval |= locked_or_not_in_tree(tb->CFL[0], "CFL[0]");
222 + retval |= locked_or_not_in_tree(tb, tb->L[0], "L[0]");
223 + retval |= locked_or_not_in_tree(tb, tb->FL[0], "FL[0]");
224 + retval |= locked_or_not_in_tree(tb, tb->CFL[0], "CFL[0]");
225 check_leaf(tb->L[0]);
226 }
227 if (tb->rnum[0]) {
228 - retval |= locked_or_not_in_tree(tb->R[0], "R[0]");
229 - retval |= locked_or_not_in_tree(tb->FR[0], "FR[0]");
230 - retval |= locked_or_not_in_tree(tb->CFR[0], "CFR[0]");
231 + retval |= locked_or_not_in_tree(tb, tb->R[0], "R[0]");
232 + retval |= locked_or_not_in_tree(tb, tb->FR[0], "FR[0]");
233 + retval |= locked_or_not_in_tree(tb, tb->CFR[0], "CFR[0]");
234 check_leaf(tb->R[0]);
235 }
236 - retval |= locked_or_not_in_tree(PATH_PLAST_BUFFER(tb->tb_path), "S[0]");
237 + retval |= locked_or_not_in_tree(tb, PATH_PLAST_BUFFER(tb->tb_path),
238 + "S[0]");
239 check_leaf(PATH_PLAST_BUFFER(tb->tb_path));
240
241 return retval;
242 @@ -1952,7 +1953,7 @@ static void check_after_balance_leaf(str
243 PATH_H_POSITION(tb->tb_path,
244 1))));
245 print_cur_tb("12223");
246 - reiserfs_warning(tb->tb_sb,
247 + reiserfs_warning(tb->tb_sb, "reiserfs-12363",
248 "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; "
249 "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d",
250 left,
251 @@ -2104,9 +2105,8 @@ void do_balance(struct tree_balance *tb,
252 }
253 /* if we have no real work to do */
254 if (!tb->insert_size[0]) {
255 - reiserfs_warning(tb->tb_sb,
256 - "PAP-12350: do_balance: insert_size == 0, mode == %c",
257 - flag);
258 + reiserfs_warning(tb->tb_sb, "PAP-12350",
259 + "insert_size == 0, mode == %c", flag);
260 unfix_nodes(tb);
261 return;
262 }
263 --- a/fs/reiserfs/file.c
264 +++ b/fs/reiserfs/file.c
265 @@ -76,7 +76,7 @@ static int reiserfs_file_release(struct
266 * and let the admin know what is going on.
267 */
268 igrab(inode);
269 - reiserfs_warning(inode->i_sb,
270 + reiserfs_warning(inode->i_sb, "clm-9001",
271 "pinning inode %lu because the "
272 "preallocation can't be freed",
273 inode->i_ino);
274 --- a/fs/reiserfs/fix_node.c
275 +++ b/fs/reiserfs/fix_node.c
276 @@ -496,8 +496,8 @@ static int get_num_ver(int mode, struct
277 snum012[needed_nodes - 1 + 3] = units;
278
279 if (needed_nodes > 2)
280 - reiserfs_warning(tb->tb_sb, "vs-8111: get_num_ver: "
281 - "split_item_position is out of boundary");
282 + reiserfs_warning(tb->tb_sb, "vs-8111",
283 + "split_item_position is out of range");
284 snum012[needed_nodes - 1]++;
285 split_item_positions[needed_nodes - 1] = i;
286 needed_nodes++;
287 @@ -533,8 +533,8 @@ static int get_num_ver(int mode, struct
288
289 if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY &&
290 vn->vn_vi[split_item_num].vi_index != TYPE_INDIRECT)
291 - reiserfs_warning(tb->tb_sb, "vs-8115: get_num_ver: not "
292 - "directory or indirect item");
293 + reiserfs_warning(tb->tb_sb, "vs-8115",
294 + "not directory or indirect item");
295 }
296
297 /* now we know S2bytes, calculate S1bytes */
298 @@ -2268,9 +2268,9 @@ static int wait_tb_buffers_until_unlocke
299 #ifdef CONFIG_REISERFS_CHECK
300 repeat_counter++;
301 if ((repeat_counter % 10000) == 0) {
302 - reiserfs_warning(p_s_tb->tb_sb,
303 - "wait_tb_buffers_until_released(): too many "
304 - "iterations waiting for buffer to unlock "
305 + reiserfs_warning(p_s_tb->tb_sb, "reiserfs-8200",
306 + "too many iterations waiting "
307 + "for buffer to unlock "
308 "(%b)", locked);
309
310 /* Don't loop forever. Try to recover from possible error. */
311 --- a/fs/reiserfs/inode.c
312 +++ b/fs/reiserfs/inode.c
313 @@ -842,7 +842,9 @@ int reiserfs_get_block(struct inode *ino
314 if (retval) {
315 if (retval != -ENOSPC)
316 reiserfs_warning(inode->i_sb,
317 - "clm-6004: convert tail failed inode %lu, error %d",
318 + "clm-6004",
319 + "convert tail failed "
320 + "inode %lu, error %d",
321 inode->i_ino,
322 retval);
323 if (allocated_block_nr) {
324 @@ -1006,8 +1008,7 @@ int reiserfs_get_block(struct inode *ino
325 goto failure;
326 }
327 if (retval == POSITION_FOUND) {
328 - reiserfs_warning(inode->i_sb,
329 - "vs-825: reiserfs_get_block: "
330 + reiserfs_warning(inode->i_sb, "vs-825",
331 "%K should not be found", &key);
332 retval = -EEXIST;
333 if (allocated_block_nr)
334 @@ -1332,9 +1333,9 @@ void reiserfs_update_sd_size(struct reis
335 /* look for the object's stat data */
336 retval = search_item(inode->i_sb, &key, &path);
337 if (retval == IO_ERROR) {
338 - reiserfs_warning(inode->i_sb,
339 - "vs-13050: reiserfs_update_sd: "
340 - "i/o failure occurred trying to update %K stat data",
341 + reiserfs_warning(inode->i_sb, "vs-13050",
342 + "i/o failure occurred trying to "
343 + "update %K stat data",
344 &key);
345 return;
346 }
347 @@ -1345,9 +1346,9 @@ void reiserfs_update_sd_size(struct reis
348 /*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found"); */
349 return;
350 }
351 - reiserfs_warning(inode->i_sb,
352 - "vs-13060: reiserfs_update_sd: "
353 - "stat data of object %k (nlink == %d) not found (pos %d)",
354 + reiserfs_warning(inode->i_sb, "vs-13060",
355 + "stat data of object %k (nlink == %d) "
356 + "not found (pos %d)",
357 INODE_PKEY(inode), inode->i_nlink,
358 pos);
359 reiserfs_check_path(&path);
360 @@ -1424,10 +1425,9 @@ void reiserfs_read_locked_inode(struct i
361 /* look for the object's stat data */
362 retval = search_item(inode->i_sb, &key, &path_to_sd);
363 if (retval == IO_ERROR) {
364 - reiserfs_warning(inode->i_sb,
365 - "vs-13070: reiserfs_read_locked_inode: "
366 - "i/o failure occurred trying to find stat data of %K",
367 - &key);
368 + reiserfs_warning(inode->i_sb, "vs-13070",
369 + "i/o failure occurred trying to find "
370 + "stat data of %K", &key);
371 reiserfs_make_bad_inode(inode);
372 return;
373 }
374 @@ -1457,8 +1457,7 @@ void reiserfs_read_locked_inode(struct i
375 during mount (fs/reiserfs/super.c:finish_unfinished()). */
376 if ((inode->i_nlink == 0) &&
377 !REISERFS_SB(inode->i_sb)->s_is_unlinked_ok) {
378 - reiserfs_warning(inode->i_sb,
379 - "vs-13075: reiserfs_read_locked_inode: "
380 + reiserfs_warning(inode->i_sb, "vs-13075",
381 "dead inode read from disk %K. "
382 "This is likely to be race with knfsd. Ignore",
383 &key);
384 @@ -1564,7 +1563,7 @@ struct dentry *reiserfs_fh_to_dentry(str
385 */
386 if (fh_type > fh_len) {
387 if (fh_type != 6 || fh_len != 5)
388 - reiserfs_warning(sb,
389 + reiserfs_warning(sb, "reiserfs-13077",
390 "nfsd/reiserfs, fhtype=%d, len=%d - odd",
391 fh_type, fh_len);
392 fh_type = 5;
393 @@ -1689,13 +1688,13 @@ static int reiserfs_new_directory(struct
394 /* look for place in the tree for new item */
395 retval = search_item(sb, &key, path);
396 if (retval == IO_ERROR) {
397 - reiserfs_warning(sb, "vs-13080: reiserfs_new_directory: "
398 + reiserfs_warning(sb, "vs-13080",
399 "i/o failure occurred creating new directory");
400 return -EIO;
401 }
402 if (retval == ITEM_FOUND) {
403 pathrelse(path);
404 - reiserfs_warning(sb, "vs-13070: reiserfs_new_directory: "
405 + reiserfs_warning(sb, "vs-13070",
406 "object with this key exists (%k)",
407 &(ih->ih_key));
408 return -EEXIST;
409 @@ -1729,13 +1728,13 @@ static int reiserfs_new_symlink(struct r
410 /* look for place in the tree for new item */
411 retval = search_item(sb, &key, path);
412 if (retval == IO_ERROR) {
413 - reiserfs_warning(sb, "vs-13080: reiserfs_new_symlinik: "
414 + reiserfs_warning(sb, "vs-13080",
415 "i/o failure occurred creating new symlink");
416 return -EIO;
417 }
418 if (retval == ITEM_FOUND) {
419 pathrelse(path);
420 - reiserfs_warning(sb, "vs-13080: reiserfs_new_symlink: "
421 + reiserfs_warning(sb, "vs-13080",
422 "object with this key exists (%k)",
423 &(ih->ih_key));
424 return -EEXIST;
425 @@ -1932,7 +1931,8 @@ int reiserfs_new_inode(struct reiserfs_t
426 goto out_inserted_sd;
427 }
428 } else if (inode->i_sb->s_flags & MS_POSIXACL) {
429 - reiserfs_warning(inode->i_sb, "ACLs aren't enabled in the fs, "
430 + reiserfs_warning(inode->i_sb, "jdm-13090",
431 + "ACLs aren't enabled in the fs, "
432 "but vfs thinks they are!");
433 } else if (is_reiserfs_priv_object(dir)) {
434 reiserfs_mark_inode_private(inode);
435 @@ -2049,8 +2049,8 @@ static int grab_tail_page(struct inode *
436 ** I've screwed up the code to find the buffer, or the code to
437 ** call prepare_write
438 */
439 - reiserfs_warning(p_s_inode->i_sb,
440 - "clm-6000: error reading block %lu on dev %s",
441 + reiserfs_warning(p_s_inode->i_sb, "clm-6000",
442 + "error reading block %lu on dev %s",
443 bh->b_blocknr,
444 reiserfs_bdevname(p_s_inode->i_sb));
445 error = -EIO;
446 @@ -2094,8 +2094,8 @@ int reiserfs_truncate_file(struct inode
447 // and get_block_create_0 could not find a block to read in,
448 // which is ok.
449 if (error != -ENOENT)
450 - reiserfs_warning(p_s_inode->i_sb,
451 - "clm-6001: grab_tail_page failed %d",
452 + reiserfs_warning(p_s_inode->i_sb, "clm-6001",
453 + "grab_tail_page failed %d",
454 error);
455 page = NULL;
456 bh = NULL;
457 @@ -2213,9 +2213,8 @@ static int map_block_for_writepage(struc
458 /* we've found an unformatted node */
459 if (indirect_item_found(retval, ih)) {
460 if (bytes_copied > 0) {
461 - reiserfs_warning(inode->i_sb,
462 - "clm-6002: bytes_copied %d",
463 - bytes_copied);
464 + reiserfs_warning(inode->i_sb, "clm-6002",
465 + "bytes_copied %d", bytes_copied);
466 }
467 if (!get_block_num(item, pos_in_item)) {
468 /* crap, we are writing to a hole */
469 @@ -2272,9 +2271,8 @@ static int map_block_for_writepage(struc
470 goto research;
471 }
472 } else {
473 - reiserfs_warning(inode->i_sb,
474 - "clm-6003: bad item inode %lu, device %s",
475 - inode->i_ino, reiserfs_bdevname(inode->i_sb));
476 + reiserfs_warning(inode->i_sb, "clm-6003",
477 + "bad item inode %lu", inode->i_ino);
478 retval = -EIO;
479 goto out;
480 }
481 --- a/fs/reiserfs/item_ops.c
482 +++ b/fs/reiserfs/item_ops.c
483 @@ -97,7 +97,8 @@ static int sd_unit_num(struct virtual_it
484
485 static void sd_print_vi(struct virtual_item *vi)
486 {
487 - reiserfs_warning(NULL, "STATDATA, index %d, type 0x%x, %h",
488 + reiserfs_warning(NULL, "reiserfs-16100",
489 + "STATDATA, index %d, type 0x%x, %h",
490 vi->vi_index, vi->vi_type, vi->vi_ih);
491 }
492
493 @@ -190,7 +191,8 @@ static int direct_unit_num(struct virtua
494
495 static void direct_print_vi(struct virtual_item *vi)
496 {
497 - reiserfs_warning(NULL, "DIRECT, index %d, type 0x%x, %h",
498 + reiserfs_warning(NULL, "reiserfs-16101",
499 + "DIRECT, index %d, type 0x%x, %h",
500 vi->vi_index, vi->vi_type, vi->vi_ih);
501 }
502
503 @@ -278,7 +280,7 @@ static void indirect_print_item(struct i
504 unp = (__le32 *) item;
505
506 if (ih_item_len(ih) % UNFM_P_SIZE)
507 - reiserfs_warning(NULL, "indirect_print_item: invalid item len");
508 + reiserfs_warning(NULL, "reiserfs-16102", "invalid item len");
509
510 printk("%d pointers\n[ ", (int)I_UNFM_NUM(ih));
511 for (j = 0; j < I_UNFM_NUM(ih); j++) {
512 @@ -334,7 +336,8 @@ static int indirect_unit_num(struct virt
513
514 static void indirect_print_vi(struct virtual_item *vi)
515 {
516 - reiserfs_warning(NULL, "INDIRECT, index %d, type 0x%x, %h",
517 + reiserfs_warning(NULL, "reiserfs-16103",
518 + "INDIRECT, index %d, type 0x%x, %h",
519 vi->vi_index, vi->vi_type, vi->vi_ih);
520 }
521
522 @@ -359,7 +362,7 @@ static struct item_operations indirect_o
523
524 static int direntry_bytes_number(struct item_head *ih, int block_size)
525 {
526 - reiserfs_warning(NULL, "vs-16090: direntry_bytes_number: "
527 + reiserfs_warning(NULL, "vs-16090",
528 "bytes number is asked for direntry");
529 return 0;
530 }
531 @@ -614,7 +617,8 @@ static void direntry_print_vi(struct vir
532 int i;
533 struct direntry_uarea *dir_u = vi->vi_uarea;
534
535 - reiserfs_warning(NULL, "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x",
536 + reiserfs_warning(NULL, "reiserfs-16104",
537 + "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x",
538 vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags);
539 printk("%d entries: ", dir_u->entry_count);
540 for (i = 0; i < dir_u->entry_count; i++)
541 @@ -642,43 +646,43 @@ static struct item_operations direntry_o
542 //
543 static int errcatch_bytes_number(struct item_head *ih, int block_size)
544 {
545 - reiserfs_warning(NULL,
546 - "green-16001: Invalid item type observed, run fsck ASAP");
547 + reiserfs_warning(NULL, "green-16001",
548 + "Invalid item type observed, run fsck ASAP");
549 return 0;
550 }
551
552 static void errcatch_decrement_key(struct cpu_key *key)
553 {
554 - reiserfs_warning(NULL,
555 - "green-16002: Invalid item type observed, run fsck ASAP");
556 + reiserfs_warning(NULL, "green-16002",
557 + "Invalid item type observed, run fsck ASAP");
558 }
559
560 static int errcatch_is_left_mergeable(struct reiserfs_key *key,
561 unsigned long bsize)
562 {
563 - reiserfs_warning(NULL,
564 - "green-16003: Invalid item type observed, run fsck ASAP");
565 + reiserfs_warning(NULL, "green-16003",
566 + "Invalid item type observed, run fsck ASAP");
567 return 0;
568 }
569
570 static void errcatch_print_item(struct item_head *ih, char *item)
571 {
572 - reiserfs_warning(NULL,
573 - "green-16004: Invalid item type observed, run fsck ASAP");
574 + reiserfs_warning(NULL, "green-16004",
575 + "Invalid item type observed, run fsck ASAP");
576 }
577
578 static void errcatch_check_item(struct item_head *ih, char *item)
579 {
580 - reiserfs_warning(NULL,
581 - "green-16005: Invalid item type observed, run fsck ASAP");
582 + reiserfs_warning(NULL, "green-16005",
583 + "Invalid item type observed, run fsck ASAP");
584 }
585
586 static int errcatch_create_vi(struct virtual_node *vn,
587 struct virtual_item *vi,
588 int is_affected, int insert_size)
589 {
590 - reiserfs_warning(NULL,
591 - "green-16006: Invalid item type observed, run fsck ASAP");
592 + reiserfs_warning(NULL, "green-16006",
593 + "Invalid item type observed, run fsck ASAP");
594 return 0; // We might return -1 here as well, but it won't help as create_virtual_node() from where
595 // this operation is called from is of return type void.
596 }
597 @@ -686,36 +690,36 @@ static int errcatch_create_vi(struct vir
598 static int errcatch_check_left(struct virtual_item *vi, int free,
599 int start_skip, int end_skip)
600 {
601 - reiserfs_warning(NULL,
602 - "green-16007: Invalid item type observed, run fsck ASAP");
603 + reiserfs_warning(NULL, "green-16007",
604 + "Invalid item type observed, run fsck ASAP");
605 return -1;
606 }
607
608 static int errcatch_check_right(struct virtual_item *vi, int free)
609 {
610 - reiserfs_warning(NULL,
611 - "green-16008: Invalid item type observed, run fsck ASAP");
612 + reiserfs_warning(NULL, "green-16008",
613 + "Invalid item type observed, run fsck ASAP");
614 return -1;
615 }
616
617 static int errcatch_part_size(struct virtual_item *vi, int first, int count)
618 {
619 - reiserfs_warning(NULL,
620 - "green-16009: Invalid item type observed, run fsck ASAP");
621 + reiserfs_warning(NULL, "green-16009",
622 + "Invalid item type observed, run fsck ASAP");
623 return 0;
624 }
625
626 static int errcatch_unit_num(struct virtual_item *vi)
627 {
628 - reiserfs_warning(NULL,
629 - "green-16010: Invalid item type observed, run fsck ASAP");
630 + reiserfs_warning(NULL, "green-16010",
631 + "Invalid item type observed, run fsck ASAP");
632 return 0;
633 }
634
635 static void errcatch_print_vi(struct virtual_item *vi)
636 {
637 - reiserfs_warning(NULL,
638 - "green-16011: Invalid item type observed, run fsck ASAP");
639 + reiserfs_warning(NULL, "green-16011",
640 + "Invalid item type observed, run fsck ASAP");
641 }
642
643 static struct item_operations errcatch_ops = {
644 --- a/fs/reiserfs/journal.c
645 +++ b/fs/reiserfs/journal.c
646 @@ -300,8 +300,8 @@ int reiserfs_allocate_list_bitmaps(struc
647 jb->journal_list = NULL;
648 jb->bitmaps = vmalloc(mem);
649 if (!jb->bitmaps) {
650 - reiserfs_warning(p_s_sb,
651 - "clm-2000, unable to allocate bitmaps for journal lists");
652 + reiserfs_warning(p_s_sb, "clm-2000", "unable to "
653 + "allocate bitmaps for journal lists");
654 failed = 1;
655 break;
656 }
657 @@ -644,8 +644,8 @@ static void reiserfs_end_buffer_io_sync(
658 char b[BDEVNAME_SIZE];
659
660 if (buffer_journaled(bh)) {
661 - reiserfs_warning(NULL,
662 - "clm-2084: pinned buffer %lu:%s sent to disk",
663 + reiserfs_warning(NULL, "clm-2084",
664 + "pinned buffer %lu:%s sent to disk",
665 bh->b_blocknr, bdevname(bh->b_bdev, b));
666 }
667 if (uptodate)
668 @@ -1122,7 +1122,8 @@ static int flush_commit_list(struct supe
669 sync_dirty_buffer(tbh);
670 if (unlikely(!buffer_uptodate(tbh))) {
671 #ifdef CONFIG_REISERFS_CHECK
672 - reiserfs_warning(s, "journal-601, buffer write failed");
673 + reiserfs_warning(s, "journal-601",
674 + "buffer write failed");
675 #endif
676 retval = -EIO;
677 }
678 @@ -1154,14 +1155,14 @@ static int flush_commit_list(struct supe
679 * up propagating the write error out to the filesystem. */
680 if (unlikely(!buffer_uptodate(jl->j_commit_bh))) {
681 #ifdef CONFIG_REISERFS_CHECK
682 - reiserfs_warning(s, "journal-615: buffer write failed");
683 + reiserfs_warning(s, "journal-615", "buffer write failed");
684 #endif
685 retval = -EIO;
686 }
687 bforget(jl->j_commit_bh);
688 if (journal->j_last_commit_id != 0 &&
689 (jl->j_trans_id - journal->j_last_commit_id) != 1) {
690 - reiserfs_warning(s, "clm-2200: last commit %lu, current %lu",
691 + reiserfs_warning(s, "clm-2200", "last commit %lu, current %lu",
692 journal->j_last_commit_id, jl->j_trans_id);
693 }
694 journal->j_last_commit_id = jl->j_trans_id;
695 @@ -1250,7 +1251,7 @@ static void remove_all_from_journal_list
696 while (cn) {
697 if (cn->blocknr != 0) {
698 if (debug) {
699 - reiserfs_warning(p_s_sb,
700 + reiserfs_warning(p_s_sb, "reiserfs-2201",
701 "block %u, bh is %d, state %ld",
702 cn->blocknr, cn->bh ? 1 : 0,
703 cn->state);
704 @@ -1288,8 +1289,8 @@ static int _update_journal_header_block(
705 wait_on_buffer((journal->j_header_bh));
706 if (unlikely(!buffer_uptodate(journal->j_header_bh))) {
707 #ifdef CONFIG_REISERFS_CHECK
708 - reiserfs_warning(p_s_sb,
709 - "journal-699: buffer write failed");
710 + reiserfs_warning(p_s_sb, "journal-699",
711 + "buffer write failed");
712 #endif
713 return -EIO;
714 }
715 @@ -1319,8 +1320,8 @@ static int _update_journal_header_block(
716 sync_dirty_buffer(journal->j_header_bh);
717 }
718 if (!buffer_uptodate(journal->j_header_bh)) {
719 - reiserfs_warning(p_s_sb,
720 - "journal-837: IO error during journal replay");
721 + reiserfs_warning(p_s_sb, "journal-837",
722 + "IO error during journal replay");
723 return -EIO;
724 }
725 }
726 @@ -1401,8 +1402,7 @@ static int flush_journal_list(struct sup
727 BUG_ON(j_len_saved <= 0);
728
729 if (atomic_read(&journal->j_wcount) != 0) {
730 - reiserfs_warning(s,
731 - "clm-2048: flush_journal_list called with wcount %d",
732 + reiserfs_warning(s, "clm-2048", "called with wcount %d",
733 atomic_read(&journal->j_wcount));
734 }
735 BUG_ON(jl->j_trans_id == 0);
736 @@ -1510,8 +1510,8 @@ static int flush_journal_list(struct sup
737 ** is not marked JDirty_wait
738 */
739 if ((!was_jwait) && !buffer_locked(saved_bh)) {
740 - reiserfs_warning(s,
741 - "journal-813: BAD! buffer %llu %cdirty %cjwait, "
742 + reiserfs_warning(s, "journal-813",
743 + "BAD! buffer %llu %cdirty %cjwait, "
744 "not in a newer tranasction",
745 (unsigned long long)saved_bh->
746 b_blocknr, was_dirty ? ' ' : '!',
747 @@ -1529,8 +1529,8 @@ static int flush_journal_list(struct sup
748 unlock_buffer(saved_bh);
749 count++;
750 } else {
751 - reiserfs_warning(s,
752 - "clm-2082: Unable to flush buffer %llu in %s",
753 + reiserfs_warning(s, "clm-2082",
754 + "Unable to flush buffer %llu in %s",
755 (unsigned long long)saved_bh->
756 b_blocknr, __func__);
757 }
758 @@ -1541,8 +1541,8 @@ static int flush_journal_list(struct sup
759 /* we incremented this to keep others from taking the buffer head away */
760 put_bh(saved_bh);
761 if (atomic_read(&(saved_bh->b_count)) < 0) {
762 - reiserfs_warning(s,
763 - "journal-945: saved_bh->b_count < 0");
764 + reiserfs_warning(s, "journal-945",
765 + "saved_bh->b_count < 0");
766 }
767 }
768 }
769 @@ -1561,8 +1561,8 @@ static int flush_journal_list(struct sup
770 }
771 if (unlikely(!buffer_uptodate(cn->bh))) {
772 #ifdef CONFIG_REISERFS_CHECK
773 - reiserfs_warning(s,
774 - "journal-949: buffer write failed\n");
775 + reiserfs_warning(s, "journal-949",
776 + "buffer write failed");
777 #endif
778 err = -EIO;
779 }
780 @@ -1623,7 +1623,7 @@ static int flush_journal_list(struct sup
781
782 if (journal->j_last_flush_id != 0 &&
783 (jl->j_trans_id - journal->j_last_flush_id) != 1) {
784 - reiserfs_warning(s, "clm-2201: last flush %lu, current %lu",
785 + reiserfs_warning(s, "clm-2201", "last flush %lu, current %lu",
786 journal->j_last_flush_id, jl->j_trans_id);
787 }
788 journal->j_last_flush_id = jl->j_trans_id;
789 @@ -2058,8 +2058,9 @@ static int journal_transaction_is_valid(
790 return -1;
791 }
792 if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) {
793 - reiserfs_warning(p_s_sb,
794 - "journal-2018: Bad transaction length %d encountered, ignoring transaction",
795 + reiserfs_warning(p_s_sb, "journal-2018",
796 + "Bad transaction length %d "
797 + "encountered, ignoring transaction",
798 get_desc_trans_len(desc));
799 return -1;
800 }
801 @@ -2195,8 +2196,8 @@ static int journal_read_transaction(stru
802 brelse(d_bh);
803 kfree(log_blocks);
804 kfree(real_blocks);
805 - reiserfs_warning(p_s_sb,
806 - "journal-1169: kmalloc failed, unable to mount FS");
807 + reiserfs_warning(p_s_sb, "journal-1169",
808 + "kmalloc failed, unable to mount FS");
809 return -1;
810 }
811 /* get all the buffer heads */
812 @@ -2218,15 +2219,18 @@ static int journal_read_transaction(stru
813 j_realblock[i - trans_half]));
814 }
815 if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) {
816 - reiserfs_warning(p_s_sb,
817 - "journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem");
818 + reiserfs_warning(p_s_sb, "journal-1207",
819 + "REPLAY FAILURE fsck required! "
820 + "Block to replay is outside of "
821 + "filesystem");
822 goto abort_replay;
823 }
824 /* make sure we don't try to replay onto log or reserved area */
825 if (is_block_in_log_or_reserved_area
826 (p_s_sb, real_blocks[i]->b_blocknr)) {
827 - reiserfs_warning(p_s_sb,
828 - "journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block");
829 + reiserfs_warning(p_s_sb, "journal-1204",
830 + "REPLAY FAILURE fsck required! "
831 + "Trying to replay onto a log block");
832 abort_replay:
833 brelse_array(log_blocks, i);
834 brelse_array(real_blocks, i);
835 @@ -2242,8 +2246,9 @@ static int journal_read_transaction(stru
836 for (i = 0; i < get_desc_trans_len(desc); i++) {
837 wait_on_buffer(log_blocks[i]);
838 if (!buffer_uptodate(log_blocks[i])) {
839 - reiserfs_warning(p_s_sb,
840 - "journal-1212: REPLAY FAILURE fsck required! buffer write failed");
841 + reiserfs_warning(p_s_sb, "journal-1212",
842 + "REPLAY FAILURE fsck required! "
843 + "buffer write failed");
844 brelse_array(log_blocks + i,
845 get_desc_trans_len(desc) - i);
846 brelse_array(real_blocks, get_desc_trans_len(desc));
847 @@ -2266,8 +2271,9 @@ static int journal_read_transaction(stru
848 for (i = 0; i < get_desc_trans_len(desc); i++) {
849 wait_on_buffer(real_blocks[i]);
850 if (!buffer_uptodate(real_blocks[i])) {
851 - reiserfs_warning(p_s_sb,
852 - "journal-1226: REPLAY FAILURE, fsck required! buffer write failed");
853 + reiserfs_warning(p_s_sb, "journal-1226",
854 + "REPLAY FAILURE, fsck required! "
855 + "buffer write failed");
856 brelse_array(real_blocks + i,
857 get_desc_trans_len(desc) - i);
858 brelse(c_bh);
859 @@ -2418,8 +2424,8 @@ static int journal_read(struct super_blo
860 }
861
862 if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) {
863 - reiserfs_warning(p_s_sb,
864 - "clm-2076: device is readonly, unable to replay log");
865 + reiserfs_warning(p_s_sb, "clm-2076",
866 + "device is readonly, unable to replay log");
867 return -1;
868 }
869
870 @@ -2580,9 +2586,8 @@ static int release_journal_dev(struct su
871 }
872
873 if (result != 0) {
874 - reiserfs_warning(super,
875 - "sh-457: release_journal_dev: Cannot release journal device: %i",
876 - result);
877 + reiserfs_warning(super, "sh-457",
878 + "Cannot release journal device: %i", result);
879 }
880 return result;
881 }
882 @@ -2611,7 +2616,7 @@ static int journal_init_dev(struct super
883 if (IS_ERR(journal->j_dev_bd)) {
884 result = PTR_ERR(journal->j_dev_bd);
885 journal->j_dev_bd = NULL;
886 - reiserfs_warning(super, "sh-458: journal_init_dev: "
887 + reiserfs_warning(super, "sh-458",
888 "cannot init journal device '%s': %i",
889 __bdevname(jdev, b), result);
890 return result;
891 @@ -2673,16 +2678,16 @@ static int check_advise_trans_params(str
892 journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio ||
893 SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max <
894 JOURNAL_MIN_RATIO) {
895 - reiserfs_warning(p_s_sb,
896 - "sh-462: bad transaction max size (%u). FSCK?",
897 - journal->j_trans_max);
898 + reiserfs_warning(p_s_sb, "sh-462",
899 + "bad transaction max size (%u). "
900 + "FSCK?", journal->j_trans_max);
901 return 1;
902 }
903 if (journal->j_max_batch != (journal->j_trans_max) *
904 JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) {
905 - reiserfs_warning(p_s_sb,
906 - "sh-463: bad transaction max batch (%u). FSCK?",
907 - journal->j_max_batch);
908 + reiserfs_warning(p_s_sb, "sh-463",
909 + "bad transaction max batch (%u). "
910 + "FSCK?", journal->j_max_batch);
911 return 1;
912 }
913 } else {
914 @@ -2690,9 +2695,11 @@ static int check_advise_trans_params(str
915 The file system was created by old version
916 of mkreiserfs, so some fields contain zeros,
917 and we need to advise proper values for them */
918 - if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE)
919 - reiserfs_panic(p_s_sb, "sh-464: bad blocksize (%u)",
920 - p_s_sb->s_blocksize);
921 + if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) {
922 + reiserfs_warning(p_s_sb, "sh-464", "bad blocksize (%u)",
923 + p_s_sb->s_blocksize);
924 + return 1;
925 + }
926 journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT;
927 journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT;
928 journal->j_max_commit_age = JOURNAL_MAX_COMMIT_AGE;
929 @@ -2716,8 +2723,8 @@ int journal_init(struct super_block *p_s
930
931 journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal));
932 if (!journal) {
933 - reiserfs_warning(p_s_sb,
934 - "journal-1256: unable to get memory for journal structure");
935 + reiserfs_warning(p_s_sb, "journal-1256",
936 + "unable to get memory for journal structure");
937 return 1;
938 }
939 memset(journal, 0, sizeof(struct reiserfs_journal));
940 @@ -2746,9 +2753,9 @@ int journal_init(struct super_block *p_s
941 if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) &&
942 (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) +
943 SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) {
944 - reiserfs_warning(p_s_sb,
945 - "journal-1393: journal does not fit for area "
946 - "addressed by first of bitmap blocks. It starts at "
947 + reiserfs_warning(p_s_sb, "journal-1393",
948 + "journal does not fit for area addressed "
949 + "by first of bitmap blocks. It starts at "
950 "%u and its size is %u. Block size %ld",
951 SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb),
952 SB_ONDISK_JOURNAL_SIZE(p_s_sb),
953 @@ -2757,8 +2764,8 @@ int journal_init(struct super_block *p_s
954 }
955
956 if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) {
957 - reiserfs_warning(p_s_sb,
958 - "sh-462: unable to initialize jornal device");
959 + reiserfs_warning(p_s_sb, "sh-462",
960 + "unable to initialize jornal device");
961 goto free_and_return;
962 }
963
964 @@ -2769,8 +2776,8 @@ int journal_init(struct super_block *p_s
965 SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) +
966 SB_ONDISK_JOURNAL_SIZE(p_s_sb));
967 if (!bhjh) {
968 - reiserfs_warning(p_s_sb,
969 - "sh-459: unable to read journal header");
970 + reiserfs_warning(p_s_sb, "sh-459",
971 + "unable to read journal header");
972 goto free_and_return;
973 }
974 jh = (struct reiserfs_journal_header *)(bhjh->b_data);
975 @@ -2779,10 +2786,10 @@ int journal_init(struct super_block *p_s
976 if (is_reiserfs_jr(rs)
977 && (le32_to_cpu(jh->jh_journal.jp_journal_magic) !=
978 sb_jp_journal_magic(rs))) {
979 - reiserfs_warning(p_s_sb,
980 - "sh-460: journal header magic %x "
981 - "(device %s) does not match to magic found in super "
982 - "block %x", jh->jh_journal.jp_journal_magic,
983 + reiserfs_warning(p_s_sb, "sh-460",
984 + "journal header magic %x (device %s) does "
985 + "not match to magic found in super block %x",
986 + jh->jh_journal.jp_journal_magic,
987 bdevname(journal->j_dev_bd, b),
988 sb_jp_journal_magic(rs));
989 brelse(bhjh);
990 @@ -2849,7 +2856,7 @@ int journal_init(struct super_block *p_s
991 journal->j_must_wait = 0;
992
993 if (journal->j_cnode_free == 0) {
994 - reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory "
995 + reiserfs_warning(p_s_sb, "journal-2004", "Journal cnode memory "
996 "allocation failed (%ld bytes). Journal is "
997 "too large for available memory. Usually "
998 "this is due to a journal that is too large.",
999 @@ -2861,12 +2868,13 @@ int journal_init(struct super_block *p_s
1000 jl = journal->j_current_jl;
1001 jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);
1002 if (!jl->j_list_bitmap) {
1003 - reiserfs_warning(p_s_sb,
1004 - "journal-2005, get_list_bitmap failed for journal list 0");
1005 + reiserfs_warning(p_s_sb, "journal-2005",
1006 + "get_list_bitmap failed for journal list 0");
1007 goto free_and_return;
1008 }
1009 if (journal_read(p_s_sb) < 0) {
1010 - reiserfs_warning(p_s_sb, "Replay Failure, unable to mount");
1011 + reiserfs_warning(p_s_sb, "reiserfs-2006",
1012 + "Replay Failure, unable to mount");
1013 goto free_and_return;
1014 }
1015
1016 @@ -3193,16 +3201,17 @@ int journal_begin(struct reiserfs_transa
1017 cur_th->t_refcount++;
1018 memcpy(th, cur_th, sizeof(*th));
1019 if (th->t_refcount <= 1)
1020 - reiserfs_warning(p_s_sb,
1021 - "BAD: refcount <= 1, but journal_info != 0");
1022 + reiserfs_warning(p_s_sb, "reiserfs-2005",
1023 + "BAD: refcount <= 1, but "
1024 + "journal_info != 0");
1025 return 0;
1026 } else {
1027 /* we've ended up with a handle from a different filesystem.
1028 ** save it and restore on journal_end. This should never
1029 ** really happen...
1030 */
1031 - reiserfs_warning(p_s_sb,
1032 - "clm-2100: nesting info a different FS");
1033 + reiserfs_warning(p_s_sb, "clm-2100",
1034 + "nesting info a different FS");
1035 th->t_handle_save = current->journal_info;
1036 current->journal_info = th;
1037 }
1038 @@ -3263,7 +3272,8 @@ int journal_mark_dirty(struct reiserfs_t
1039 ** could get to disk too early. NOT GOOD.
1040 */
1041 if (!prepared || buffer_dirty(bh)) {
1042 - reiserfs_warning(p_s_sb, "journal-1777: buffer %llu bad state "
1043 + reiserfs_warning(p_s_sb, "journal-1777",
1044 + "buffer %llu bad state "
1045 "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT",
1046 (unsigned long long)bh->b_blocknr,
1047 prepared ? ' ' : '!',
1048 @@ -3273,8 +3283,8 @@ int journal_mark_dirty(struct reiserfs_t
1049 }
1050
1051 if (atomic_read(&(journal->j_wcount)) <= 0) {
1052 - reiserfs_warning(p_s_sb,
1053 - "journal-1409: journal_mark_dirty returning because j_wcount was %d",
1054 + reiserfs_warning(p_s_sb, "journal-1409",
1055 + "returning because j_wcount was %d",
1056 atomic_read(&(journal->j_wcount)));
1057 return 1;
1058 }
1059 @@ -3339,8 +3349,8 @@ int journal_end(struct reiserfs_transact
1060 struct super_block *p_s_sb, unsigned long nblocks)
1061 {
1062 if (!current->journal_info && th->t_refcount > 1)
1063 - reiserfs_warning(p_s_sb, "REISER-NESTING: th NULL, refcount %d",
1064 - th->t_refcount);
1065 + reiserfs_warning(p_s_sb, "REISER-NESTING",
1066 + "th NULL, refcount %d", th->t_refcount);
1067
1068 if (!th->t_trans_id) {
1069 WARN_ON(1);
1070 @@ -3410,8 +3420,8 @@ static int remove_from_transaction(struc
1071 clear_buffer_journal_test(bh);
1072 put_bh(bh);
1073 if (atomic_read(&(bh->b_count)) < 0) {
1074 - reiserfs_warning(p_s_sb,
1075 - "journal-1752: remove from trans, b_count < 0");
1076 + reiserfs_warning(p_s_sb, "journal-1752",
1077 + "b_count < 0");
1078 }
1079 ret = 1;
1080 }
1081 @@ -3731,7 +3741,8 @@ int journal_mark_freed(struct reiserfs_t
1082 if (atomic_read
1083 (&(cn->bh->b_count)) < 0) {
1084 reiserfs_warning(p_s_sb,
1085 - "journal-2138: cn->bh->b_count < 0");
1086 + "journal-2138",
1087 + "cn->bh->b_count < 0");
1088 }
1089 }
1090 if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */
1091 @@ -4134,8 +4145,9 @@ static int do_journal_end(struct reiserf
1092 clear_buffer_journaled(cn->bh);
1093 } else {
1094 /* JDirty cleared sometime during transaction. don't log this one */
1095 - reiserfs_warning(p_s_sb,
1096 - "journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!");
1097 + reiserfs_warning(p_s_sb, "journal-2048",
1098 + "BAD, buffer in journal hash, "
1099 + "but not JDirty!");
1100 brelse(cn->bh);
1101 }
1102 next = cn->next;
1103 --- a/fs/reiserfs/lbalance.c
1104 +++ b/fs/reiserfs/lbalance.c
1105 @@ -1288,12 +1288,16 @@ void leaf_paste_entries(struct buffer_in
1106 prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0;
1107
1108 if (prev && prev <= deh_location(&(deh[i])))
1109 - reiserfs_warning(NULL,
1110 - "vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)",
1111 + reiserfs_warning(NULL, "vs-10240",
1112 + "directory item (%h) "
1113 + "corrupted (prev %a, "
1114 + "cur(%d) %a)",
1115 ih, deh + i - 1, i, deh + i);
1116 if (next && next >= deh_location(&(deh[i])))
1117 - reiserfs_warning(NULL,
1118 - "vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)",
1119 + reiserfs_warning(NULL, "vs-10250",
1120 + "directory item (%h) "
1121 + "corrupted (cur(%d) %a, "
1122 + "next %a)",
1123 ih, i, deh + i, deh + i + 1);
1124 }
1125 }
1126 --- a/fs/reiserfs/namei.c
1127 +++ b/fs/reiserfs/namei.c
1128 @@ -120,8 +120,8 @@ int search_by_entry_key(struct super_blo
1129 switch (retval) {
1130 case ITEM_NOT_FOUND:
1131 if (!PATH_LAST_POSITION(path)) {
1132 - reiserfs_warning(sb,
1133 - "vs-7000: search_by_entry_key: search_by_key returned item position == 0");
1134 + reiserfs_warning(sb, "vs-7000", "search_by_key "
1135 + "returned item position == 0");
1136 pathrelse(path);
1137 return IO_ERROR;
1138 }
1139 @@ -135,8 +135,7 @@ int search_by_entry_key(struct super_blo
1140
1141 default:
1142 pathrelse(path);
1143 - reiserfs_warning(sb,
1144 - "vs-7002: search_by_entry_key: no path to here");
1145 + reiserfs_warning(sb, "vs-7002", "no path to here");
1146 return IO_ERROR;
1147 }
1148
1149 @@ -300,8 +299,7 @@ static int reiserfs_find_entry(struct in
1150 search_by_entry_key(dir->i_sb, &key_to_search,
1151 path_to_entry, de);
1152 if (retval == IO_ERROR) {
1153 - reiserfs_warning(dir->i_sb, "zam-7001: io error in %s",
1154 - __func__);
1155 + reiserfs_warning(dir->i_sb, "zam-7001", "io error");
1156 return IO_ERROR;
1157 }
1158
1159 @@ -493,10 +491,9 @@ static int reiserfs_add_entry(struct rei
1160 }
1161
1162 if (retval != NAME_FOUND) {
1163 - reiserfs_warning(dir->i_sb,
1164 - "zam-7002:%s: \"reiserfs_find_entry\" "
1165 - "has returned unexpected value (%d)",
1166 - __func__, retval);
1167 + reiserfs_warning(dir->i_sb, "zam-7002",
1168 + "reiserfs_find_entry() returned "
1169 + "unexpected value (%d)", retval);
1170 }
1171
1172 return -EEXIST;
1173 @@ -507,8 +504,9 @@ static int reiserfs_add_entry(struct rei
1174 MAX_GENERATION_NUMBER + 1);
1175 if (gen_number > MAX_GENERATION_NUMBER) {
1176 /* there is no free generation number */
1177 - reiserfs_warning(dir->i_sb,
1178 - "reiserfs_add_entry: Congratulations! we have got hash function screwed up");
1179 + reiserfs_warning(dir->i_sb, "reiserfs-7010",
1180 + "Congratulations! we have got hash function "
1181 + "screwed up");
1182 if (buffer != small_buf)
1183 kfree(buffer);
1184 pathrelse(&path);
1185 @@ -524,10 +522,9 @@ static int reiserfs_add_entry(struct rei
1186 if (gen_number != 0) { /* we need to re-search for the insertion point */
1187 if (search_by_entry_key(dir->i_sb, &entry_key, &path, &de) !=
1188 NAME_NOT_FOUND) {
1189 - reiserfs_warning(dir->i_sb,
1190 - "vs-7032: reiserfs_add_entry: "
1191 - "entry with this key (%K) already exists",
1192 - &entry_key);
1193 + reiserfs_warning(dir->i_sb, "vs-7032",
1194 + "entry with this key (%K) already "
1195 + "exists", &entry_key);
1196
1197 if (buffer != small_buf)
1198 kfree(buffer);
1199 @@ -906,8 +903,9 @@ static int reiserfs_rmdir(struct inode *
1200 goto end_rmdir;
1201
1202 if (inode->i_nlink != 2 && inode->i_nlink != 1)
1203 - reiserfs_warning(inode->i_sb, "%s: empty directory has nlink "
1204 - "!= 2 (%d)", __func__, inode->i_nlink);
1205 + reiserfs_warning(inode->i_sb, "reiserfs-7040",
1206 + "empty directory has nlink != 2 (%d)",
1207 + inode->i_nlink);
1208
1209 clear_nlink(inode);
1210 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
1211 @@ -983,10 +981,9 @@ static int reiserfs_unlink(struct inode
1212 }
1213
1214 if (!inode->i_nlink) {
1215 - reiserfs_warning(inode->i_sb, "%s: deleting nonexistent file "
1216 - "(%s:%lu), %d", __func__,
1217 - reiserfs_bdevname(inode->i_sb), inode->i_ino,
1218 - inode->i_nlink);
1219 + reiserfs_warning(inode->i_sb, "reiserfs-7042",
1220 + "deleting nonexistent file (%lu), %d",
1221 + inode->i_ino, inode->i_nlink);
1222 inode->i_nlink = 1;
1223 }
1224
1225 @@ -1500,8 +1497,8 @@ static int reiserfs_rename(struct inode
1226 if (reiserfs_cut_from_item
1227 (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL,
1228 0) < 0)
1229 - reiserfs_warning(old_dir->i_sb,
1230 - "vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?");
1231 + reiserfs_warning(old_dir->i_sb, "vs-7060",
1232 + "couldn't not cut old name. Fsck later?");
1233
1234 old_dir->i_size -= DEH_SIZE + old_de.de_entrylen;
1235
1236 --- a/fs/reiserfs/objectid.c
1237 +++ b/fs/reiserfs/objectid.c
1238 @@ -61,7 +61,7 @@ __u32 reiserfs_get_unused_objectid(struc
1239 /* comment needed -Hans */
1240 unused_objectid = le32_to_cpu(map[1]);
1241 if (unused_objectid == U32_MAX) {
1242 - reiserfs_warning(s, "%s: no more object ids", __func__);
1243 + reiserfs_warning(s, "reiserfs-15100", "no more object ids");
1244 reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s));
1245 return 0;
1246 }
1247 @@ -160,8 +160,7 @@ void reiserfs_release_objectid(struct re
1248 i += 2;
1249 }
1250
1251 - reiserfs_warning(s,
1252 - "vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)",
1253 + reiserfs_warning(s, "vs-15011", "tried to free free object id (%lu)",
1254 (long unsigned)objectid_to_release);
1255 }
1256
1257 --- a/fs/reiserfs/prints.c
1258 +++ b/fs/reiserfs/prints.c
1259 @@ -264,14 +264,17 @@ static void prepare_error_buf(const char
1260 va_end( args );\
1261 }
1262
1263 -void reiserfs_warning(struct super_block *sb, const char *fmt, ...)
1264 +void __reiserfs_warning(struct super_block *sb, const char *id,
1265 + const char *function, const char *fmt, ...)
1266 {
1267 do_reiserfs_warning(fmt);
1268 if (sb)
1269 - printk(KERN_WARNING "REISERFS warning (device %s): %s\n",
1270 - sb->s_id, error_buf);
1271 + printk(KERN_WARNING "REISERFS warning (device %s): %s%s%s: "
1272 + "%s\n", sb->s_id, id ? id : "", id ? " " : "",
1273 + function, error_buf);
1274 else
1275 - printk(KERN_WARNING "REISERFS warning: %s\n", error_buf);
1276 + printk(KERN_WARNING "REISERFS warning: %s%s%s: %s\n",
1277 + id ? id : "", id ? " " : "", function, error_buf);
1278 }
1279
1280 /* No newline.. reiserfs_info calls can be followed by printk's */
1281 --- a/fs/reiserfs/procfs.c
1282 +++ b/fs/reiserfs/procfs.c
1283 @@ -505,7 +505,7 @@ int reiserfs_proc_info_init(struct super
1284 add_file(sb, "journal", show_journal);
1285 return 0;
1286 }
1287 - reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s",
1288 + reiserfs_warning(sb, "cannot create /proc/%s/%s",
1289 proc_info_root_name, b);
1290 return 1;
1291 }
1292 @@ -561,8 +561,7 @@ int reiserfs_proc_info_global_init(void)
1293 if (proc_info_root) {
1294 proc_info_root->owner = THIS_MODULE;
1295 } else {
1296 - reiserfs_warning(NULL,
1297 - "reiserfs: cannot create /proc/%s",
1298 + reiserfs_warning(NULL, "cannot create /proc/%s",
1299 proc_info_root_name);
1300 return 1;
1301 }
1302 --- a/fs/reiserfs/stree.c
1303 +++ b/fs/reiserfs/stree.c
1304 @@ -444,23 +444,24 @@ static int is_leaf(char *buf, int blocks
1305
1306 blkh = (struct block_head *)buf;
1307 if (blkh_level(blkh) != DISK_LEAF_NODE_LEVEL) {
1308 - reiserfs_warning(NULL,
1309 - "is_leaf: this should be caught earlier");
1310 + reiserfs_warning(NULL, "reiserfs-5080",
1311 + "this should be caught earlier");
1312 return 0;
1313 }
1314
1315 nr = blkh_nr_item(blkh);
1316 if (nr < 1 || nr > ((blocksize - BLKH_SIZE) / (IH_SIZE + MIN_ITEM_LEN))) {
1317 /* item number is too big or too small */
1318 - reiserfs_warning(NULL, "is_leaf: nr_item seems wrong: %z", bh);
1319 + reiserfs_warning(NULL, "reiserfs-5081",
1320 + "nr_item seems wrong: %z", bh);
1321 return 0;
1322 }
1323 ih = (struct item_head *)(buf + BLKH_SIZE) + nr - 1;
1324 used_space = BLKH_SIZE + IH_SIZE * nr + (blocksize - ih_location(ih));
1325 if (used_space != blocksize - blkh_free_space(blkh)) {
1326 /* free space does not match to calculated amount of use space */
1327 - reiserfs_warning(NULL, "is_leaf: free space seems wrong: %z",
1328 - bh);
1329 + reiserfs_warning(NULL, "reiserfs-5082",
1330 + "free space seems wrong: %z", bh);
1331 return 0;
1332 }
1333 // FIXME: it is_leaf will hit performance too much - we may have
1334 @@ -471,29 +472,29 @@ static int is_leaf(char *buf, int blocks
1335 prev_location = blocksize;
1336 for (i = 0; i < nr; i++, ih++) {
1337 if (le_ih_k_type(ih) == TYPE_ANY) {
1338 - reiserfs_warning(NULL,
1339 - "is_leaf: wrong item type for item %h",
1340 + reiserfs_warning(NULL, "reiserfs-5083",
1341 + "wrong item type for item %h",
1342 ih);
1343 return 0;
1344 }
1345 if (ih_location(ih) >= blocksize
1346 || ih_location(ih) < IH_SIZE * nr) {
1347 - reiserfs_warning(NULL,
1348 - "is_leaf: item location seems wrong: %h",
1349 + reiserfs_warning(NULL, "reiserfs-5084",
1350 + "item location seems wrong: %h",
1351 ih);
1352 return 0;
1353 }
1354 if (ih_item_len(ih) < 1
1355 || ih_item_len(ih) > MAX_ITEM_LEN(blocksize)) {
1356 - reiserfs_warning(NULL,
1357 - "is_leaf: item length seems wrong: %h",
1358 + reiserfs_warning(NULL, "reiserfs-5085",
1359 + "item length seems wrong: %h",
1360 ih);
1361 return 0;
1362 }
1363 if (prev_location - ih_location(ih) != ih_item_len(ih)) {
1364 - reiserfs_warning(NULL,
1365 - "is_leaf: item location seems wrong (second one): %h",
1366 - ih);
1367 + reiserfs_warning(NULL, "reiserfs-5086",
1368 + "item location seems wrong "
1369 + "(second one): %h", ih);
1370 return 0;
1371 }
1372 prev_location = ih_location(ih);
1373 @@ -514,24 +515,23 @@ static int is_internal(char *buf, int bl
1374 nr = blkh_level(blkh);
1375 if (nr <= DISK_LEAF_NODE_LEVEL || nr > MAX_HEIGHT) {
1376 /* this level is not possible for internal nodes */
1377 - reiserfs_warning(NULL,
1378 - "is_internal: this should be caught earlier");
1379 + reiserfs_warning(NULL, "reiserfs-5087",
1380 + "this should be caught earlier");
1381 return 0;
1382 }
1383
1384 nr = blkh_nr_item(blkh);
1385 if (nr > (blocksize - BLKH_SIZE - DC_SIZE) / (KEY_SIZE + DC_SIZE)) {
1386 /* for internal which is not root we might check min number of keys */
1387 - reiserfs_warning(NULL,
1388 - "is_internal: number of key seems wrong: %z",
1389 - bh);
1390 + reiserfs_warning(NULL, "reiserfs-5088",
1391 + "number of key seems wrong: %z", bh);
1392 return 0;
1393 }
1394
1395 used_space = BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1);
1396 if (used_space != blocksize - blkh_free_space(blkh)) {
1397 - reiserfs_warning(NULL,
1398 - "is_internal: free space seems wrong: %z", bh);
1399 + reiserfs_warning(NULL, "reiserfs-5089",
1400 + "free space seems wrong: %z", bh);
1401 return 0;
1402 }
1403 // one may imagine much more checks
1404 @@ -543,8 +543,8 @@ static int is_internal(char *buf, int bl
1405 static int is_tree_node(struct buffer_head *bh, int level)
1406 {
1407 if (B_LEVEL(bh) != level) {
1408 - reiserfs_warning(NULL,
1409 - "is_tree_node: node level %d does not match to the expected one %d",
1410 + reiserfs_warning(NULL, "reiserfs-5090", "node level %d does "
1411 + "not match to the expected one %d",
1412 B_LEVEL(bh), level);
1413 return 0;
1414 }
1415 @@ -645,9 +645,9 @@ int search_by_key(struct super_block *p_
1416
1417 #ifdef CONFIG_REISERFS_CHECK
1418 if (!(++n_repeat_counter % 50000))
1419 - reiserfs_warning(p_s_sb, "PAP-5100: search_by_key: %s:"
1420 - "there were %d iterations of while loop "
1421 - "looking for key %K",
1422 + reiserfs_warning(p_s_sb, "PAP-5100",
1423 + "%s: there were %d iterations of "
1424 + "while loop looking for key %K",
1425 current->comm, n_repeat_counter,
1426 p_s_key);
1427 #endif
1428 @@ -721,9 +721,9 @@ int search_by_key(struct super_block *p_
1429 // make sure, that the node contents look like a node of
1430 // certain level
1431 if (!is_tree_node(p_s_bh, expected_level)) {
1432 - reiserfs_warning(p_s_sb, "vs-5150: search_by_key: "
1433 - "invalid format found in block %ld. Fsck?",
1434 - p_s_bh->b_blocknr);
1435 + reiserfs_warning(p_s_sb, "vs-5150",
1436 + "invalid format found in block %ld. "
1437 + "Fsck?", p_s_bh->b_blocknr);
1438 pathrelse(p_s_search_path);
1439 return IO_ERROR;
1440 }
1441 @@ -1227,8 +1227,7 @@ int reiserfs_delete_item(struct reiserfs
1442 if (n_ret_value == IO_ERROR)
1443 break;
1444 if (n_ret_value == FILE_NOT_FOUND) {
1445 - reiserfs_warning(p_s_sb,
1446 - "vs-5340: reiserfs_delete_item: "
1447 + reiserfs_warning(p_s_sb, "vs-5340",
1448 "no items of the file %K found",
1449 p_s_item_key);
1450 break;
1451 @@ -1338,10 +1337,9 @@ void reiserfs_delete_solid_item(struct r
1452 while (1) {
1453 retval = search_item(th->t_super, &cpu_key, &path);
1454 if (retval == IO_ERROR) {
1455 - reiserfs_warning(th->t_super,
1456 - "vs-5350: reiserfs_delete_solid_item: "
1457 - "i/o failure occurred trying to delete %K",
1458 - &cpu_key);
1459 + reiserfs_warning(th->t_super, "vs-5350",
1460 + "i/o failure occurred trying "
1461 + "to delete %K", &cpu_key);
1462 break;
1463 }
1464 if (retval != ITEM_FOUND) {
1465 @@ -1355,9 +1353,8 @@ void reiserfs_delete_solid_item(struct r
1466 GET_GENERATION_NUMBER(le_key_k_offset
1467 (le_key_version(key),
1468 key)) == 1))
1469 - reiserfs_warning(th->t_super,
1470 - "vs-5355: reiserfs_delete_solid_item: %k not found",
1471 - key);
1472 + reiserfs_warning(th->t_super, "vs-5355",
1473 + "%k not found", key);
1474 break;
1475 }
1476 if (!tb_init) {
1477 @@ -1389,8 +1386,7 @@ void reiserfs_delete_solid_item(struct r
1478 break;
1479 }
1480 // IO_ERROR, NO_DISK_SPACE, etc
1481 - reiserfs_warning(th->t_super,
1482 - "vs-5360: reiserfs_delete_solid_item: "
1483 + reiserfs_warning(th->t_super, "vs-5360",
1484 "could not delete %K due to fix_nodes failure",
1485 &cpu_key);
1486 unfix_nodes(&tb);
1487 @@ -1533,8 +1529,9 @@ static void indirect_to_direct_roll_back
1488 set_cpu_key_k_offset(&tail_key,
1489 cpu_key_k_offset(&tail_key) - removed);
1490 }
1491 - reiserfs_warning(inode->i_sb,
1492 - "indirect_to_direct_roll_back: indirect_to_direct conversion has been rolled back due to lack of disk space");
1493 + reiserfs_warning(inode->i_sb, "reiserfs-5091", "indirect_to_direct "
1494 + "conversion has been rolled back due to "
1495 + "lack of disk space");
1496 //mark_file_without_tail (inode);
1497 mark_inode_dirty(inode);
1498 }
1499 @@ -1639,8 +1636,7 @@ int reiserfs_cut_from_item(struct reiser
1500 if (n_ret_value == POSITION_FOUND)
1501 continue;
1502
1503 - reiserfs_warning(p_s_sb,
1504 - "PAP-5610: reiserfs_cut_from_item: item %K not found",
1505 + reiserfs_warning(p_s_sb, "PAP-5610", "item %K not found",
1506 p_s_item_key);
1507 unfix_nodes(&s_cut_balance);
1508 return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT;
1509 @@ -1654,7 +1650,8 @@ int reiserfs_cut_from_item(struct reiser
1510 indirect_to_direct_roll_back(th, p_s_inode, p_s_path);
1511 }
1512 if (n_ret_value == NO_DISK_SPACE)
1513 - reiserfs_warning(p_s_sb, "NO_DISK_SPACE");
1514 + reiserfs_warning(p_s_sb, "reiserfs-5092",
1515 + "NO_DISK_SPACE");
1516 unfix_nodes(&s_cut_balance);
1517 return -EIO;
1518 }
1519 @@ -1743,8 +1740,7 @@ static void truncate_directory(struct re
1520 {
1521 BUG_ON(!th->t_trans_id);
1522 if (inode->i_nlink)
1523 - reiserfs_warning(inode->i_sb,
1524 - "vs-5655: truncate_directory: link count != 0");
1525 + reiserfs_warning(inode->i_sb, "vs-5655", "link count != 0");
1526
1527 set_le_key_k_offset(KEY_FORMAT_3_5, INODE_PKEY(inode), DOT_OFFSET);
1528 set_le_key_k_type(KEY_FORMAT_3_5, INODE_PKEY(inode), TYPE_DIRENTRY);
1529 @@ -1797,16 +1793,14 @@ int reiserfs_do_truncate(struct reiserfs
1530 search_for_position_by_key(p_s_inode->i_sb, &s_item_key,
1531 &s_search_path);
1532 if (retval == IO_ERROR) {
1533 - reiserfs_warning(p_s_inode->i_sb,
1534 - "vs-5657: reiserfs_do_truncate: "
1535 + reiserfs_warning(p_s_inode->i_sb, "vs-5657",
1536 "i/o failure occurred trying to truncate %K",
1537 &s_item_key);
1538 err = -EIO;
1539 goto out;
1540 }
1541 if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) {
1542 - reiserfs_warning(p_s_inode->i_sb,
1543 - "PAP-5660: reiserfs_do_truncate: "
1544 + reiserfs_warning(p_s_inode->i_sb, "PAP-5660",
1545 "wrong result %d of search for %K", retval,
1546 &s_item_key);
1547
1548 @@ -1850,8 +1844,8 @@ int reiserfs_do_truncate(struct reiserfs
1549 reiserfs_cut_from_item(th, &s_search_path, &s_item_key,
1550 p_s_inode, page, n_new_file_size);
1551 if (n_deleted < 0) {
1552 - reiserfs_warning(p_s_inode->i_sb,
1553 - "vs-5665: reiserfs_do_truncate: reiserfs_cut_from_item failed");
1554 + reiserfs_warning(p_s_inode->i_sb, "vs-5665",
1555 + "reiserfs_cut_from_item failed");
1556 reiserfs_check_path(&s_search_path);
1557 return 0;
1558 }
1559 @@ -2000,8 +1994,8 @@ int reiserfs_paste_into_item(struct reis
1560 goto error_out;
1561 }
1562 if (retval == POSITION_FOUND) {
1563 - reiserfs_warning(inode->i_sb,
1564 - "PAP-5710: reiserfs_paste_into_item: entry or pasted byte (%K) exists",
1565 + reiserfs_warning(inode->i_sb, "PAP-5710",
1566 + "entry or pasted byte (%K) exists",
1567 p_s_key);
1568 retval = -EEXIST;
1569 goto error_out;
1570 @@ -2087,8 +2081,7 @@ int reiserfs_insert_item(struct reiserfs
1571 goto error_out;
1572 }
1573 if (retval == ITEM_FOUND) {
1574 - reiserfs_warning(th->t_super,
1575 - "PAP-5760: reiserfs_insert_item: "
1576 + reiserfs_warning(th->t_super, "PAP-5760",
1577 "key %K already exists in the tree",
1578 key);
1579 retval = -EEXIST;
1580 --- a/fs/reiserfs/super.c
1581 +++ b/fs/reiserfs/super.c
1582 @@ -181,9 +181,9 @@ static int finish_unfinished(struct supe
1583 if (REISERFS_SB(s)->s_qf_names[i]) {
1584 int ret = reiserfs_quota_on_mount(s, i);
1585 if (ret < 0)
1586 - reiserfs_warning(s,
1587 - "reiserfs: cannot turn on journaled quota: error %d",
1588 - ret);
1589 + reiserfs_warning(s, "reiserfs-2500",
1590 + "cannot turn on journaled "
1591 + "quota: error %d", ret);
1592 }
1593 }
1594 #endif
1595 @@ -193,8 +193,8 @@ static int finish_unfinished(struct supe
1596 while (!retval) {
1597 retval = search_item(s, &max_cpu_key, &path);
1598 if (retval != ITEM_NOT_FOUND) {
1599 - reiserfs_warning(s,
1600 - "vs-2140: finish_unfinished: search_by_key returned %d",
1601 + reiserfs_warning(s, "vs-2140",
1602 + "search_by_key returned %d",
1603 retval);
1604 break;
1605 }
1606 @@ -202,8 +202,8 @@ static int finish_unfinished(struct supe
1607 bh = get_last_bh(&path);
1608 item_pos = get_item_pos(&path);
1609 if (item_pos != B_NR_ITEMS(bh)) {
1610 - reiserfs_warning(s,
1611 - "vs-2060: finish_unfinished: wrong position found");
1612 + reiserfs_warning(s, "vs-2060",
1613 + "wrong position found");
1614 break;
1615 }
1616 item_pos--;
1617 @@ -233,8 +233,7 @@ static int finish_unfinished(struct supe
1618 if (!inode) {
1619 /* the unlink almost completed, it just did not manage to remove
1620 "save" link and release objectid */
1621 - reiserfs_warning(s,
1622 - "vs-2180: finish_unfinished: iget failed for %K",
1623 + reiserfs_warning(s, "vs-2180", "iget failed for %K",
1624 &obj_key);
1625 retval = remove_save_link_only(s, &save_link_key, 1);
1626 continue;
1627 @@ -242,8 +241,8 @@ static int finish_unfinished(struct supe
1628
1629 if (!truncate && inode->i_nlink) {
1630 /* file is not unlinked */
1631 - reiserfs_warning(s,
1632 - "vs-2185: finish_unfinished: file %K is not unlinked",
1633 + reiserfs_warning(s, "vs-2185",
1634 + "file %K is not unlinked",
1635 &obj_key);
1636 retval = remove_save_link_only(s, &save_link_key, 0);
1637 continue;
1638 @@ -255,8 +254,9 @@ static int finish_unfinished(struct supe
1639 The only imaginable way is to execute unfinished truncate request
1640 then boot into old kernel, remove the file and create dir with
1641 the same key. */
1642 - reiserfs_warning(s,
1643 - "green-2101: impossible truncate on a directory %k. Please report",
1644 + reiserfs_warning(s, "green-2101",
1645 + "impossible truncate on a "
1646 + "directory %k. Please report",
1647 INODE_PKEY(inode));
1648 retval = remove_save_link_only(s, &save_link_key, 0);
1649 truncate = 0;
1650 @@ -286,9 +286,10 @@ static int finish_unfinished(struct supe
1651 /* removal gets completed in iput */
1652 retval = 0;
1653 } else {
1654 - reiserfs_warning(s, "Dead loop in "
1655 - "finish_unfinished detected, "
1656 - "just remove save link\n");
1657 + reiserfs_warning(s, "super-2189", "Dead loop "
1658 + "in finish_unfinished "
1659 + "detected, just remove "
1660 + "save link\n");
1661 retval = remove_save_link_only(s,
1662 &save_link_key, 0);
1663 }
1664 @@ -358,8 +359,9 @@ void add_save_link(struct reiserfs_trans
1665 } else {
1666 /* truncate */
1667 if (S_ISDIR(inode->i_mode))
1668 - reiserfs_warning(inode->i_sb,
1669 - "green-2102: Adding a truncate savelink for a directory %k! Please report",
1670 + reiserfs_warning(inode->i_sb, "green-2102",
1671 + "Adding a truncate savelink for "
1672 + "a directory %k! Please report",
1673 INODE_PKEY(inode));
1674 set_cpu_key_k_offset(&key, 1);
1675 set_cpu_key_k_type(&key, TYPE_INDIRECT);
1676 @@ -374,7 +376,7 @@ void add_save_link(struct reiserfs_trans
1677 retval = search_item(inode->i_sb, &key, &path);
1678 if (retval != ITEM_NOT_FOUND) {
1679 if (retval != -ENOSPC)
1680 - reiserfs_warning(inode->i_sb, "vs-2100: add_save_link:"
1681 + reiserfs_warning(inode->i_sb, "vs-2100",
1682 "search_by_key (%K) returned %d", &key,
1683 retval);
1684 pathrelse(&path);
1685 @@ -389,9 +391,8 @@ void add_save_link(struct reiserfs_trans
1686 reiserfs_insert_item(th, &path, &key, &ih, NULL, (char *)&link);
1687 if (retval) {
1688 if (retval != -ENOSPC)
1689 - reiserfs_warning(inode->i_sb,
1690 - "vs-2120: add_save_link: insert_item returned %d",
1691 - retval);
1692 + reiserfs_warning(inode->i_sb, "vs-2120",
1693 + "insert_item returned %d", retval);
1694 } else {
1695 if (truncate)
1696 REISERFS_I(inode)->i_flags |=
1697 @@ -490,8 +491,7 @@ static void reiserfs_put_super(struct su
1698 print_statistics(s);
1699
1700 if (REISERFS_SB(s)->reserved_blocks != 0) {
1701 - reiserfs_warning(s,
1702 - "green-2005: reiserfs_put_super: reserved blocks left %d",
1703 + reiserfs_warning(s, "green-2005", "reserved blocks left %d",
1704 REISERFS_SB(s)->reserved_blocks);
1705 }
1706
1707 @@ -557,8 +557,8 @@ static void reiserfs_dirty_inode(struct
1708
1709 int err = 0;
1710 if (inode->i_sb->s_flags & MS_RDONLY) {
1711 - reiserfs_warning(inode->i_sb,
1712 - "clm-6006: writing inode %lu on readonly FS",
1713 + reiserfs_warning(inode->i_sb, "clm-6006",
1714 + "writing inode %lu on readonly FS",
1715 inode->i_ino);
1716 return;
1717 }
1718 @@ -790,13 +790,15 @@ static int reiserfs_getopt(struct super_
1719 if (bit_flags) {
1720 if (opt->clrmask ==
1721 (1 << REISERFS_UNSUPPORTED_OPT))
1722 - reiserfs_warning(s, "%s not supported.",
1723 + reiserfs_warning(s, "super-6500",
1724 + "%s not supported.\n",
1725 p);
1726 else
1727 *bit_flags &= ~opt->clrmask;
1728 if (opt->setmask ==
1729 (1 << REISERFS_UNSUPPORTED_OPT))
1730 - reiserfs_warning(s, "%s not supported.",
1731 + reiserfs_warning(s, "super-6501",
1732 + "%s not supported.\n",
1733 p);
1734 else
1735 *bit_flags |= opt->setmask;
1736 @@ -805,7 +807,8 @@ static int reiserfs_getopt(struct super_
1737 }
1738 }
1739 if (!opt->option_name) {
1740 - reiserfs_warning(s, "unknown mount option \"%s\"", p);
1741 + reiserfs_warning(s, "super-6502",
1742 + "unknown mount option \"%s\"", p);
1743 return -1;
1744 }
1745
1746 @@ -813,8 +816,9 @@ static int reiserfs_getopt(struct super_
1747 switch (*p) {
1748 case '=':
1749 if (!opt->arg_required) {
1750 - reiserfs_warning(s,
1751 - "the option \"%s\" does not require an argument",
1752 + reiserfs_warning(s, "super-6503",
1753 + "the option \"%s\" does not "
1754 + "require an argument\n",
1755 opt->option_name);
1756 return -1;
1757 }
1758 @@ -822,14 +826,15 @@ static int reiserfs_getopt(struct super_
1759
1760 case 0:
1761 if (opt->arg_required) {
1762 - reiserfs_warning(s,
1763 - "the option \"%s\" requires an argument",
1764 - opt->option_name);
1765 + reiserfs_warning(s, "super-6504",
1766 + "the option \"%s\" requires an "
1767 + "argument\n", opt->option_name);
1768 return -1;
1769 }
1770 break;
1771 default:
1772 - reiserfs_warning(s, "head of option \"%s\" is only correct",
1773 + reiserfs_warning(s, "super-6505",
1774 + "head of option \"%s\" is only correct\n",
1775 opt->option_name);
1776 return -1;
1777 }
1778 @@ -841,7 +846,8 @@ static int reiserfs_getopt(struct super_
1779 && !(opt->arg_required & (1 << REISERFS_OPT_ALLOWEMPTY))
1780 && !strlen(p)) {
1781 /* this catches "option=," if not allowed */
1782 - reiserfs_warning(s, "empty argument for \"%s\"",
1783 + reiserfs_warning(s, "super-6506",
1784 + "empty argument for \"%s\"\n",
1785 opt->option_name);
1786 return -1;
1787 }
1788 @@ -863,7 +869,8 @@ static int reiserfs_getopt(struct super_
1789 }
1790 }
1791
1792 - reiserfs_warning(s, "bad value \"%s\" for option \"%s\"", p,
1793 + reiserfs_warning(s, "super-6506",
1794 + "bad value \"%s\" for option \"%s\"\n", p,
1795 opt->option_name);
1796 return -1;
1797 }
1798 @@ -953,9 +960,9 @@ static int reiserfs_parse_options(struct
1799 *blocks = simple_strtoul(arg, &p, 0);
1800 if (*p != '\0') {
1801 /* NNN does not look like a number */
1802 - reiserfs_warning(s,
1803 - "reiserfs_parse_options: bad value %s",
1804 - arg);
1805 + reiserfs_warning(s, "super-6507",
1806 + "bad value %s for "
1807 + "-oresize\n", arg);
1808 return 0;
1809 }
1810 }
1811 @@ -966,8 +973,8 @@ static int reiserfs_parse_options(struct
1812 unsigned long val = simple_strtoul(arg, &p, 0);
1813 /* commit=NNN (time in seconds) */
1814 if (*p != '\0' || val >= (unsigned int)-1) {
1815 - reiserfs_warning(s,
1816 - "reiserfs_parse_options: bad value %s",
1817 + reiserfs_warning(s, "super-6508",
1818 + "bad value %s for -ocommit\n",
1819 arg);
1820 return 0;
1821 }
1822 @@ -975,16 +982,18 @@ static int reiserfs_parse_options(struct
1823 }
1824
1825 if (c == 'w') {
1826 - reiserfs_warning(s, "reiserfs: nolargeio option is no longer supported");
1827 + reiserfs_warning(s, "super-6509", "nolargeio option "
1828 + "is no longer supported");
1829 return 0;
1830 }
1831
1832 if (c == 'j') {
1833 if (arg && *arg && jdev_name) {
1834 if (*jdev_name) { //Hm, already assigned?
1835 - reiserfs_warning(s,
1836 - "reiserfs_parse_options: journal device was already specified to be %s",
1837 - *jdev_name);
1838 + reiserfs_warning(s, "super-6510",
1839 + "journal device was "
1840 + "already specified to "
1841 + "be %s", *jdev_name);
1842 return 0;
1843 }
1844 *jdev_name = arg;
1845 @@ -997,29 +1006,35 @@ static int reiserfs_parse_options(struct
1846 if ((sb_any_quota_enabled(s) ||
1847 sb_any_quota_suspended(s)) &&
1848 (!*arg != !REISERFS_SB(s)->s_qf_names[qtype])) {
1849 - reiserfs_warning(s,
1850 - "reiserfs_parse_options: cannot change journaled quota options when quota turned on.");
1851 + reiserfs_warning(s, "super-6511",
1852 + "cannot change journaled "
1853 + "quota options when quota "
1854 + "turned on.");
1855 return 0;
1856 }
1857 if (*arg) { /* Some filename specified? */
1858 if (REISERFS_SB(s)->s_qf_names[qtype]
1859 && strcmp(REISERFS_SB(s)->s_qf_names[qtype],
1860 arg)) {
1861 - reiserfs_warning(s,
1862 - "reiserfs_parse_options: %s quota file already specified.",
1863 + reiserfs_warning(s, "super-6512",
1864 + "%s quota file "
1865 + "already specified.",
1866 QTYPE2NAME(qtype));
1867 return 0;
1868 }
1869 if (strchr(arg, '/')) {
1870 - reiserfs_warning(s,
1871 - "reiserfs_parse_options: quotafile must be on filesystem root.");
1872 + reiserfs_warning(s, "super-6513",
1873 + "quotafile must be "
1874 + "on filesystem root.");
1875 return 0;
1876 }
1877 qf_names[qtype] =
1878 kmalloc(strlen(arg) + 1, GFP_KERNEL);
1879 if (!qf_names[qtype]) {
1880 - reiserfs_warning(s,
1881 - "reiserfs_parse_options: not enough memory for storing quotafile name.");
1882 + reiserfs_warning(s, "reiserfs-2502",
1883 + "not enough memory "
1884 + "for storing "
1885 + "quotafile name.");
1886 return 0;
1887 }
1888 strcpy(qf_names[qtype], arg);
1889 @@ -1037,22 +1052,25 @@ static int reiserfs_parse_options(struct
1890 else if (!strcmp(arg, "vfsv0"))
1891 *qfmt = QFMT_VFS_V0;
1892 else {
1893 - reiserfs_warning(s,
1894 - "reiserfs_parse_options: unknown quota format specified.");
1895 + reiserfs_warning(s, "super-6514",
1896 + "unknown quota format "
1897 + "specified.");
1898 return 0;
1899 }
1900 if ((sb_any_quota_enabled(s) ||
1901 sb_any_quota_suspended(s)) &&
1902 *qfmt != REISERFS_SB(s)->s_jquota_fmt) {
1903 - reiserfs_warning(s,
1904 - "reiserfs_parse_options: cannot change journaled quota options when quota turned on.");
1905 + reiserfs_warning(s, "super-6515",
1906 + "cannot change journaled "
1907 + "quota options when quota "
1908 + "turned on.");
1909 return 0;
1910 }
1911 }
1912 #else
1913 if (c == 'u' || c == 'g' || c == 'f') {
1914 - reiserfs_warning(s,
1915 - "reiserfs_parse_options: journaled quota options not supported.");
1916 + reiserfs_warning(s, "reiserfs-2503", "journaled "
1917 + "quota options not supported.");
1918 return 0;
1919 }
1920 #endif
1921 @@ -1061,15 +1079,15 @@ static int reiserfs_parse_options(struct
1922 #ifdef CONFIG_QUOTA
1923 if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt
1924 && (qf_names[USRQUOTA] || qf_names[GRPQUOTA])) {
1925 - reiserfs_warning(s,
1926 - "reiserfs_parse_options: journaled quota format not specified.");
1927 + reiserfs_warning(s, "super-6515",
1928 + "journaled quota format not specified.");
1929 return 0;
1930 }
1931 /* This checking is not precise wrt the quota type but for our purposes it is sufficient */
1932 if (!(*mount_options & (1 << REISERFS_QUOTA))
1933 && sb_any_quota_enabled(s)) {
1934 - reiserfs_warning(s,
1935 - "reiserfs_parse_options: quota options must be present when quota is turned on.");
1936 + reiserfs_warning(s, "super-6516", "quota options must "
1937 + "be present when quota is turned on.");
1938 return 0;
1939 }
1940 #endif
1941 @@ -1129,14 +1147,15 @@ static void handle_attrs(struct super_bl
1942
1943 if (reiserfs_attrs(s)) {
1944 if (old_format_only(s)) {
1945 - reiserfs_warning(s,
1946 - "reiserfs: cannot support attributes on 3.5.x disk format");
1947 + reiserfs_warning(s, "super-6517", "cannot support "
1948 + "attributes on 3.5.x disk format");
1949 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
1950 return;
1951 }
1952 if (!(le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared)) {
1953 - reiserfs_warning(s,
1954 - "reiserfs: cannot support attributes until flag is set in super-block");
1955 + reiserfs_warning(s, "super-6518", "cannot support "
1956 + "attributes until flag is set in "
1957 + "super-block");
1958 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
1959 }
1960 }
1961 @@ -1314,7 +1333,7 @@ static int read_super_block(struct super
1962
1963 bh = sb_bread(s, offset / s->s_blocksize);
1964 if (!bh) {
1965 - reiserfs_warning(s, "sh-2006: read_super_block: "
1966 + reiserfs_warning(s, "sh-2006",
1967 "bread failed (dev %s, block %lu, size %lu)",
1968 reiserfs_bdevname(s), offset / s->s_blocksize,
1969 s->s_blocksize);
1970 @@ -1335,8 +1354,8 @@ static int read_super_block(struct super
1971
1972 bh = sb_bread(s, offset / s->s_blocksize);
1973 if (!bh) {
1974 - reiserfs_warning(s, "sh-2007: read_super_block: "
1975 - "bread failed (dev %s, block %lu, size %lu)\n",
1976 + reiserfs_warning(s, "sh-2007",
1977 + "bread failed (dev %s, block %lu, size %lu)",
1978 reiserfs_bdevname(s), offset / s->s_blocksize,
1979 s->s_blocksize);
1980 return 1;
1981 @@ -1344,8 +1363,8 @@ static int read_super_block(struct super
1982
1983 rs = (struct reiserfs_super_block *)bh->b_data;
1984 if (sb_blocksize(rs) != s->s_blocksize) {
1985 - reiserfs_warning(s, "sh-2011: read_super_block: "
1986 - "can't find a reiserfs filesystem on (dev %s, block %Lu, size %lu)\n",
1987 + reiserfs_warning(s, "sh-2011", "can't find a reiserfs "
1988 + "filesystem on (dev %s, block %Lu, size %lu)",
1989 reiserfs_bdevname(s),
1990 (unsigned long long)bh->b_blocknr,
1991 s->s_blocksize);
1992 @@ -1355,9 +1374,10 @@ static int read_super_block(struct super
1993
1994 if (rs->s_v1.s_root_block == cpu_to_le32(-1)) {
1995 brelse(bh);
1996 - reiserfs_warning(s,
1997 - "Unfinished reiserfsck --rebuild-tree run detected. Please run\n"
1998 - "reiserfsck --rebuild-tree and wait for a completion. If that fails\n"
1999 + reiserfs_warning(s, "super-6519", "Unfinished reiserfsck "
2000 + "--rebuild-tree run detected. Please run\n"
2001 + "reiserfsck --rebuild-tree and wait for a "
2002 + "completion. If that fails\n"
2003 "get newer reiserfsprogs package");
2004 return 1;
2005 }
2006 @@ -1375,10 +1395,9 @@ static int read_super_block(struct super
2007 reiserfs_info(s, "found reiserfs format \"3.5\""
2008 " with non-standard journal\n");
2009 else {
2010 - reiserfs_warning(s,
2011 - "sh-2012: read_super_block: found unknown "
2012 - "format \"%u\" of reiserfs with non-standard magic",
2013 - sb_version(rs));
2014 + reiserfs_warning(s, "sh-2012", "found unknown "
2015 + "format \"%u\" of reiserfs with "
2016 + "non-standard magic", sb_version(rs));
2017 return 1;
2018 }
2019 } else
2020 @@ -1408,8 +1427,7 @@ static int reread_meta_blocks(struct sup
2021 ll_rw_block(READ, 1, &(SB_BUFFER_WITH_SB(s)));
2022 wait_on_buffer(SB_BUFFER_WITH_SB(s));
2023 if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) {
2024 - reiserfs_warning(s,
2025 - "reread_meta_blocks, error reading the super");
2026 + reiserfs_warning(s, "reiserfs-2504", "error reading the super");
2027 return 1;
2028 }
2029
2030 @@ -1473,10 +1491,10 @@ static __u32 find_hash_out(struct super_
2031 && (yurahash ==
2032 GET_HASH_VALUE(deh_offset
2033 (&(de.de_deh[de.de_entry_num])))))) {
2034 - reiserfs_warning(s,
2035 - "Unable to automatically detect hash function. "
2036 - "Please mount with -o hash={tea,rupasov,r5}",
2037 - reiserfs_bdevname(s));
2038 + reiserfs_warning(s, "reiserfs-2506", "Unable to "
2039 + "automatically detect hash function. "
2040 + "Please mount with -o "
2041 + "hash={tea,rupasov,r5}");
2042 hash = UNSET_HASH;
2043 break;
2044 }
2045 @@ -1490,7 +1508,8 @@ static __u32 find_hash_out(struct super_
2046 (deh_offset(&(de.de_deh[de.de_entry_num]))) == r5hash)
2047 hash = R5_HASH;
2048 else {
2049 - reiserfs_warning(s, "Unrecognised hash function");
2050 + reiserfs_warning(s, "reiserfs-2506",
2051 + "Unrecognised hash function");
2052 hash = UNSET_HASH;
2053 }
2054 } while (0);
2055 @@ -1518,17 +1537,20 @@ static int what_hash(struct super_block
2056 ** mount options
2057 */
2058 if (reiserfs_rupasov_hash(s) && code != YURA_HASH) {
2059 - reiserfs_warning(s, "Error, %s hash detected, "
2060 + reiserfs_warning(s, "reiserfs-2507",
2061 + "Error, %s hash detected, "
2062 "unable to force rupasov hash",
2063 reiserfs_hashname(code));
2064 code = UNSET_HASH;
2065 } else if (reiserfs_tea_hash(s) && code != TEA_HASH) {
2066 - reiserfs_warning(s, "Error, %s hash detected, "
2067 + reiserfs_warning(s, "reiserfs-2508",
2068 + "Error, %s hash detected, "
2069 "unable to force tea hash",
2070 reiserfs_hashname(code));
2071 code = UNSET_HASH;
2072 } else if (reiserfs_r5_hash(s) && code != R5_HASH) {
2073 - reiserfs_warning(s, "Error, %s hash detected, "
2074 + reiserfs_warning(s, "reiserfs-2509",
2075 + "Error, %s hash detected, "
2076 "unable to force r5 hash",
2077 reiserfs_hashname(code));
2078 code = UNSET_HASH;
2079 @@ -1587,9 +1609,9 @@ static int function2code(hashf_t func)
2080 return 0;
2081 }
2082
2083 -#define SWARN(silent, s, ...) \
2084 +#define SWARN(silent, s, id, ...) \
2085 if (!(silent)) \
2086 - reiserfs_warning (s, __VA_ARGS__)
2087 + reiserfs_warning(s, id, __VA_ARGS__)
2088
2089 static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
2090 {
2091 @@ -1641,8 +1663,7 @@ static int reiserfs_fill_super(struct su
2092 #endif
2093
2094 if (blocks) {
2095 - SWARN(silent, s, "jmacd-7: reiserfs_fill_super: resize option "
2096 - "for remount only");
2097 + SWARN(silent, s, "jmacd-7", "resize option for remount only");
2098 goto error;
2099 }
2100
2101 @@ -1651,8 +1672,7 @@ static int reiserfs_fill_super(struct su
2102 old_format = 1;
2103 /* try new format (64-th 1k block), which can contain reiserfs super block */
2104 else if (read_super_block(s, REISERFS_DISK_OFFSET_IN_BYTES)) {
2105 - SWARN(silent, s,
2106 - "sh-2021: reiserfs_fill_super: can not find reiserfs on %s",
2107 + SWARN(silent, s, "sh-2021", "can not find reiserfs on %s",
2108 reiserfs_bdevname(s));
2109 goto error;
2110 }
2111 @@ -1664,13 +1684,12 @@ static int reiserfs_fill_super(struct su
2112 if (s->s_bdev && s->s_bdev->bd_inode
2113 && i_size_read(s->s_bdev->bd_inode) <
2114 sb_block_count(rs) * sb_blocksize(rs)) {
2115 - SWARN(silent, s,
2116 - "Filesystem on %s cannot be mounted because it is bigger than the device",
2117 - reiserfs_bdevname(s));
2118 - SWARN(silent, s,
2119 - "You may need to run fsck or increase size of your LVM partition");
2120 - SWARN(silent, s,
2121 - "Or may be you forgot to reboot after fdisk when it told you to");
2122 + SWARN(silent, s, "", "Filesystem cannot be "
2123 + "mounted because it is bigger than the device");
2124 + SWARN(silent, s, "", "You may need to run fsck "
2125 + "or increase size of your LVM partition");
2126 + SWARN(silent, s, "", "Or may be you forgot to "
2127 + "reboot after fdisk when it told you to");
2128 goto error;
2129 }
2130
2131 @@ -1678,14 +1697,13 @@ static int reiserfs_fill_super(struct su
2132 sbi->s_mount_state = REISERFS_VALID_FS;
2133
2134 if ((errval = reiserfs_init_bitmap_cache(s))) {
2135 - SWARN(silent, s,
2136 - "jmacd-8: reiserfs_fill_super: unable to read bitmap");
2137 + SWARN(silent, s, "jmacd-8", "unable to read bitmap");
2138 goto error;
2139 }
2140 errval = -EINVAL;
2141 #ifdef CONFIG_REISERFS_CHECK
2142 - SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON");
2143 - SWARN(silent, s, "- it is slow mode for debugging.");
2144 + SWARN(silent, s, "", "CONFIG_REISERFS_CHECK is set ON");
2145 + SWARN(silent, s, "", "- it is slow mode for debugging.");
2146 #endif
2147
2148 /* make data=ordered the default */
2149 @@ -1706,8 +1724,8 @@ static int reiserfs_fill_super(struct su
2150 }
2151 // set_device_ro(s->s_dev, 1) ;
2152 if (journal_init(s, jdev_name, old_format, commit_max_age)) {
2153 - SWARN(silent, s,
2154 - "sh-2022: reiserfs_fill_super: unable to initialize journal space");
2155 + SWARN(silent, s, "sh-2022",
2156 + "unable to initialize journal space");
2157 goto error;
2158 } else {
2159 jinit_done = 1; /* once this is set, journal_release must be called
2160 @@ -1715,8 +1733,8 @@ static int reiserfs_fill_super(struct su
2161 */
2162 }
2163 if (reread_meta_blocks(s)) {
2164 - SWARN(silent, s,
2165 - "jmacd-9: reiserfs_fill_super: unable to reread meta blocks after journal init");
2166 + SWARN(silent, s, "jmacd-9",
2167 + "unable to reread meta blocks after journal init");
2168 goto error;
2169 }
2170
2171 @@ -1724,8 +1742,8 @@ static int reiserfs_fill_super(struct su
2172 goto error;
2173
2174 if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) {
2175 - SWARN(silent, s,
2176 - "clm-7000: Detected readonly device, marking FS readonly");
2177 + SWARN(silent, s, "clm-7000",
2178 + "Detected readonly device, marking FS readonly");
2179 s->s_flags |= MS_RDONLY;
2180 }
2181 args.objectid = REISERFS_ROOT_OBJECTID;
2182 @@ -1734,8 +1752,7 @@ static int reiserfs_fill_super(struct su
2183 iget5_locked(s, REISERFS_ROOT_OBJECTID, reiserfs_find_actor,
2184 reiserfs_init_locked_inode, (void *)(&args));
2185 if (!root_inode) {
2186 - SWARN(silent, s,
2187 - "jmacd-10: reiserfs_fill_super: get root inode failed");
2188 + SWARN(silent, s, "jmacd-10", "get root inode failed");
2189 goto error;
2190 }
2191
2192 @@ -1784,7 +1801,7 @@ static int reiserfs_fill_super(struct su
2193 * avoiding corruption. -jeffm */
2194 if (bmap_would_wrap(reiserfs_bmap_count(s)) &&
2195 sb_bmap_nr(rs) != 0) {
2196 - reiserfs_warning(s, "super-2030: This file system "
2197 + reiserfs_warning(s, "super-2030", "This file system "
2198 "claims to use %u bitmap blocks in "
2199 "its super block, but requires %u. "
2200 "Clearing to zero.", sb_bmap_nr(rs),
2201 @@ -2085,8 +2102,8 @@ static int reiserfs_quota_on(struct supe
2202 if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) {
2203 err = reiserfs_unpack(inode, NULL);
2204 if (err) {
2205 - reiserfs_warning(sb,
2206 - "reiserfs: Unpacking tail of quota file failed"
2207 + reiserfs_warning(sb, "super-6520",
2208 + "Unpacking tail of quota file failed"
2209 " (%d). Cannot turn on quotas.", err);
2210 err = -EINVAL;
2211 goto out;
2212 @@ -2097,8 +2114,8 @@ static int reiserfs_quota_on(struct supe
2213 if (REISERFS_SB(sb)->s_qf_names[type]) {
2214 /* Quotafile not of fs root? */
2215 if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode)
2216 - reiserfs_warning(sb,
2217 - "reiserfs: Quota file not on filesystem root. "
2218 + reiserfs_warning(sb, "super-6521",
2219 + "Quota file not on filesystem root. "
2220 "Journalled quota will not work.");
2221 }
2222
2223 --- a/fs/reiserfs/tail_conversion.c
2224 +++ b/fs/reiserfs/tail_conversion.c
2225 @@ -48,9 +48,9 @@ int direct2indirect(struct reiserfs_tran
2226
2227 // FIXME: we could avoid this
2228 if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) {
2229 - reiserfs_warning(sb, "PAP-14030: direct2indirect: "
2230 - "pasted or inserted byte exists in the tree %K. "
2231 - "Use fsck to repair.", &end_key);
2232 + reiserfs_warning(sb, "PAP-14030",
2233 + "pasted or inserted byte exists in "
2234 + "the tree %K. Use fsck to repair.", &end_key);
2235 pathrelse(path);
2236 return -EIO;
2237 }
2238 --- a/fs/reiserfs/xattr.c
2239 +++ b/fs/reiserfs/xattr.c
2240 @@ -259,7 +259,8 @@ static int __xattr_readdir(struct inode
2241 ih = de.de_ih;
2242
2243 if (!is_direntry_le_ih(ih)) {
2244 - reiserfs_warning(inode->i_sb, "not direntry %h", ih);
2245 + reiserfs_warning(inode->i_sb, "jdm-20000",
2246 + "not direntry %h", ih);
2247 break;
2248 }
2249 copy_item_head(&tmp_ih, ih);
2250 @@ -598,7 +599,7 @@ reiserfs_xattr_get(const struct inode *i
2251 if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) {
2252 unlock_page(page);
2253 reiserfs_put_page(page);
2254 - reiserfs_warning(inode->i_sb,
2255 + reiserfs_warning(inode->i_sb, "jdm-20001",
2256 "Invalid magic for xattr (%s) "
2257 "associated with %k", name,
2258 INODE_PKEY(inode));
2259 @@ -618,7 +619,7 @@ reiserfs_xattr_get(const struct inode *i
2260
2261 if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) !=
2262 hash) {
2263 - reiserfs_warning(inode->i_sb,
2264 + reiserfs_warning(inode->i_sb, "jdm-20002",
2265 "Invalid hash for xattr (%s) associated "
2266 "with %k", name, INODE_PKEY(inode));
2267 err = -EIO;
2268 @@ -652,7 +653,8 @@ __reiserfs_xattr_del(struct dentry *xadi
2269 goto out_file;
2270
2271 if (!is_reiserfs_priv_object(dentry->d_inode)) {
2272 - reiserfs_warning(dir->i_sb, "OID %08x [%.*s/%.*s] doesn't have "
2273 + reiserfs_warning(dir->i_sb, "jdm-20003",
2274 + "OID %08x [%.*s/%.*s] doesn't have "
2275 "priv flag set [parent is %sset].",
2276 le32_to_cpu(INODE_PKEY(dentry->d_inode)->
2277 k_objectid), xadir->d_name.len,
2278 @@ -750,7 +752,7 @@ int reiserfs_delete_xattrs(struct inode
2279 reiserfs_write_unlock_xattrs(inode->i_sb);
2280 dput(root);
2281 } else {
2282 - reiserfs_warning(inode->i_sb,
2283 + reiserfs_warning(inode->i_sb, "jdm-20006",
2284 "Couldn't remove all entries in directory");
2285 }
2286 unlock_kernel();
2287 @@ -1154,7 +1156,8 @@ int reiserfs_xattr_init(struct super_blo
2288 } else if (reiserfs_xattrs_optional(s)) {
2289 /* Old format filesystem, but optional xattrs have been enabled
2290 * at mount time. Error out. */
2291 - reiserfs_warning(s, "xattrs/ACLs not supported on pre v3.6 "
2292 + reiserfs_warning(s, "jdm-20005",
2293 + "xattrs/ACLs not supported on pre v3.6 "
2294 "format filesystem. Failing mount.");
2295 err = -EOPNOTSUPP;
2296 goto error;
2297 @@ -1201,8 +1204,10 @@ int reiserfs_xattr_init(struct super_blo
2298 /* If we're read-only it just means that the dir hasn't been
2299 * created. Not an error -- just no xattrs on the fs. We'll
2300 * check again if we go read-write */
2301 - reiserfs_warning(s, "xattrs/ACLs enabled and couldn't "
2302 - "find/create .reiserfs_priv. Failing mount.");
2303 + reiserfs_warning(s, "jdm-20006",
2304 + "xattrs/ACLs enabled and couldn't "
2305 + "find/create .reiserfs_priv. "
2306 + "Failing mount.");
2307 err = -EOPNOTSUPP;
2308 }
2309 }
2310 --- a/include/linux/reiserfs_fs.h
2311 +++ b/include/linux/reiserfs_fs.h
2312 @@ -79,7 +79,10 @@ struct fid;
2313 */
2314 #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */
2315
2316 -void reiserfs_warning(struct super_block *s, const char *fmt, ...);
2317 +void __reiserfs_warning(struct super_block *s, const char *id,
2318 + const char *func, const char *fmt, ...);
2319 +#define reiserfs_warning(s, id, fmt, args...) \
2320 + __reiserfs_warning(s, id, __func__, fmt, ##args)
2321 /* assertions handling */
2322
2323 /** always check a condition and panic if it's false. */
2324 @@ -558,7 +561,7 @@ static inline int uniqueness2type(__u32
2325 case V1_DIRENTRY_UNIQUENESS:
2326 return TYPE_DIRENTRY;
2327 default:
2328 - reiserfs_warning(NULL, "vs-500: unknown uniqueness %d",
2329 + reiserfs_warning(NULL, "vs-500", "unknown uniqueness %d",
2330 uniqueness);
2331 case V1_ANY_UNIQUENESS:
2332 return TYPE_ANY;
2333 @@ -578,7 +581,7 @@ static inline __u32 type2uniqueness(int
2334 case TYPE_DIRENTRY:
2335 return V1_DIRENTRY_UNIQUENESS;
2336 default:
2337 - reiserfs_warning(NULL, "vs-501: unknown type %d", type);
2338 + reiserfs_warning(NULL, "vs-501", "unknown type %d", type);
2339 case TYPE_ANY:
2340 return V1_ANY_UNIQUENESS;
2341 }