diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-08-27 06:56:19 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-08-31 10:32:57 -0400 |
commit | 6b38d03f48da3006085e2d3e45168ed60475f7bb (patch) | |
tree | b4153a3af440324ea5c0bbf7961a040d10ee81e5 | |
parent | 79fda5179a5227c930e5b0242b5d5ebf3df29422 (diff) |
UBIFS: use pr_ helper instead of printk
Use 'pr_err()' instead of 'printk(KERN_ERR', etc.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r-- | fs/ubifs/debug.c | 482 | ||||
-rw-r--r-- | fs/ubifs/debug.h | 6 | ||||
-rw-r--r-- | fs/ubifs/lpt_commit.c | 36 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 13 |
4 files changed, 235 insertions, 302 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 9f28375fc5b3..2714e02093a4 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -219,15 +219,15 @@ const char *dbg_jhead(int jhead) | |||
219 | 219 | ||
220 | static void dump_ch(const struct ubifs_ch *ch) | 220 | static void dump_ch(const struct ubifs_ch *ch) |
221 | { | 221 | { |
222 | printk(KERN_ERR "\tmagic %#x\n", le32_to_cpu(ch->magic)); | 222 | pr_err("\tmagic %#x\n", le32_to_cpu(ch->magic)); |
223 | printk(KERN_ERR "\tcrc %#x\n", le32_to_cpu(ch->crc)); | 223 | pr_err("\tcrc %#x\n", le32_to_cpu(ch->crc)); |
224 | printk(KERN_ERR "\tnode_type %d (%s)\n", ch->node_type, | 224 | pr_err("\tnode_type %d (%s)\n", ch->node_type, |
225 | dbg_ntype(ch->node_type)); | 225 | dbg_ntype(ch->node_type)); |
226 | printk(KERN_ERR "\tgroup_type %d (%s)\n", ch->group_type, | 226 | pr_err("\tgroup_type %d (%s)\n", ch->group_type, |
227 | dbg_gtype(ch->group_type)); | 227 | dbg_gtype(ch->group_type)); |
228 | printk(KERN_ERR "\tsqnum %llu\n", | 228 | pr_err("\tsqnum %llu\n", |
229 | (unsigned long long)le64_to_cpu(ch->sqnum)); | 229 | (unsigned long long)le64_to_cpu(ch->sqnum)); |
230 | printk(KERN_ERR "\tlen %u\n", le32_to_cpu(ch->len)); | 230 | pr_err("\tlen %u\n", le32_to_cpu(ch->len)); |
231 | } | 231 | } |
232 | 232 | ||
233 | void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) | 233 | void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) |
@@ -238,43 +238,43 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) | |||
238 | struct ubifs_dent_node *dent, *pdent = NULL; | 238 | struct ubifs_dent_node *dent, *pdent = NULL; |
239 | int count = 2; | 239 | int count = 2; |
240 | 240 | ||
241 | printk(KERN_ERR "Dump in-memory inode:"); | 241 | pr_err("Dump in-memory inode:"); |
242 | printk(KERN_ERR "\tinode %lu\n", inode->i_ino); | 242 | pr_err("\tinode %lu\n", inode->i_ino); |
243 | printk(KERN_ERR "\tsize %llu\n", | 243 | pr_err("\tsize %llu\n", |
244 | (unsigned long long)i_size_read(inode)); | 244 | (unsigned long long)i_size_read(inode)); |
245 | printk(KERN_ERR "\tnlink %u\n", inode->i_nlink); | 245 | pr_err("\tnlink %u\n", inode->i_nlink); |
246 | printk(KERN_ERR "\tuid %u\n", (unsigned int)inode->i_uid); | 246 | pr_err("\tuid %u\n", (unsigned int)inode->i_uid); |
247 | printk(KERN_ERR "\tgid %u\n", (unsigned int)inode->i_gid); | 247 | pr_err("\tgid %u\n", (unsigned int)inode->i_gid); |
248 | printk(KERN_ERR "\tatime %u.%u\n", | 248 | pr_err("\tatime %u.%u\n", |
249 | (unsigned int)inode->i_atime.tv_sec, | 249 | (unsigned int)inode->i_atime.tv_sec, |
250 | (unsigned int)inode->i_atime.tv_nsec); | 250 | (unsigned int)inode->i_atime.tv_nsec); |
251 | printk(KERN_ERR "\tmtime %u.%u\n", | 251 | pr_err("\tmtime %u.%u\n", |
252 | (unsigned int)inode->i_mtime.tv_sec, | 252 | (unsigned int)inode->i_mtime.tv_sec, |
253 | (unsigned int)inode->i_mtime.tv_nsec); | 253 | (unsigned int)inode->i_mtime.tv_nsec); |
254 | printk(KERN_ERR "\tctime %u.%u\n", | 254 | pr_err("\tctime %u.%u\n", |
255 | (unsigned int)inode->i_ctime.tv_sec, | 255 | (unsigned int)inode->i_ctime.tv_sec, |
256 | (unsigned int)inode->i_ctime.tv_nsec); | 256 | (unsigned int)inode->i_ctime.tv_nsec); |
257 | printk(KERN_ERR "\tcreat_sqnum %llu\n", ui->creat_sqnum); | 257 | pr_err("\tcreat_sqnum %llu\n", ui->creat_sqnum); |
258 | printk(KERN_ERR "\txattr_size %u\n", ui->xattr_size); | 258 | pr_err("\txattr_size %u\n", ui->xattr_size); |
259 | printk(KERN_ERR "\txattr_cnt %u\n", ui->xattr_cnt); | 259 | pr_err("\txattr_cnt %u\n", ui->xattr_cnt); |
260 | printk(KERN_ERR "\txattr_names %u\n", ui->xattr_names); | 260 | pr_err("\txattr_names %u\n", ui->xattr_names); |
261 | printk(KERN_ERR "\tdirty %u\n", ui->dirty); | 261 | pr_err("\tdirty %u\n", ui->dirty); |
262 | printk(KERN_ERR "\txattr %u\n", ui->xattr); | 262 | pr_err("\txattr %u\n", ui->xattr); |
263 | printk(KERN_ERR "\tbulk_read %u\n", ui->xattr); | 263 | pr_err("\tbulk_read %u\n", ui->xattr); |
264 | printk(KERN_ERR "\tsynced_i_size %llu\n", | 264 | pr_err("\tsynced_i_size %llu\n", |
265 | (unsigned long long)ui->synced_i_size); | 265 | (unsigned long long)ui->synced_i_size); |
266 | printk(KERN_ERR "\tui_size %llu\n", | 266 | pr_err("\tui_size %llu\n", |
267 | (unsigned long long)ui->ui_size); | 267 | (unsigned long long)ui->ui_size); |
268 | printk(KERN_ERR "\tflags %d\n", ui->flags); | 268 | pr_err("\tflags %d\n", ui->flags); |
269 | printk(KERN_ERR "\tcompr_type %d\n", ui->compr_type); | 269 | pr_err("\tcompr_type %d\n", ui->compr_type); |
270 | printk(KERN_ERR "\tlast_page_read %lu\n", ui->last_page_read); | 270 | pr_err("\tlast_page_read %lu\n", ui->last_page_read); |
271 | printk(KERN_ERR "\tread_in_a_row %lu\n", ui->read_in_a_row); | 271 | pr_err("\tread_in_a_row %lu\n", ui->read_in_a_row); |
272 | printk(KERN_ERR "\tdata_len %d\n", ui->data_len); | 272 | pr_err("\tdata_len %d\n", ui->data_len); |
273 | 273 | ||
274 | if (!S_ISDIR(inode->i_mode)) | 274 | if (!S_ISDIR(inode->i_mode)) |
275 | return; | 275 | return; |
276 | 276 | ||
277 | printk(KERN_ERR "List of directory entries:\n"); | 277 | pr_err("List of directory entries:\n"); |
278 | ubifs_assert(!mutex_is_locked(&c->tnc_mutex)); | 278 | ubifs_assert(!mutex_is_locked(&c->tnc_mutex)); |
279 | 279 | ||
280 | lowest_dent_key(c, &key, inode->i_ino); | 280 | lowest_dent_key(c, &key, inode->i_ino); |
@@ -282,11 +282,11 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) | |||
282 | dent = ubifs_tnc_next_ent(c, &key, &nm); | 282 | dent = ubifs_tnc_next_ent(c, &key, &nm); |
283 | if (IS_ERR(dent)) { | 283 | if (IS_ERR(dent)) { |
284 | if (PTR_ERR(dent) != -ENOENT) | 284 | if (PTR_ERR(dent) != -ENOENT) |
285 | printk(KERN_ERR "error %ld\n", PTR_ERR(dent)); | 285 | pr_err("error %ld\n", PTR_ERR(dent)); |
286 | break; | 286 | break; |
287 | } | 287 | } |
288 | 288 | ||
289 | printk(KERN_ERR "\t%d: %s (%s)\n", | 289 | pr_err("\t%d: %s (%s)\n", |
290 | count++, dent->name, get_dent_type(dent->type)); | 290 | count++, dent->name, get_dent_type(dent->type)); |
291 | 291 | ||
292 | nm.name = dent->name; | 292 | nm.name = dent->name; |
@@ -307,7 +307,7 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
307 | 307 | ||
308 | /* If the magic is incorrect, just hexdump the first bytes */ | 308 | /* If the magic is incorrect, just hexdump the first bytes */ |
309 | if (le32_to_cpu(ch->magic) != UBIFS_NODE_MAGIC) { | 309 | if (le32_to_cpu(ch->magic) != UBIFS_NODE_MAGIC) { |
310 | printk(KERN_ERR "Not a node, first %zu bytes:", UBIFS_CH_SZ); | 310 | pr_err("Not a node, first %zu bytes:", UBIFS_CH_SZ); |
311 | print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 32, 1, | 311 | print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 32, 1, |
312 | (void *)node, UBIFS_CH_SZ, 1); | 312 | (void *)node, UBIFS_CH_SZ, 1); |
313 | return; | 313 | return; |
@@ -321,8 +321,7 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
321 | { | 321 | { |
322 | const struct ubifs_pad_node *pad = node; | 322 | const struct ubifs_pad_node *pad = node; |
323 | 323 | ||
324 | printk(KERN_ERR "\tpad_len %u\n", | 324 | pr_err("\tpad_len %u\n", le32_to_cpu(pad->pad_len)); |
325 | le32_to_cpu(pad->pad_len)); | ||
326 | break; | 325 | break; |
327 | } | 326 | } |
328 | case UBIFS_SB_NODE: | 327 | case UBIFS_SB_NODE: |
@@ -330,112 +329,77 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
330 | const struct ubifs_sb_node *sup = node; | 329 | const struct ubifs_sb_node *sup = node; |
331 | unsigned int sup_flags = le32_to_cpu(sup->flags); | 330 | unsigned int sup_flags = le32_to_cpu(sup->flags); |
332 | 331 | ||
333 | printk(KERN_ERR "\tkey_hash %d (%s)\n", | 332 | pr_err("\tkey_hash %d (%s)\n", |
334 | (int)sup->key_hash, get_key_hash(sup->key_hash)); | 333 | (int)sup->key_hash, get_key_hash(sup->key_hash)); |
335 | printk(KERN_ERR "\tkey_fmt %d (%s)\n", | 334 | pr_err("\tkey_fmt %d (%s)\n", |
336 | (int)sup->key_fmt, get_key_fmt(sup->key_fmt)); | 335 | (int)sup->key_fmt, get_key_fmt(sup->key_fmt)); |
337 | printk(KERN_ERR "\tflags %#x\n", sup_flags); | 336 | pr_err("\tflags %#x\n", sup_flags); |
338 | printk(KERN_ERR "\t big_lpt %u\n", | 337 | pr_err("\t big_lpt %u\n", |
339 | !!(sup_flags & UBIFS_FLG_BIGLPT)); | 338 | !!(sup_flags & UBIFS_FLG_BIGLPT)); |
340 | printk(KERN_ERR "\t space_fixup %u\n", | 339 | pr_err("\t space_fixup %u\n", |
341 | !!(sup_flags & UBIFS_FLG_SPACE_FIXUP)); | 340 | !!(sup_flags & UBIFS_FLG_SPACE_FIXUP)); |
342 | printk(KERN_ERR "\tmin_io_size %u\n", | 341 | pr_err("\tmin_io_size %u\n", le32_to_cpu(sup->min_io_size)); |
343 | le32_to_cpu(sup->min_io_size)); | 342 | pr_err("\tleb_size %u\n", le32_to_cpu(sup->leb_size)); |
344 | printk(KERN_ERR "\tleb_size %u\n", | 343 | pr_err("\tleb_cnt %u\n", le32_to_cpu(sup->leb_cnt)); |
345 | le32_to_cpu(sup->leb_size)); | 344 | pr_err("\tmax_leb_cnt %u\n", le32_to_cpu(sup->max_leb_cnt)); |
346 | printk(KERN_ERR "\tleb_cnt %u\n", | 345 | pr_err("\tmax_bud_bytes %llu\n", |
347 | le32_to_cpu(sup->leb_cnt)); | ||
348 | printk(KERN_ERR "\tmax_leb_cnt %u\n", | ||
349 | le32_to_cpu(sup->max_leb_cnt)); | ||
350 | printk(KERN_ERR "\tmax_bud_bytes %llu\n", | ||
351 | (unsigned long long)le64_to_cpu(sup->max_bud_bytes)); | 346 | (unsigned long long)le64_to_cpu(sup->max_bud_bytes)); |
352 | printk(KERN_ERR "\tlog_lebs %u\n", | 347 | pr_err("\tlog_lebs %u\n", le32_to_cpu(sup->log_lebs)); |
353 | le32_to_cpu(sup->log_lebs)); | 348 | pr_err("\tlpt_lebs %u\n", le32_to_cpu(sup->lpt_lebs)); |
354 | printk(KERN_ERR "\tlpt_lebs %u\n", | 349 | pr_err("\torph_lebs %u\n", le32_to_cpu(sup->orph_lebs)); |
355 | le32_to_cpu(sup->lpt_lebs)); | 350 | pr_err("\tjhead_cnt %u\n", le32_to_cpu(sup->jhead_cnt)); |
356 | printk(KERN_ERR "\torph_lebs %u\n", | 351 | pr_err("\tfanout %u\n", le32_to_cpu(sup->fanout)); |
357 | le32_to_cpu(sup->orph_lebs)); | 352 | pr_err("\tlsave_cnt %u\n", le32_to_cpu(sup->lsave_cnt)); |
358 | printk(KERN_ERR "\tjhead_cnt %u\n", | 353 | pr_err("\tdefault_compr %u\n", |
359 | le32_to_cpu(sup->jhead_cnt)); | ||
360 | printk(KERN_ERR "\tfanout %u\n", | ||
361 | le32_to_cpu(sup->fanout)); | ||
362 | printk(KERN_ERR "\tlsave_cnt %u\n", | ||
363 | le32_to_cpu(sup->lsave_cnt)); | ||
364 | printk(KERN_ERR "\tdefault_compr %u\n", | ||
365 | (int)le16_to_cpu(sup->default_compr)); | 354 | (int)le16_to_cpu(sup->default_compr)); |
366 | printk(KERN_ERR "\trp_size %llu\n", | 355 | pr_err("\trp_size %llu\n", |
367 | (unsigned long long)le64_to_cpu(sup->rp_size)); | 356 | (unsigned long long)le64_to_cpu(sup->rp_size)); |
368 | printk(KERN_ERR "\trp_uid %u\n", | 357 | pr_err("\trp_uid %u\n", le32_to_cpu(sup->rp_uid)); |
369 | le32_to_cpu(sup->rp_uid)); | 358 | pr_err("\trp_gid %u\n", le32_to_cpu(sup->rp_gid)); |
370 | printk(KERN_ERR "\trp_gid %u\n", | 359 | pr_err("\tfmt_version %u\n", le32_to_cpu(sup->fmt_version)); |
371 | le32_to_cpu(sup->rp_gid)); | 360 | pr_err("\ttime_gran %u\n", le32_to_cpu(sup->time_gran)); |
372 | printk(KERN_ERR "\tfmt_version %u\n", | 361 | pr_err("\tUUID %pUB\n", sup->uuid); |
373 | le32_to_cpu(sup->fmt_version)); | ||
374 | printk(KERN_ERR "\ttime_gran %u\n", | ||
375 | le32_to_cpu(sup->time_gran)); | ||
376 | printk(KERN_ERR "\tUUID %pUB\n", | ||
377 | sup->uuid); | ||
378 | break; | 362 | break; |
379 | } | 363 | } |
380 | case UBIFS_MST_NODE: | 364 | case UBIFS_MST_NODE: |
381 | { | 365 | { |
382 | const struct ubifs_mst_node *mst = node; | 366 | const struct ubifs_mst_node *mst = node; |
383 | 367 | ||
384 | printk(KERN_ERR "\thighest_inum %llu\n", | 368 | pr_err("\thighest_inum %llu\n", |
385 | (unsigned long long)le64_to_cpu(mst->highest_inum)); | 369 | (unsigned long long)le64_to_cpu(mst->highest_inum)); |
386 | printk(KERN_ERR "\tcommit number %llu\n", | 370 | pr_err("\tcommit number %llu\n", |
387 | (unsigned long long)le64_to_cpu(mst->cmt_no)); | 371 | (unsigned long long)le64_to_cpu(mst->cmt_no)); |
388 | printk(KERN_ERR "\tflags %#x\n", | 372 | pr_err("\tflags %#x\n", le32_to_cpu(mst->flags)); |
389 | le32_to_cpu(mst->flags)); | 373 | pr_err("\tlog_lnum %u\n", le32_to_cpu(mst->log_lnum)); |
390 | printk(KERN_ERR "\tlog_lnum %u\n", | 374 | pr_err("\troot_lnum %u\n", le32_to_cpu(mst->root_lnum)); |
391 | le32_to_cpu(mst->log_lnum)); | 375 | pr_err("\troot_offs %u\n", le32_to_cpu(mst->root_offs)); |
392 | printk(KERN_ERR "\troot_lnum %u\n", | 376 | pr_err("\troot_len %u\n", le32_to_cpu(mst->root_len)); |
393 | le32_to_cpu(mst->root_lnum)); | 377 | pr_err("\tgc_lnum %u\n", le32_to_cpu(mst->gc_lnum)); |
394 | printk(KERN_ERR "\troot_offs %u\n", | 378 | pr_err("\tihead_lnum %u\n", le32_to_cpu(mst->ihead_lnum)); |
395 | le32_to_cpu(mst->root_offs)); | 379 | pr_err("\tihead_offs %u\n", le32_to_cpu(mst->ihead_offs)); |
396 | printk(KERN_ERR "\troot_len %u\n", | 380 | pr_err("\tindex_size %llu\n", |
397 | le32_to_cpu(mst->root_len)); | ||
398 | printk(KERN_ERR "\tgc_lnum %u\n", | ||
399 | le32_to_cpu(mst->gc_lnum)); | ||
400 | printk(KERN_ERR "\tihead_lnum %u\n", | ||
401 | le32_to_cpu(mst->ihead_lnum)); | ||
402 | printk(KERN_ERR "\tihead_offs %u\n", | ||
403 | le32_to_cpu(mst->ihead_offs)); | ||
404 | printk(KERN_ERR "\tindex_size %llu\n", | ||
405 | (unsigned long long)le64_to_cpu(mst->index_size)); | 381 | (unsigned long long)le64_to_cpu(mst->index_size)); |
406 | printk(KERN_ERR "\tlpt_lnum %u\n", | 382 | pr_err("\tlpt_lnum %u\n", le32_to_cpu(mst->lpt_lnum)); |
407 | le32_to_cpu(mst->lpt_lnum)); | 383 | pr_err("\tlpt_offs %u\n", le32_to_cpu(mst->lpt_offs)); |
408 | printk(KERN_ERR "\tlpt_offs %u\n", | 384 | pr_err("\tnhead_lnum %u\n", le32_to_cpu(mst->nhead_lnum)); |
409 | le32_to_cpu(mst->lpt_offs)); | 385 | pr_err("\tnhead_offs %u\n", le32_to_cpu(mst->nhead_offs)); |
410 | printk(KERN_ERR "\tnhead_lnum %u\n", | 386 | pr_err("\tltab_lnum %u\n", le32_to_cpu(mst->ltab_lnum)); |
411 | le32_to_cpu(mst->nhead_lnum)); | 387 | pr_err("\tltab_offs %u\n", le32_to_cpu(mst->ltab_offs)); |
412 | printk(KERN_ERR "\tnhead_offs %u\n", | 388 | pr_err("\tlsave_lnum %u\n", le32_to_cpu(mst->lsave_lnum)); |
413 | le32_to_cpu(mst->nhead_offs)); | 389 | pr_err("\tlsave_offs %u\n", le32_to_cpu(mst->lsave_offs)); |
414 | printk(KERN_ERR "\tltab_lnum %u\n", | 390 | pr_err("\tlscan_lnum %u\n", le32_to_cpu(mst->lscan_lnum)); |
415 | le32_to_cpu(mst->ltab_lnum)); | 391 | pr_err("\tleb_cnt %u\n", le32_to_cpu(mst->leb_cnt)); |
416 | printk(KERN_ERR "\tltab_offs %u\n", | 392 | pr_err("\tempty_lebs %u\n", le32_to_cpu(mst->empty_lebs)); |
417 | le32_to_cpu(mst->ltab_offs)); | 393 | pr_err("\tidx_lebs %u\n", le32_to_cpu(mst->idx_lebs)); |
418 | printk(KERN_ERR "\tlsave_lnum %u\n", | 394 | pr_err("\ttotal_free %llu\n", |
419 | le32_to_cpu(mst->lsave_lnum)); | ||
420 | printk(KERN_ERR "\tlsave_offs %u\n", | ||
421 | le32_to_cpu(mst->lsave_offs)); | ||
422 | printk(KERN_ERR "\tlscan_lnum %u\n", | ||
423 | le32_to_cpu(mst->lscan_lnum)); | ||
424 | printk(KERN_ERR "\tleb_cnt %u\n", | ||
425 | le32_to_cpu(mst->leb_cnt)); | ||
426 | printk(KERN_ERR "\tempty_lebs %u\n", | ||
427 | le32_to_cpu(mst->empty_lebs)); | ||
428 | printk(KERN_ERR "\tidx_lebs %u\n", | ||
429 | le32_to_cpu(mst->idx_lebs)); | ||
430 | printk(KERN_ERR "\ttotal_free %llu\n", | ||
431 | (unsigned long long)le64_to_cpu(mst->total_free)); | 395 | (unsigned long long)le64_to_cpu(mst->total_free)); |
432 | printk(KERN_ERR "\ttotal_dirty %llu\n", | 396 | pr_err("\ttotal_dirty %llu\n", |
433 | (unsigned long long)le64_to_cpu(mst->total_dirty)); | 397 | (unsigned long long)le64_to_cpu(mst->total_dirty)); |
434 | printk(KERN_ERR "\ttotal_used %llu\n", | 398 | pr_err("\ttotal_used %llu\n", |
435 | (unsigned long long)le64_to_cpu(mst->total_used)); | 399 | (unsigned long long)le64_to_cpu(mst->total_used)); |
436 | printk(KERN_ERR "\ttotal_dead %llu\n", | 400 | pr_err("\ttotal_dead %llu\n", |
437 | (unsigned long long)le64_to_cpu(mst->total_dead)); | 401 | (unsigned long long)le64_to_cpu(mst->total_dead)); |
438 | printk(KERN_ERR "\ttotal_dark %llu\n", | 402 | pr_err("\ttotal_dark %llu\n", |
439 | (unsigned long long)le64_to_cpu(mst->total_dark)); | 403 | (unsigned long long)le64_to_cpu(mst->total_dark)); |
440 | break; | 404 | break; |
441 | } | 405 | } |
@@ -443,12 +407,9 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
443 | { | 407 | { |
444 | const struct ubifs_ref_node *ref = node; | 408 | const struct ubifs_ref_node *ref = node; |
445 | 409 | ||
446 | printk(KERN_ERR "\tlnum %u\n", | 410 | pr_err("\tlnum %u\n", le32_to_cpu(ref->lnum)); |
447 | le32_to_cpu(ref->lnum)); | 411 | pr_err("\toffs %u\n", le32_to_cpu(ref->offs)); |
448 | printk(KERN_ERR "\toffs %u\n", | 412 | pr_err("\tjhead %u\n", le32_to_cpu(ref->jhead)); |
449 | le32_to_cpu(ref->offs)); | ||
450 | printk(KERN_ERR "\tjhead %u\n", | ||
451 | le32_to_cpu(ref->jhead)); | ||
452 | break; | 413 | break; |
453 | } | 414 | } |
454 | case UBIFS_INO_NODE: | 415 | case UBIFS_INO_NODE: |
@@ -456,41 +417,32 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
456 | const struct ubifs_ino_node *ino = node; | 417 | const struct ubifs_ino_node *ino = node; |
457 | 418 | ||
458 | key_read(c, &ino->key, &key); | 419 | key_read(c, &ino->key, &key); |
459 | printk(KERN_ERR "\tkey %s\n", | 420 | pr_err("\tkey %s\n", |
460 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); | 421 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); |
461 | printk(KERN_ERR "\tcreat_sqnum %llu\n", | 422 | pr_err("\tcreat_sqnum %llu\n", |
462 | (unsigned long long)le64_to_cpu(ino->creat_sqnum)); | 423 | (unsigned long long)le64_to_cpu(ino->creat_sqnum)); |
463 | printk(KERN_ERR "\tsize %llu\n", | 424 | pr_err("\tsize %llu\n", |
464 | (unsigned long long)le64_to_cpu(ino->size)); | 425 | (unsigned long long)le64_to_cpu(ino->size)); |
465 | printk(KERN_ERR "\tnlink %u\n", | 426 | pr_err("\tnlink %u\n", le32_to_cpu(ino->nlink)); |
466 | le32_to_cpu(ino->nlink)); | 427 | pr_err("\tatime %lld.%u\n", |
467 | printk(KERN_ERR "\tatime %lld.%u\n", | ||
468 | (long long)le64_to_cpu(ino->atime_sec), | 428 | (long long)le64_to_cpu(ino->atime_sec), |
469 | le32_to_cpu(ino->atime_nsec)); | 429 | le32_to_cpu(ino->atime_nsec)); |
470 | printk(KERN_ERR "\tmtime %lld.%u\n", | 430 | pr_err("\tmtime %lld.%u\n", |
471 | (long long)le64_to_cpu(ino->mtime_sec), | 431 | (long long)le64_to_cpu(ino->mtime_sec), |
472 | le32_to_cpu(ino->mtime_nsec)); | 432 | le32_to_cpu(ino->mtime_nsec)); |
473 | printk(KERN_ERR "\tctime %lld.%u\n", | 433 | pr_err("\tctime %lld.%u\n", |
474 | (long long)le64_to_cpu(ino->ctime_sec), | 434 | (long long)le64_to_cpu(ino->ctime_sec), |
475 | le32_to_cpu(ino->ctime_nsec)); | 435 | le32_to_cpu(ino->ctime_nsec)); |
476 | printk(KERN_ERR "\tuid %u\n", | 436 | pr_err("\tuid %u\n", le32_to_cpu(ino->uid)); |
477 | le32_to_cpu(ino->uid)); | 437 | pr_err("\tgid %u\n", le32_to_cpu(ino->gid)); |
478 | printk(KERN_ERR "\tgid %u\n", | 438 | pr_err("\tmode %u\n", le32_to_cpu(ino->mode)); |
479 | le32_to_cpu(ino->gid)); | 439 | pr_err("\tflags %#x\n", le32_to_cpu(ino->flags)); |
480 | printk(KERN_ERR "\tmode %u\n", | 440 | pr_err("\txattr_cnt %u\n", le32_to_cpu(ino->xattr_cnt)); |
481 | le32_to_cpu(ino->mode)); | 441 | pr_err("\txattr_size %u\n", le32_to_cpu(ino->xattr_size)); |
482 | printk(KERN_ERR "\tflags %#x\n", | 442 | pr_err("\txattr_names %u\n", le32_to_cpu(ino->xattr_names)); |
483 | le32_to_cpu(ino->flags)); | 443 | pr_err("\tcompr_type %#x\n", |
484 | printk(KERN_ERR "\txattr_cnt %u\n", | ||
485 | le32_to_cpu(ino->xattr_cnt)); | ||
486 | printk(KERN_ERR "\txattr_size %u\n", | ||
487 | le32_to_cpu(ino->xattr_size)); | ||
488 | printk(KERN_ERR "\txattr_names %u\n", | ||
489 | le32_to_cpu(ino->xattr_names)); | ||
490 | printk(KERN_ERR "\tcompr_type %#x\n", | ||
491 | (int)le16_to_cpu(ino->compr_type)); | 444 | (int)le16_to_cpu(ino->compr_type)); |
492 | printk(KERN_ERR "\tdata len %u\n", | 445 | pr_err("\tdata len %u\n", le32_to_cpu(ino->data_len)); |
493 | le32_to_cpu(ino->data_len)); | ||
494 | break; | 446 | break; |
495 | } | 447 | } |
496 | case UBIFS_DENT_NODE: | 448 | case UBIFS_DENT_NODE: |
@@ -500,21 +452,21 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
500 | int nlen = le16_to_cpu(dent->nlen); | 452 | int nlen = le16_to_cpu(dent->nlen); |
501 | 453 | ||
502 | key_read(c, &dent->key, &key); | 454 | key_read(c, &dent->key, &key); |
503 | printk(KERN_ERR "\tkey %s\n", | 455 | pr_err("\tkey %s\n", |
504 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); | 456 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); |
505 | printk(KERN_ERR "\tinum %llu\n", | 457 | pr_err("\tinum %llu\n", |
506 | (unsigned long long)le64_to_cpu(dent->inum)); | 458 | (unsigned long long)le64_to_cpu(dent->inum)); |
507 | printk(KERN_ERR "\ttype %d\n", (int)dent->type); | 459 | pr_err("\ttype %d\n", (int)dent->type); |
508 | printk(KERN_ERR "\tnlen %d\n", nlen); | 460 | pr_err("\tnlen %d\n", nlen); |
509 | printk(KERN_ERR "\tname "); | 461 | pr_err("\tname "); |
510 | 462 | ||
511 | if (nlen > UBIFS_MAX_NLEN) | 463 | if (nlen > UBIFS_MAX_NLEN) |
512 | printk(KERN_ERR "(bad name length, not printing, bad or corrupted node)"); | 464 | pr_err("(bad name length, not printing, bad or corrupted node)"); |
513 | else { | 465 | else { |
514 | for (i = 0; i < nlen && dent->name[i]; i++) | 466 | for (i = 0; i < nlen && dent->name[i]; i++) |
515 | printk(KERN_CONT "%c", dent->name[i]); | 467 | pr_cont("%c", dent->name[i]); |
516 | } | 468 | } |
517 | printk(KERN_CONT "\n"); | 469 | pr_cont("\n"); |
518 | 470 | ||
519 | break; | 471 | break; |
520 | } | 472 | } |
@@ -524,15 +476,13 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
524 | int dlen = le32_to_cpu(ch->len) - UBIFS_DATA_NODE_SZ; | 476 | int dlen = le32_to_cpu(ch->len) - UBIFS_DATA_NODE_SZ; |
525 | 477 | ||
526 | key_read(c, &dn->key, &key); | 478 | key_read(c, &dn->key, &key); |
527 | printk(KERN_ERR "\tkey %s\n", | 479 | pr_err("\tkey %s\n", |
528 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); | 480 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); |
529 | printk(KERN_ERR "\tsize %u\n", | 481 | pr_err("\tsize %u\n", le32_to_cpu(dn->size)); |
530 | le32_to_cpu(dn->size)); | 482 | pr_err("\tcompr_typ %d\n", |
531 | printk(KERN_ERR "\tcompr_typ %d\n", | ||
532 | (int)le16_to_cpu(dn->compr_type)); | 483 | (int)le16_to_cpu(dn->compr_type)); |
533 | printk(KERN_ERR "\tdata size %d\n", | 484 | pr_err("\tdata size %d\n", dlen); |
534 | dlen); | 485 | pr_err("\tdata:\n"); |
535 | printk(KERN_ERR "\tdata:\n"); | ||
536 | print_hex_dump(KERN_ERR, "\t", DUMP_PREFIX_OFFSET, 32, 1, | 486 | print_hex_dump(KERN_ERR, "\t", DUMP_PREFIX_OFFSET, 32, 1, |
537 | (void *)&dn->data, dlen, 0); | 487 | (void *)&dn->data, dlen, 0); |
538 | break; | 488 | break; |
@@ -541,11 +491,10 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
541 | { | 491 | { |
542 | const struct ubifs_trun_node *trun = node; | 492 | const struct ubifs_trun_node *trun = node; |
543 | 493 | ||
544 | printk(KERN_ERR "\tinum %u\n", | 494 | pr_err("\tinum %u\n", le32_to_cpu(trun->inum)); |
545 | le32_to_cpu(trun->inum)); | 495 | pr_err("\told_size %llu\n", |
546 | printk(KERN_ERR "\told_size %llu\n", | ||
547 | (unsigned long long)le64_to_cpu(trun->old_size)); | 496 | (unsigned long long)le64_to_cpu(trun->old_size)); |
548 | printk(KERN_ERR "\tnew_size %llu\n", | 497 | pr_err("\tnew_size %llu\n", |
549 | (unsigned long long)le64_to_cpu(trun->new_size)); | 498 | (unsigned long long)le64_to_cpu(trun->new_size)); |
550 | break; | 499 | break; |
551 | } | 500 | } |
@@ -554,17 +503,16 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
554 | const struct ubifs_idx_node *idx = node; | 503 | const struct ubifs_idx_node *idx = node; |
555 | 504 | ||
556 | n = le16_to_cpu(idx->child_cnt); | 505 | n = le16_to_cpu(idx->child_cnt); |
557 | printk(KERN_ERR "\tchild_cnt %d\n", n); | 506 | pr_err("\tchild_cnt %d\n", n); |
558 | printk(KERN_ERR "\tlevel %d\n", | 507 | pr_err("\tlevel %d\n", (int)le16_to_cpu(idx->level)); |
559 | (int)le16_to_cpu(idx->level)); | 508 | pr_err("\tBranches:\n"); |
560 | printk(KERN_ERR "\tBranches:\n"); | ||
561 | 509 | ||
562 | for (i = 0; i < n && i < c->fanout - 1; i++) { | 510 | for (i = 0; i < n && i < c->fanout - 1; i++) { |
563 | const struct ubifs_branch *br; | 511 | const struct ubifs_branch *br; |
564 | 512 | ||
565 | br = ubifs_idx_branch(c, idx, i); | 513 | br = ubifs_idx_branch(c, idx, i); |
566 | key_read(c, &br->key, &key); | 514 | key_read(c, &br->key, &key); |
567 | printk(KERN_ERR "\t%d: LEB %d:%d len %d key %s\n", | 515 | pr_err("\t%d: LEB %d:%d len %d key %s\n", |
568 | i, le32_to_cpu(br->lnum), le32_to_cpu(br->offs), | 516 | i, le32_to_cpu(br->lnum), le32_to_cpu(br->offs), |
569 | le32_to_cpu(br->len), | 517 | le32_to_cpu(br->len), |
570 | dbg_snprintf_key(c, &key, key_buf, | 518 | dbg_snprintf_key(c, &key, key_buf, |
@@ -578,20 +526,20 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
578 | { | 526 | { |
579 | const struct ubifs_orph_node *orph = node; | 527 | const struct ubifs_orph_node *orph = node; |
580 | 528 | ||
581 | printk(KERN_ERR "\tcommit number %llu\n", | 529 | pr_err("\tcommit number %llu\n", |
582 | (unsigned long long) | 530 | (unsigned long long) |
583 | le64_to_cpu(orph->cmt_no) & LLONG_MAX); | 531 | le64_to_cpu(orph->cmt_no) & LLONG_MAX); |
584 | printk(KERN_ERR "\tlast node flag %llu\n", | 532 | pr_err("\tlast node flag %llu\n", |
585 | (unsigned long long)(le64_to_cpu(orph->cmt_no)) >> 63); | 533 | (unsigned long long)(le64_to_cpu(orph->cmt_no)) >> 63); |
586 | n = (le32_to_cpu(ch->len) - UBIFS_ORPH_NODE_SZ) >> 3; | 534 | n = (le32_to_cpu(ch->len) - UBIFS_ORPH_NODE_SZ) >> 3; |
587 | printk(KERN_ERR "\t%d orphan inode numbers:\n", n); | 535 | pr_err("\t%d orphan inode numbers:\n", n); |
588 | for (i = 0; i < n; i++) | 536 | for (i = 0; i < n; i++) |
589 | printk(KERN_ERR "\t ino %llu\n", | 537 | pr_err("\t ino %llu\n", |
590 | (unsigned long long)le64_to_cpu(orph->inos[i])); | 538 | (unsigned long long)le64_to_cpu(orph->inos[i])); |
591 | break; | 539 | break; |
592 | } | 540 | } |
593 | default: | 541 | default: |
594 | printk(KERN_ERR "node type %d was not recognized\n", | 542 | pr_err("node type %d was not recognized\n", |
595 | (int)ch->node_type); | 543 | (int)ch->node_type); |
596 | } | 544 | } |
597 | spin_unlock(&dbg_lock); | 545 | spin_unlock(&dbg_lock); |
@@ -600,16 +548,16 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) | |||
600 | void ubifs_dump_budget_req(const struct ubifs_budget_req *req) | 548 | void ubifs_dump_budget_req(const struct ubifs_budget_req *req) |
601 | { | 549 | { |
602 | spin_lock(&dbg_lock); | 550 | spin_lock(&dbg_lock); |
603 | printk(KERN_ERR "Budgeting request: new_ino %d, dirtied_ino %d\n", | 551 | pr_err("Budgeting request: new_ino %d, dirtied_ino %d\n", |
604 | req->new_ino, req->dirtied_ino); | 552 | req->new_ino, req->dirtied_ino); |
605 | printk(KERN_ERR "\tnew_ino_d %d, dirtied_ino_d %d\n", | 553 | pr_err("\tnew_ino_d %d, dirtied_ino_d %d\n", |
606 | req->new_ino_d, req->dirtied_ino_d); | 554 | req->new_ino_d, req->dirtied_ino_d); |
607 | printk(KERN_ERR "\tnew_page %d, dirtied_page %d\n", | 555 | pr_err("\tnew_page %d, dirtied_page %d\n", |
608 | req->new_page, req->dirtied_page); | 556 | req->new_page, req->dirtied_page); |
609 | printk(KERN_ERR "\tnew_dent %d, mod_dent %d\n", | 557 | pr_err("\tnew_dent %d, mod_dent %d\n", |
610 | req->new_dent, req->mod_dent); | 558 | req->new_dent, req->mod_dent); |
611 | printk(KERN_ERR "\tidx_growth %d\n", req->idx_growth); | 559 | pr_err("\tidx_growth %d\n", req->idx_growth); |
612 | printk(KERN_ERR "\tdata_growth %d dd_growth %d\n", | 560 | pr_err("\tdata_growth %d dd_growth %d\n", |
613 | req->data_growth, req->dd_growth); | 561 | req->data_growth, req->dd_growth); |
614 | spin_unlock(&dbg_lock); | 562 | spin_unlock(&dbg_lock); |
615 | } | 563 | } |
@@ -617,11 +565,11 @@ void ubifs_dump_budget_req(const struct ubifs_budget_req *req) | |||
617 | void ubifs_dump_lstats(const struct ubifs_lp_stats *lst) | 565 | void ubifs_dump_lstats(const struct ubifs_lp_stats *lst) |
618 | { | 566 | { |
619 | spin_lock(&dbg_lock); | 567 | spin_lock(&dbg_lock); |
620 | printk(KERN_ERR "(pid %d) Lprops statistics: empty_lebs %d, idx_lebs %d\n", | 568 | pr_err("(pid %d) Lprops statistics: empty_lebs %d, idx_lebs %d\n", |
621 | current->pid, lst->empty_lebs, lst->idx_lebs); | 569 | current->pid, lst->empty_lebs, lst->idx_lebs); |
622 | printk(KERN_ERR "\ttaken_empty_lebs %d, total_free %lld, total_dirty %lld\n", | 570 | pr_err("\ttaken_empty_lebs %d, total_free %lld, total_dirty %lld\n", |
623 | lst->taken_empty_lebs, lst->total_free, lst->total_dirty); | 571 | lst->taken_empty_lebs, lst->total_free, lst->total_dirty); |
624 | printk(KERN_ERR "\ttotal_used %lld, total_dark %lld, total_dead %lld\n", | 572 | pr_err("\ttotal_used %lld, total_dark %lld, total_dead %lld\n", |
625 | lst->total_used, lst->total_dark, lst->total_dead); | 573 | lst->total_used, lst->total_dark, lst->total_dead); |
626 | spin_unlock(&dbg_lock); | 574 | spin_unlock(&dbg_lock); |
627 | } | 575 | } |
@@ -636,18 +584,17 @@ void ubifs_dump_budg(struct ubifs_info *c, const struct ubifs_budg_info *bi) | |||
636 | 584 | ||
637 | spin_lock(&c->space_lock); | 585 | spin_lock(&c->space_lock); |
638 | spin_lock(&dbg_lock); | 586 | spin_lock(&dbg_lock); |
639 | printk(KERN_ERR "(pid %d) Budgeting info: data budget sum %lld, total budget sum %lld\n", | 587 | pr_err("(pid %d) Budgeting info: data budget sum %lld, total budget sum %lld\n", |
640 | current->pid, bi->data_growth + bi->dd_growth, | 588 | current->pid, bi->data_growth + bi->dd_growth, |
641 | bi->data_growth + bi->dd_growth + bi->idx_growth); | 589 | bi->data_growth + bi->dd_growth + bi->idx_growth); |
642 | printk(KERN_ERR "\tbudg_data_growth %lld, budg_dd_growth %lld, budg_idx_growth %lld\n", | 590 | pr_err("\tbudg_data_growth %lld, budg_dd_growth %lld, budg_idx_growth %lld\n", |
643 | bi->data_growth, bi->dd_growth, bi->idx_growth); | 591 | bi->data_growth, bi->dd_growth, bi->idx_growth); |
644 | printk(KERN_ERR "\tmin_idx_lebs %d, old_idx_sz %llu, uncommitted_idx %lld\n", | 592 | pr_err("\tmin_idx_lebs %d, old_idx_sz %llu, uncommitted_idx %lld\n", |
645 | bi->min_idx_lebs, bi->old_idx_sz, bi->uncommitted_idx); | 593 | bi->min_idx_lebs, bi->old_idx_sz, bi->uncommitted_idx); |
646 | printk(KERN_ERR "\tpage_budget %d, inode_budget %d, dent_budget %d\n", | 594 | pr_err("\tpage_budget %d, inode_budget %d, dent_budget %d\n", |
647 | bi->page_budget, bi->inode_budget, bi->dent_budget); | 595 | bi->page_budget, bi->inode_budget, bi->dent_budget); |
648 | printk(KERN_ERR "\tnospace %u, nospace_rp %u\n", | 596 | pr_err("\tnospace %u, nospace_rp %u\n", bi->nospace, bi->nospace_rp); |
649 | bi->nospace, bi->nospace_rp); | 597 | pr_err("\tdark_wm %d, dead_wm %d, max_idx_node_sz %d\n", |
650 | printk(KERN_ERR "\tdark_wm %d, dead_wm %d, max_idx_node_sz %d\n", | ||
651 | c->dark_wm, c->dead_wm, c->max_idx_node_sz); | 598 | c->dark_wm, c->dead_wm, c->max_idx_node_sz); |
652 | 599 | ||
653 | if (bi != &c->bi) | 600 | if (bi != &c->bi) |
@@ -658,38 +605,37 @@ void ubifs_dump_budg(struct ubifs_info *c, const struct ubifs_budg_info *bi) | |||
658 | */ | 605 | */ |
659 | goto out_unlock; | 606 | goto out_unlock; |
660 | 607 | ||
661 | printk(KERN_ERR "\tfreeable_cnt %d, calc_idx_sz %lld, idx_gc_cnt %d\n", | 608 | pr_err("\tfreeable_cnt %d, calc_idx_sz %lld, idx_gc_cnt %d\n", |
662 | c->freeable_cnt, c->calc_idx_sz, c->idx_gc_cnt); | 609 | c->freeable_cnt, c->calc_idx_sz, c->idx_gc_cnt); |
663 | printk(KERN_ERR "\tdirty_pg_cnt %ld, dirty_zn_cnt %ld, clean_zn_cnt %ld\n", | 610 | pr_err("\tdirty_pg_cnt %ld, dirty_zn_cnt %ld, clean_zn_cnt %ld\n", |
664 | atomic_long_read(&c->dirty_pg_cnt), | 611 | atomic_long_read(&c->dirty_pg_cnt), |
665 | atomic_long_read(&c->dirty_zn_cnt), | 612 | atomic_long_read(&c->dirty_zn_cnt), |
666 | atomic_long_read(&c->clean_zn_cnt)); | 613 | atomic_long_read(&c->clean_zn_cnt)); |
667 | printk(KERN_ERR "\tgc_lnum %d, ihead_lnum %d\n", | 614 | pr_err("\tgc_lnum %d, ihead_lnum %d\n", c->gc_lnum, c->ihead_lnum); |
668 | c->gc_lnum, c->ihead_lnum); | ||
669 | 615 | ||
670 | /* If we are in R/O mode, journal heads do not exist */ | 616 | /* If we are in R/O mode, journal heads do not exist */ |
671 | if (c->jheads) | 617 | if (c->jheads) |
672 | for (i = 0; i < c->jhead_cnt; i++) | 618 | for (i = 0; i < c->jhead_cnt; i++) |
673 | printk(KERN_ERR "\tjhead %s\t LEB %d\n", | 619 | pr_err("\tjhead %s\t LEB %d\n", |
674 | dbg_jhead(c->jheads[i].wbuf.jhead), | 620 | dbg_jhead(c->jheads[i].wbuf.jhead), |
675 | c->jheads[i].wbuf.lnum); | 621 | c->jheads[i].wbuf.lnum); |
676 | for (rb = rb_first(&c->buds); rb; rb = rb_next(rb)) { | 622 | for (rb = rb_first(&c->buds); rb; rb = rb_next(rb)) { |
677 | bud = rb_entry(rb, struct ubifs_bud, rb); | 623 | bud = rb_entry(rb, struct ubifs_bud, rb); |
678 | printk(KERN_ERR "\tbud LEB %d\n", bud->lnum); | 624 | pr_err("\tbud LEB %d\n", bud->lnum); |
679 | } | 625 | } |
680 | list_for_each_entry(bud, &c->old_buds, list) | 626 | list_for_each_entry(bud, &c->old_buds, list) |
681 | printk(KERN_ERR "\told bud LEB %d\n", bud->lnum); | 627 | pr_err("\told bud LEB %d\n", bud->lnum); |
682 | list_for_each_entry(idx_gc, &c->idx_gc, list) | 628 | list_for_each_entry(idx_gc, &c->idx_gc, list) |
683 | printk(KERN_ERR "\tGC'ed idx LEB %d unmap %d\n", | 629 | pr_err("\tGC'ed idx LEB %d unmap %d\n", |
684 | idx_gc->lnum, idx_gc->unmap); | 630 | idx_gc->lnum, idx_gc->unmap); |
685 | printk(KERN_ERR "\tcommit state %d\n", c->cmt_state); | 631 | pr_err("\tcommit state %d\n", c->cmt_state); |
686 | 632 | ||
687 | /* Print budgeting predictions */ | 633 | /* Print budgeting predictions */ |
688 | available = ubifs_calc_available(c, c->bi.min_idx_lebs); | 634 | available = ubifs_calc_available(c, c->bi.min_idx_lebs); |
689 | outstanding = c->bi.data_growth + c->bi.dd_growth; | 635 | outstanding = c->bi.data_growth + c->bi.dd_growth; |
690 | free = ubifs_get_free_space_nolock(c); | 636 | free = ubifs_get_free_space_nolock(c); |
691 | printk(KERN_ERR "Budgeting predictions:\n"); | 637 | pr_err("Budgeting predictions:\n"); |
692 | printk(KERN_ERR "\tavailable: %lld, outstanding %lld, free %lld\n", | 638 | pr_err("\tavailable: %lld, outstanding %lld, free %lld\n", |
693 | available, outstanding, free); | 639 | available, outstanding, free); |
694 | out_unlock: | 640 | out_unlock: |
695 | spin_unlock(&dbg_lock); | 641 | spin_unlock(&dbg_lock); |
@@ -709,19 +655,19 @@ void ubifs_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp) | |||
709 | dark = ubifs_calc_dark(c, spc); | 655 | dark = ubifs_calc_dark(c, spc); |
710 | 656 | ||
711 | if (lp->flags & LPROPS_INDEX) | 657 | if (lp->flags & LPROPS_INDEX) |
712 | printk(KERN_ERR "LEB %-7d free %-8d dirty %-8d used %-8d free + dirty %-8d flags %#x (", | 658 | pr_err("LEB %-7d free %-8d dirty %-8d used %-8d free + dirty %-8d flags %#x (", |
713 | lp->lnum, lp->free, lp->dirty, c->leb_size - spc, spc, | 659 | lp->lnum, lp->free, lp->dirty, c->leb_size - spc, spc, |
714 | lp->flags); | 660 | lp->flags); |
715 | else | 661 | else |
716 | printk(KERN_ERR "LEB %-7d free %-8d dirty %-8d used %-8d free + dirty %-8d dark %-4d dead %-4d nodes fit %-3d flags %#-4x (", | 662 | pr_err("LEB %-7d free %-8d dirty %-8d used %-8d free + dirty %-8d dark %-4d dead %-4d nodes fit %-3d flags %#-4x (", |
717 | lp->lnum, lp->free, lp->dirty, c->leb_size - spc, spc, | 663 | lp->lnum, lp->free, lp->dirty, c->leb_size - spc, spc, |
718 | dark, dead, (int)(spc / UBIFS_MAX_NODE_SZ), lp->flags); | 664 | dark, dead, (int)(spc / UBIFS_MAX_NODE_SZ), lp->flags); |
719 | 665 | ||
720 | if (lp->flags & LPROPS_TAKEN) { | 666 | if (lp->flags & LPROPS_TAKEN) { |
721 | if (lp->flags & LPROPS_INDEX) | 667 | if (lp->flags & LPROPS_INDEX) |
722 | printk(KERN_CONT "index, taken"); | 668 | pr_cont("index, taken"); |
723 | else | 669 | else |
724 | printk(KERN_CONT "taken"); | 670 | pr_cont("taken"); |
725 | } else { | 671 | } else { |
726 | const char *s; | 672 | const char *s; |
727 | 673 | ||
@@ -758,7 +704,7 @@ void ubifs_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp) | |||
758 | break; | 704 | break; |
759 | } | 705 | } |
760 | } | 706 | } |
761 | printk(KERN_CONT "%s", s); | 707 | pr_cont("%s", s); |
762 | } | 708 | } |
763 | 709 | ||
764 | for (rb = rb_first((struct rb_root *)&c->buds); rb; rb = rb_next(rb)) { | 710 | for (rb = rb_first((struct rb_root *)&c->buds); rb; rb = rb_next(rb)) { |
@@ -773,19 +719,18 @@ void ubifs_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp) | |||
773 | */ | 719 | */ |
774 | if (c->jheads && | 720 | if (c->jheads && |
775 | lp->lnum == c->jheads[i].wbuf.lnum) { | 721 | lp->lnum == c->jheads[i].wbuf.lnum) { |
776 | printk(KERN_CONT ", jhead %s", | 722 | pr_cont(", jhead %s", dbg_jhead(i)); |
777 | dbg_jhead(i)); | ||
778 | head = 1; | 723 | head = 1; |
779 | } | 724 | } |
780 | } | 725 | } |
781 | if (!head) | 726 | if (!head) |
782 | printk(KERN_CONT ", bud of jhead %s", | 727 | pr_cont(", bud of jhead %s", |
783 | dbg_jhead(bud->jhead)); | 728 | dbg_jhead(bud->jhead)); |
784 | } | 729 | } |
785 | } | 730 | } |
786 | if (lp->lnum == c->gc_lnum) | 731 | if (lp->lnum == c->gc_lnum) |
787 | printk(KERN_CONT ", GC LEB"); | 732 | pr_cont(", GC LEB"); |
788 | printk(KERN_CONT ")\n"); | 733 | pr_cont(")\n"); |
789 | } | 734 | } |
790 | 735 | ||
791 | void ubifs_dump_lprops(struct ubifs_info *c) | 736 | void ubifs_dump_lprops(struct ubifs_info *c) |
@@ -794,8 +739,7 @@ void ubifs_dump_lprops(struct ubifs_info *c) | |||
794 | struct ubifs_lprops lp; | 739 | struct ubifs_lprops lp; |
795 | struct ubifs_lp_stats lst; | 740 | struct ubifs_lp_stats lst; |
796 | 741 | ||
797 | printk(KERN_ERR "(pid %d) start dumping LEB properties\n", | 742 | pr_err("(pid %d) start dumping LEB properties\n", current->pid); |
798 | current->pid); | ||
799 | ubifs_get_lp_stats(c, &lst); | 743 | ubifs_get_lp_stats(c, &lst); |
800 | ubifs_dump_lstats(&lst); | 744 | ubifs_dump_lstats(&lst); |
801 | 745 | ||
@@ -806,8 +750,7 @@ void ubifs_dump_lprops(struct ubifs_info *c) | |||
806 | 750 | ||
807 | ubifs_dump_lprop(c, &lp); | 751 | ubifs_dump_lprop(c, &lp); |
808 | } | 752 | } |
809 | printk(KERN_ERR "(pid %d) finish dumping LEB properties\n", | 753 | pr_err("(pid %d) finish dumping LEB properties\n", current->pid); |
810 | current->pid); | ||
811 | } | 754 | } |
812 | 755 | ||
813 | void ubifs_dump_lpt_info(struct ubifs_info *c) | 756 | void ubifs_dump_lpt_info(struct ubifs_info *c) |
@@ -815,35 +758,34 @@ void ubifs_dump_lpt_info(struct ubifs_info *c) | |||
815 | int i; | 758 | int i; |
816 | 759 | ||
817 | spin_lock(&dbg_lock); | 760 | spin_lock(&dbg_lock); |
818 | printk(KERN_ERR "(pid %d) dumping LPT information\n", current->pid); | 761 | pr_err("(pid %d) dumping LPT information\n", current->pid); |
819 | printk(KERN_ERR "\tlpt_sz: %lld\n", c->lpt_sz); | 762 | pr_err("\tlpt_sz: %lld\n", c->lpt_sz); |
820 | printk(KERN_ERR "\tpnode_sz: %d\n", c->pnode_sz); | 763 | pr_err("\tpnode_sz: %d\n", c->pnode_sz); |
821 | printk(KERN_ERR "\tnnode_sz: %d\n", c->nnode_sz); | 764 | pr_err("\tnnode_sz: %d\n", c->nnode_sz); |
822 | printk(KERN_ERR "\tltab_sz: %d\n", c->ltab_sz); | 765 | pr_err("\tltab_sz: %d\n", c->ltab_sz); |
823 | printk(KERN_ERR "\tlsave_sz: %d\n", c->lsave_sz); | 766 | pr_err("\tlsave_sz: %d\n", c->lsave_sz); |
824 | printk(KERN_ERR "\tbig_lpt: %d\n", c->big_lpt); | 767 | pr_err("\tbig_lpt: %d\n", c->big_lpt); |
825 | printk(KERN_ERR "\tlpt_hght: %d\n", c->lpt_hght); | 768 | pr_err("\tlpt_hght: %d\n", c->lpt_hght); |
826 | printk(KERN_ERR "\tpnode_cnt: %d\n", c->pnode_cnt); | 769 | pr_err("\tpnode_cnt: %d\n", c->pnode_cnt); |
827 | printk(KERN_ERR "\tnnode_cnt: %d\n", c->nnode_cnt); | 770 | pr_err("\tnnode_cnt: %d\n", c->nnode_cnt); |
828 | printk(KERN_ERR "\tdirty_pn_cnt: %d\n", c->dirty_pn_cnt); | 771 | pr_err("\tdirty_pn_cnt: %d\n", c->dirty_pn_cnt); |
829 | printk(KERN_ERR "\tdirty_nn_cnt: %d\n", c->dirty_nn_cnt); | 772 | pr_err("\tdirty_nn_cnt: %d\n", c->dirty_nn_cnt); |
830 | printk(KERN_ERR "\tlsave_cnt: %d\n", c->lsave_cnt); | 773 | pr_err("\tlsave_cnt: %d\n", c->lsave_cnt); |
831 | printk(KERN_ERR "\tspace_bits: %d\n", c->space_bits); | 774 | pr_err("\tspace_bits: %d\n", c->space_bits); |
832 | printk(KERN_ERR "\tlpt_lnum_bits: %d\n", c->lpt_lnum_bits); | 775 | pr_err("\tlpt_lnum_bits: %d\n", c->lpt_lnum_bits); |
833 | printk(KERN_ERR "\tlpt_offs_bits: %d\n", c->lpt_offs_bits); | 776 | pr_err("\tlpt_offs_bits: %d\n", c->lpt_offs_bits); |
834 | printk(KERN_ERR "\tlpt_spc_bits: %d\n", c->lpt_spc_bits); | 777 | pr_err("\tlpt_spc_bits: %d\n", c->lpt_spc_bits); |
835 | printk(KERN_ERR "\tpcnt_bits: %d\n", c->pcnt_bits); | 778 | pr_err("\tpcnt_bits: %d\n", c->pcnt_bits); |
836 | printk(KERN_ERR "\tlnum_bits: %d\n", c->lnum_bits); | 779 | pr_err("\tlnum_bits: %d\n", c->lnum_bits); |
837 | printk(KERN_ERR "\tLPT root is at %d:%d\n", c->lpt_lnum, c->lpt_offs); | 780 | pr_err("\tLPT root is at %d:%d\n", c->lpt_lnum, c->lpt_offs); |
838 | printk(KERN_ERR "\tLPT head is at %d:%d\n", | 781 | pr_err("\tLPT head is at %d:%d\n", |
839 | c->nhead_lnum, c->nhead_offs); | 782 | c->nhead_lnum, c->nhead_offs); |
840 | printk(KERN_ERR "\tLPT ltab is at %d:%d\n", | 783 | pr_err("\tLPT ltab is at %d:%d\n", c->ltab_lnum, c->ltab_offs); |
841 | c->ltab_lnum, c->ltab_offs); | ||
842 | if (c->big_lpt) | 784 | if (c->big_lpt) |
843 | printk(KERN_ERR "\tLPT lsave is at %d:%d\n", | 785 | pr_err("\tLPT lsave is at %d:%d\n", |
844 | c->lsave_lnum, c->lsave_offs); | 786 | c->lsave_lnum, c->lsave_offs); |
845 | for (i = 0; i < c->lpt_lebs; i++) | 787 | for (i = 0; i < c->lpt_lebs; i++) |
846 | printk(KERN_ERR "\tLPT LEB %d free %d dirty %d tgc %d cmt %d\n", | 788 | pr_err("\tLPT LEB %d free %d dirty %d tgc %d cmt %d\n", |
847 | i + c->lpt_first, c->ltab[i].free, c->ltab[i].dirty, | 789 | i + c->lpt_first, c->ltab[i].free, c->ltab[i].dirty, |
848 | c->ltab[i].tgc, c->ltab[i].cmt); | 790 | c->ltab[i].tgc, c->ltab[i].cmt); |
849 | spin_unlock(&dbg_lock); | 791 | spin_unlock(&dbg_lock); |
@@ -854,12 +796,12 @@ void ubifs_dump_sleb(const struct ubifs_info *c, | |||
854 | { | 796 | { |
855 | struct ubifs_scan_node *snod; | 797 | struct ubifs_scan_node *snod; |
856 | 798 | ||
857 | printk(KERN_ERR "(pid %d) start dumping scanned data from LEB %d:%d\n", | 799 | pr_err("(pid %d) start dumping scanned data from LEB %d:%d\n", |
858 | current->pid, sleb->lnum, offs); | 800 | current->pid, sleb->lnum, offs); |
859 | 801 | ||
860 | list_for_each_entry(snod, &sleb->nodes, list) { | 802 | list_for_each_entry(snod, &sleb->nodes, list) { |
861 | cond_resched(); | 803 | cond_resched(); |
862 | printk(KERN_ERR "Dumping node at LEB %d:%d len %d\n", | 804 | pr_err("Dumping node at LEB %d:%d len %d\n", |
863 | sleb->lnum, snod->offs, snod->len); | 805 | sleb->lnum, snod->offs, snod->len); |
864 | ubifs_dump_node(c, snod->node); | 806 | ubifs_dump_node(c, snod->node); |
865 | } | 807 | } |
@@ -871,8 +813,7 @@ void ubifs_dump_leb(const struct ubifs_info *c, int lnum) | |||
871 | struct ubifs_scan_node *snod; | 813 | struct ubifs_scan_node *snod; |
872 | void *buf; | 814 | void *buf; |
873 | 815 | ||
874 | printk(KERN_ERR "(pid %d) start dumping LEB %d\n", | 816 | pr_err("(pid %d) start dumping LEB %d\n", current->pid, lnum); |
875 | current->pid, lnum); | ||
876 | 817 | ||
877 | buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); | 818 | buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
878 | if (!buf) { | 819 | if (!buf) { |
@@ -886,18 +827,17 @@ void ubifs_dump_leb(const struct ubifs_info *c, int lnum) | |||
886 | goto out; | 827 | goto out; |
887 | } | 828 | } |
888 | 829 | ||
889 | printk(KERN_ERR "LEB %d has %d nodes ending at %d\n", lnum, | 830 | pr_err("LEB %d has %d nodes ending at %d\n", lnum, |
890 | sleb->nodes_cnt, sleb->endpt); | 831 | sleb->nodes_cnt, sleb->endpt); |
891 | 832 | ||
892 | list_for_each_entry(snod, &sleb->nodes, list) { | 833 | list_for_each_entry(snod, &sleb->nodes, list) { |
893 | cond_resched(); | 834 | cond_resched(); |
894 | printk(KERN_ERR "Dumping node at LEB %d:%d len %d\n", lnum, | 835 | pr_err("Dumping node at LEB %d:%d len %d\n", lnum, |
895 | snod->offs, snod->len); | 836 | snod->offs, snod->len); |
896 | ubifs_dump_node(c, snod->node); | 837 | ubifs_dump_node(c, snod->node); |
897 | } | 838 | } |
898 | 839 | ||
899 | printk(KERN_ERR "(pid %d) finish dumping LEB %d\n", | 840 | pr_err("(pid %d) finish dumping LEB %d\n", current->pid, lnum); |
900 | current->pid, lnum); | ||
901 | ubifs_scan_destroy(sleb); | 841 | ubifs_scan_destroy(sleb); |
902 | 842 | ||
903 | out: | 843 | out: |
@@ -918,7 +858,7 @@ void ubifs_dump_znode(const struct ubifs_info *c, | |||
918 | else | 858 | else |
919 | zbr = &c->zroot; | 859 | zbr = &c->zroot; |
920 | 860 | ||
921 | printk(KERN_ERR "znode %p, LEB %d:%d len %d parent %p iip %d level %d child_cnt %d flags %lx\n", | 861 | pr_err("znode %p, LEB %d:%d len %d parent %p iip %d level %d child_cnt %d flags %lx\n", |
922 | znode, zbr->lnum, zbr->offs, zbr->len, znode->parent, znode->iip, | 862 | znode, zbr->lnum, zbr->offs, zbr->len, znode->parent, znode->iip, |
923 | znode->level, znode->child_cnt, znode->flags); | 863 | znode->level, znode->child_cnt, znode->flags); |
924 | 864 | ||
@@ -927,16 +867,16 @@ void ubifs_dump_znode(const struct ubifs_info *c, | |||
927 | return; | 867 | return; |
928 | } | 868 | } |
929 | 869 | ||
930 | printk(KERN_ERR "zbranches:\n"); | 870 | pr_err("zbranches:\n"); |
931 | for (n = 0; n < znode->child_cnt; n++) { | 871 | for (n = 0; n < znode->child_cnt; n++) { |
932 | zbr = &znode->zbranch[n]; | 872 | zbr = &znode->zbranch[n]; |
933 | if (znode->level > 0) | 873 | if (znode->level > 0) |
934 | printk(KERN_ERR "\t%d: znode %p LEB %d:%d len %d key %s\n", | 874 | pr_err("\t%d: znode %p LEB %d:%d len %d key %s\n", |
935 | n, zbr->znode, zbr->lnum, zbr->offs, zbr->len, | 875 | n, zbr->znode, zbr->lnum, zbr->offs, zbr->len, |
936 | dbg_snprintf_key(c, &zbr->key, key_buf, | 876 | dbg_snprintf_key(c, &zbr->key, key_buf, |
937 | DBG_KEY_BUF_LEN)); | 877 | DBG_KEY_BUF_LEN)); |
938 | else | 878 | else |
939 | printk(KERN_ERR "\t%d: LNC %p LEB %d:%d len %d key %s\n", | 879 | pr_err("\t%d: LNC %p LEB %d:%d len %d key %s\n", |
940 | n, zbr->znode, zbr->lnum, zbr->offs, zbr->len, | 880 | n, zbr->znode, zbr->lnum, zbr->offs, zbr->len, |
941 | dbg_snprintf_key(c, &zbr->key, key_buf, | 881 | dbg_snprintf_key(c, &zbr->key, key_buf, |
942 | DBG_KEY_BUF_LEN)); | 882 | DBG_KEY_BUF_LEN)); |
@@ -948,16 +888,16 @@ void ubifs_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat) | |||
948 | { | 888 | { |
949 | int i; | 889 | int i; |
950 | 890 | ||
951 | printk(KERN_ERR "(pid %d) start dumping heap cat %d (%d elements)\n", | 891 | pr_err("(pid %d) start dumping heap cat %d (%d elements)\n", |
952 | current->pid, cat, heap->cnt); | 892 | current->pid, cat, heap->cnt); |
953 | for (i = 0; i < heap->cnt; i++) { | 893 | for (i = 0; i < heap->cnt; i++) { |
954 | struct ubifs_lprops *lprops = heap->arr[i]; | 894 | struct ubifs_lprops *lprops = heap->arr[i]; |
955 | 895 | ||
956 | printk(KERN_ERR "\t%d. LEB %d hpos %d free %d dirty %d flags %d\n", | 896 | pr_err("\t%d. LEB %d hpos %d free %d dirty %d flags %d\n", |
957 | i, lprops->lnum, lprops->hpos, lprops->free, | 897 | i, lprops->lnum, lprops->hpos, lprops->free, |
958 | lprops->dirty, lprops->flags); | 898 | lprops->dirty, lprops->flags); |
959 | } | 899 | } |
960 | printk(KERN_ERR "(pid %d) finish dumping heap\n", current->pid); | 900 | pr_err("(pid %d) finish dumping heap\n", current->pid); |
961 | } | 901 | } |
962 | 902 | ||
963 | void ubifs_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | 903 | void ubifs_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, |
@@ -965,15 +905,15 @@ void ubifs_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | |||
965 | { | 905 | { |
966 | int i; | 906 | int i; |
967 | 907 | ||
968 | printk(KERN_ERR "(pid %d) dumping pnode:\n", current->pid); | 908 | pr_err("(pid %d) dumping pnode:\n", current->pid); |
969 | printk(KERN_ERR "\taddress %zx parent %zx cnext %zx\n", | 909 | pr_err("\taddress %zx parent %zx cnext %zx\n", |
970 | (size_t)pnode, (size_t)parent, (size_t)pnode->cnext); | 910 | (size_t)pnode, (size_t)parent, (size_t)pnode->cnext); |
971 | printk(KERN_ERR "\tflags %lu iip %d level %d num %d\n", | 911 | pr_err("\tflags %lu iip %d level %d num %d\n", |
972 | pnode->flags, iip, pnode->level, pnode->num); | 912 | pnode->flags, iip, pnode->level, pnode->num); |
973 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { | 913 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { |
974 | struct ubifs_lprops *lp = &pnode->lprops[i]; | 914 | struct ubifs_lprops *lp = &pnode->lprops[i]; |
975 | 915 | ||
976 | printk(KERN_ERR "\t%d: free %d dirty %d flags %d lnum %d\n", | 916 | pr_err("\t%d: free %d dirty %d flags %d lnum %d\n", |
977 | i, lp->free, lp->dirty, lp->flags, lp->lnum); | 917 | i, lp->free, lp->dirty, lp->flags, lp->lnum); |
978 | } | 918 | } |
979 | } | 919 | } |
@@ -983,20 +923,20 @@ void ubifs_dump_tnc(struct ubifs_info *c) | |||
983 | struct ubifs_znode *znode; | 923 | struct ubifs_znode *znode; |
984 | int level; | 924 | int level; |
985 | 925 | ||
986 | printk(KERN_ERR "\n"); | 926 | pr_err("\n"); |
987 | printk(KERN_ERR "(pid %d) start dumping TNC tree\n", current->pid); | 927 | pr_err("(pid %d) start dumping TNC tree\n", current->pid); |
988 | znode = ubifs_tnc_levelorder_next(c->zroot.znode, NULL); | 928 | znode = ubifs_tnc_levelorder_next(c->zroot.znode, NULL); |
989 | level = znode->level; | 929 | level = znode->level; |
990 | printk(KERN_ERR "== Level %d ==\n", level); | 930 | pr_err("== Level %d ==\n", level); |
991 | while (znode) { | 931 | while (znode) { |
992 | if (level != znode->level) { | 932 | if (level != znode->level) { |
993 | level = znode->level; | 933 | level = znode->level; |
994 | printk(KERN_ERR "== Level %d ==\n", level); | 934 | pr_err("== Level %d ==\n", level); |
995 | } | 935 | } |
996 | ubifs_dump_znode(c, znode); | 936 | ubifs_dump_znode(c, znode); |
997 | znode = ubifs_tnc_levelorder_next(c->zroot.znode, znode); | 937 | znode = ubifs_tnc_levelorder_next(c->zroot.znode, znode); |
998 | } | 938 | } |
999 | printk(KERN_ERR "(pid %d) finish dumping TNC tree\n", current->pid); | 939 | pr_err("(pid %d) finish dumping TNC tree\n", current->pid); |
1000 | } | 940 | } |
1001 | 941 | ||
1002 | static int dump_znode(struct ubifs_info *c, struct ubifs_znode *znode, | 942 | static int dump_znode(struct ubifs_info *c, struct ubifs_znode *znode, |
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index 46b8dd123585..38230b1e544e 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h | |||
@@ -150,7 +150,7 @@ struct ubifs_global_debug_info { | |||
150 | 150 | ||
151 | #define ubifs_assert(expr) do { \ | 151 | #define ubifs_assert(expr) do { \ |
152 | if (unlikely(!(expr))) { \ | 152 | if (unlikely(!(expr))) { \ |
153 | printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \ | 153 | pr_crit("UBIFS assert failed in %s at %u (pid %d)\n", \ |
154 | __func__, __LINE__, current->pid); \ | 154 | __func__, __LINE__, current->pid); \ |
155 | dump_stack(); \ | 155 | dump_stack(); \ |
156 | } \ | 156 | } \ |
@@ -159,7 +159,7 @@ struct ubifs_global_debug_info { | |||
159 | #define ubifs_assert_cmt_locked(c) do { \ | 159 | #define ubifs_assert_cmt_locked(c) do { \ |
160 | if (unlikely(down_write_trylock(&(c)->commit_sem))) { \ | 160 | if (unlikely(down_write_trylock(&(c)->commit_sem))) { \ |
161 | up_write(&(c)->commit_sem); \ | 161 | up_write(&(c)->commit_sem); \ |
162 | printk(KERN_CRIT "commit lock is not locked!\n"); \ | 162 | pr_crit("commit lock is not locked!\n"); \ |
163 | ubifs_assert(0); \ | 163 | ubifs_assert(0); \ |
164 | } \ | 164 | } \ |
165 | } while (0) | 165 | } while (0) |
@@ -178,7 +178,7 @@ struct ubifs_global_debug_info { | |||
178 | 178 | ||
179 | /* Just a debugging messages not related to any specific UBIFS subsystem */ | 179 | /* Just a debugging messages not related to any specific UBIFS subsystem */ |
180 | #define dbg_msg(fmt, ...) \ | 180 | #define dbg_msg(fmt, ...) \ |
181 | printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", current->pid, \ | 181 | pr_err("UBIFS DBG (pid %d): %s: " fmt "\n", current->pid, \ |
182 | __func__, ##__VA_ARGS__) | 182 | __func__, ##__VA_ARGS__) |
183 | 183 | ||
184 | /* General messages */ | 184 | /* General messages */ |
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 74082553e1fc..a1de3cf9dba2 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -1886,8 +1886,7 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) | |||
1886 | int err, len = c->leb_size, node_type, node_num, node_len, offs; | 1886 | int err, len = c->leb_size, node_type, node_num, node_len, offs; |
1887 | void *buf, *p; | 1887 | void *buf, *p; |
1888 | 1888 | ||
1889 | printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n", | 1889 | pr_err("(pid %d) start dumping LEB %d\n", current->pid, lnum); |
1890 | current->pid, lnum); | ||
1891 | buf = p = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); | 1890 | buf = p = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
1892 | if (!buf) { | 1891 | if (!buf) { |
1893 | ubifs_err("cannot allocate memory to dump LPT"); | 1892 | ubifs_err("cannot allocate memory to dump LPT"); |
@@ -1905,14 +1904,14 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) | |||
1905 | 1904 | ||
1906 | pad_len = get_pad_len(c, p, len); | 1905 | pad_len = get_pad_len(c, p, len); |
1907 | if (pad_len) { | 1906 | if (pad_len) { |
1908 | printk(KERN_DEBUG "LEB %d:%d, pad %d bytes\n", | 1907 | pr_err("LEB %d:%d, pad %d bytes\n", |
1909 | lnum, offs, pad_len); | 1908 | lnum, offs, pad_len); |
1910 | p += pad_len; | 1909 | p += pad_len; |
1911 | len -= pad_len; | 1910 | len -= pad_len; |
1912 | continue; | 1911 | continue; |
1913 | } | 1912 | } |
1914 | if (len) | 1913 | if (len) |
1915 | printk(KERN_DEBUG "LEB %d:%d, free %d bytes\n", | 1914 | pr_err("LEB %d:%d, free %d bytes\n", |
1916 | lnum, offs, len); | 1915 | lnum, offs, len); |
1917 | break; | 1916 | break; |
1918 | } | 1917 | } |
@@ -1923,11 +1922,10 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) | |||
1923 | { | 1922 | { |
1924 | node_len = c->pnode_sz; | 1923 | node_len = c->pnode_sz; |
1925 | if (c->big_lpt) | 1924 | if (c->big_lpt) |
1926 | printk(KERN_DEBUG "LEB %d:%d, pnode num %d\n", | 1925 | pr_err("LEB %d:%d, pnode num %d\n", |
1927 | lnum, offs, node_num); | 1926 | lnum, offs, node_num); |
1928 | else | 1927 | else |
1929 | printk(KERN_DEBUG "LEB %d:%d, pnode\n", | 1928 | pr_err("LEB %d:%d, pnode\n", lnum, offs); |
1930 | lnum, offs); | ||
1931 | break; | 1929 | break; |
1932 | } | 1930 | } |
1933 | case UBIFS_LPT_NNODE: | 1931 | case UBIFS_LPT_NNODE: |
@@ -1937,29 +1935,28 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) | |||
1937 | 1935 | ||
1938 | node_len = c->nnode_sz; | 1936 | node_len = c->nnode_sz; |
1939 | if (c->big_lpt) | 1937 | if (c->big_lpt) |
1940 | printk(KERN_DEBUG "LEB %d:%d, nnode num %d, ", | 1938 | pr_err("LEB %d:%d, nnode num %d, ", |
1941 | lnum, offs, node_num); | 1939 | lnum, offs, node_num); |
1942 | else | 1940 | else |
1943 | printk(KERN_DEBUG "LEB %d:%d, nnode, ", | 1941 | pr_err("LEB %d:%d, nnode, ", |
1944 | lnum, offs); | 1942 | lnum, offs); |
1945 | err = ubifs_unpack_nnode(c, p, &nnode); | 1943 | err = ubifs_unpack_nnode(c, p, &nnode); |
1946 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { | 1944 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { |
1947 | printk(KERN_CONT "%d:%d", nnode.nbranch[i].lnum, | 1945 | pr_cont("%d:%d", nnode.nbranch[i].lnum, |
1948 | nnode.nbranch[i].offs); | 1946 | nnode.nbranch[i].offs); |
1949 | if (i != UBIFS_LPT_FANOUT - 1) | 1947 | if (i != UBIFS_LPT_FANOUT - 1) |
1950 | printk(KERN_CONT ", "); | 1948 | pr_cont(", "); |
1951 | } | 1949 | } |
1952 | printk(KERN_CONT "\n"); | 1950 | pr_cont("\n"); |
1953 | break; | 1951 | break; |
1954 | } | 1952 | } |
1955 | case UBIFS_LPT_LTAB: | 1953 | case UBIFS_LPT_LTAB: |
1956 | node_len = c->ltab_sz; | 1954 | node_len = c->ltab_sz; |
1957 | printk(KERN_DEBUG "LEB %d:%d, ltab\n", | 1955 | pr_err("LEB %d:%d, ltab\n", lnum, offs); |
1958 | lnum, offs); | ||
1959 | break; | 1956 | break; |
1960 | case UBIFS_LPT_LSAVE: | 1957 | case UBIFS_LPT_LSAVE: |
1961 | node_len = c->lsave_sz; | 1958 | node_len = c->lsave_sz; |
1962 | printk(KERN_DEBUG "LEB %d:%d, lsave len\n", lnum, offs); | 1959 | pr_err("LEB %d:%d, lsave len\n", lnum, offs); |
1963 | break; | 1960 | break; |
1964 | default: | 1961 | default: |
1965 | ubifs_err("LPT node type %d not recognized", node_type); | 1962 | ubifs_err("LPT node type %d not recognized", node_type); |
@@ -1970,8 +1967,7 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) | |||
1970 | len -= node_len; | 1967 | len -= node_len; |
1971 | } | 1968 | } |
1972 | 1969 | ||
1973 | printk(KERN_DEBUG "(pid %d) finish dumping LEB %d\n", | 1970 | pr_err("(pid %d) finish dumping LEB %d\n", current->pid, lnum); |
1974 | current->pid, lnum); | ||
1975 | out: | 1971 | out: |
1976 | vfree(buf); | 1972 | vfree(buf); |
1977 | return; | 1973 | return; |
@@ -1988,12 +1984,10 @@ void ubifs_dump_lpt_lebs(const struct ubifs_info *c) | |||
1988 | { | 1984 | { |
1989 | int i; | 1985 | int i; |
1990 | 1986 | ||
1991 | printk(KERN_DEBUG "(pid %d) start dumping all LPT LEBs\n", | 1987 | pr_err("(pid %d) start dumping all LPT LEBs\n", current->pid); |
1992 | current->pid); | ||
1993 | for (i = 0; i < c->lpt_lebs; i++) | 1988 | for (i = 0; i < c->lpt_lebs; i++) |
1994 | dump_lpt_leb(c, i + c->lpt_first); | 1989 | dump_lpt_leb(c, i + c->lpt_first); |
1995 | printk(KERN_DEBUG "(pid %d) finish dumping all LPT LEBs\n", | 1990 | pr_err("(pid %d) finish dumping all LPT LEBs\n", current->pid); |
1996 | current->pid); | ||
1997 | } | 1991 | } |
1998 | 1992 | ||
1999 | /** | 1993 | /** |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 1e5a08623d11..e6a9275fadb0 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -42,16 +42,15 @@ | |||
42 | #define UBIFS_VERSION 1 | 42 | #define UBIFS_VERSION 1 |
43 | 43 | ||
44 | /* Normal UBIFS messages */ | 44 | /* Normal UBIFS messages */ |
45 | #define ubifs_msg(fmt, ...) \ | 45 | #define ubifs_msg(fmt, ...) pr_notice("UBIFS: " fmt "\n", ##__VA_ARGS__) |
46 | printk(KERN_NOTICE "UBIFS: " fmt "\n", ##__VA_ARGS__) | ||
47 | /* UBIFS error messages */ | 46 | /* UBIFS error messages */ |
48 | #define ubifs_err(fmt, ...) \ | 47 | #define ubifs_err(fmt, ...) \ |
49 | printk(KERN_ERR "UBIFS error (pid %d): %s: " fmt "\n", current->pid, \ | 48 | pr_err("UBIFS error (pid %d): %s: " fmt "\n", current->pid, \ |
50 | __func__, ##__VA_ARGS__) | 49 | __func__, ##__VA_ARGS__) |
51 | /* UBIFS warning messages */ | 50 | /* UBIFS warning messages */ |
52 | #define ubifs_warn(fmt, ...) \ | 51 | #define ubifs_warn(fmt, ...) \ |
53 | printk(KERN_WARNING "UBIFS warning (pid %d): %s: " fmt "\n", \ | 52 | pr_warn("UBIFS warning (pid %d): %s: " fmt "\n", \ |
54 | current->pid, __func__, ##__VA_ARGS__) | 53 | current->pid, __func__, ##__VA_ARGS__) |
55 | 54 | ||
56 | /* UBIFS file system VFS magic number */ | 55 | /* UBIFS file system VFS magic number */ |
57 | #define UBIFS_SUPER_MAGIC 0x24051905 | 56 | #define UBIFS_SUPER_MAGIC 0x24051905 |