diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:56:43 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:39:24 -0400 |
commit | 9c261b33a9c417ccaf07f41796be278d09d02d49 (patch) | |
tree | 6cf47f47364647dfbba845c0fd3f05539072175a /fs/jffs2/fs.c | |
parent | bf011f2ed53d587fdd8148c173c4f09ed77bdf1a (diff) |
jffs2: Convert most D1/D2 macros to jffs2_dbg
D1 and D2 macros are mostly uses to emit debugging messages.
Convert the logging uses of D1 & D2 to jffs2_dbg(level, fmt, ...)
to be a bit more consistent style with the rest of the kernel.
All jffs2_dbg output is now at KERN_DEBUG where some of
the previous uses were emitted at various KERN_<LEVEL>s.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/fs.c')
-rw-r--r-- | fs/jffs2/fs.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 2e0123867cb1..9a8c97c264c2 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -39,7 +39,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) | |||
39 | int ret; | 39 | int ret; |
40 | int alloc_type = ALLOC_NORMAL; | 40 | int alloc_type = ALLOC_NORMAL; |
41 | 41 | ||
42 | D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino)); | 42 | jffs2_dbg(1, "%s(): ino #%lu\n", __func__, inode->i_ino); |
43 | 43 | ||
44 | /* Special cases - we don't want more than one data node | 44 | /* Special cases - we don't want more than one data node |
45 | for these types on the medium at any time. So setattr | 45 | for these types on the medium at any time. So setattr |
@@ -50,7 +50,8 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) | |||
50 | /* For these, we don't actually need to read the old node */ | 50 | /* For these, we don't actually need to read the old node */ |
51 | mdatalen = jffs2_encode_dev(&dev, inode->i_rdev); | 51 | mdatalen = jffs2_encode_dev(&dev, inode->i_rdev); |
52 | mdata = (char *)&dev; | 52 | mdata = (char *)&dev; |
53 | D1(printk(KERN_DEBUG "jffs2_setattr(): Writing %d bytes of kdev_t\n", mdatalen)); | 53 | jffs2_dbg(1, "%s(): Writing %d bytes of kdev_t\n", |
54 | __func__, mdatalen); | ||
54 | } else if (S_ISLNK(inode->i_mode)) { | 55 | } else if (S_ISLNK(inode->i_mode)) { |
55 | mutex_lock(&f->sem); | 56 | mutex_lock(&f->sem); |
56 | mdatalen = f->metadata->size; | 57 | mdatalen = f->metadata->size; |
@@ -66,7 +67,8 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) | |||
66 | return ret; | 67 | return ret; |
67 | } | 68 | } |
68 | mutex_unlock(&f->sem); | 69 | mutex_unlock(&f->sem); |
69 | D1(printk(KERN_DEBUG "jffs2_setattr(): Writing %d bytes of symlink target\n", mdatalen)); | 70 | jffs2_dbg(1, "%s(): Writing %d bytes of symlink target\n", |
71 | __func__, mdatalen); | ||
70 | } | 72 | } |
71 | 73 | ||
72 | ri = jffs2_alloc_raw_inode(); | 74 | ri = jffs2_alloc_raw_inode(); |
@@ -233,7 +235,8 @@ void jffs2_evict_inode (struct inode *inode) | |||
233 | struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); | 235 | struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); |
234 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); | 236 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); |
235 | 237 | ||
236 | D1(printk(KERN_DEBUG "jffs2_evict_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode)); | 238 | jffs2_dbg(1, "%s(): ino #%lu mode %o\n", |
239 | __func__, inode->i_ino, inode->i_mode); | ||
237 | truncate_inode_pages(&inode->i_data, 0); | 240 | truncate_inode_pages(&inode->i_data, 0); |
238 | end_writeback(inode); | 241 | end_writeback(inode); |
239 | jffs2_do_clear_inode(c, f); | 242 | jffs2_do_clear_inode(c, f); |
@@ -249,7 +252,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) | |||
249 | dev_t rdev = 0; | 252 | dev_t rdev = 0; |
250 | int ret; | 253 | int ret; |
251 | 254 | ||
252 | D1(printk(KERN_DEBUG "jffs2_iget(): ino == %lu\n", ino)); | 255 | jffs2_dbg(1, "%s(): ino == %lu\n", __func__, ino); |
253 | 256 | ||
254 | inode = iget_locked(sb, ino); | 257 | inode = iget_locked(sb, ino); |
255 | if (!inode) | 258 | if (!inode) |
@@ -320,7 +323,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) | |||
320 | printk(KERN_NOTICE "Device node has strange size %d\n", f->metadata->size); | 323 | printk(KERN_NOTICE "Device node has strange size %d\n", f->metadata->size); |
321 | goto error_io; | 324 | goto error_io; |
322 | } | 325 | } |
323 | D1(printk(KERN_DEBUG "Reading device numbers from flash\n")); | 326 | jffs2_dbg(1, "Reading device numbers from flash\n"); |
324 | ret = jffs2_read_dnode(c, f, f->metadata, (char *)&jdev, 0, f->metadata->size); | 327 | ret = jffs2_read_dnode(c, f, f->metadata, (char *)&jdev, 0, f->metadata->size); |
325 | if (ret < 0) { | 328 | if (ret < 0) { |
326 | /* Eep */ | 329 | /* Eep */ |
@@ -344,7 +347,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) | |||
344 | 347 | ||
345 | mutex_unlock(&f->sem); | 348 | mutex_unlock(&f->sem); |
346 | 349 | ||
347 | D1(printk(KERN_DEBUG "jffs2_read_inode() returning\n")); | 350 | jffs2_dbg(1, "jffs2_read_inode() returning\n"); |
348 | unlock_new_inode(inode); | 351 | unlock_new_inode(inode); |
349 | return inode; | 352 | return inode; |
350 | 353 | ||
@@ -362,11 +365,13 @@ void jffs2_dirty_inode(struct inode *inode, int flags) | |||
362 | struct iattr iattr; | 365 | struct iattr iattr; |
363 | 366 | ||
364 | if (!(inode->i_state & I_DIRTY_DATASYNC)) { | 367 | if (!(inode->i_state & I_DIRTY_DATASYNC)) { |
365 | D2(printk(KERN_DEBUG "jffs2_dirty_inode() not calling setattr() for ino #%lu\n", inode->i_ino)); | 368 | jffs2_dbg(2, "%s(): not calling setattr() for ino #%lu\n", |
369 | __func__, inode->i_ino); | ||
366 | return; | 370 | return; |
367 | } | 371 | } |
368 | 372 | ||
369 | D1(printk(KERN_DEBUG "jffs2_dirty_inode() calling setattr() for ino #%lu\n", inode->i_ino)); | 373 | jffs2_dbg(1, "%s(): calling setattr() for ino #%lu\n", |
374 | __func__, inode->i_ino); | ||
370 | 375 | ||
371 | iattr.ia_valid = ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_MTIME|ATTR_CTIME; | 376 | iattr.ia_valid = ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_MTIME|ATTR_CTIME; |
372 | iattr.ia_mode = inode->i_mode; | 377 | iattr.ia_mode = inode->i_mode; |
@@ -414,7 +419,8 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r | |||
414 | struct jffs2_inode_info *f; | 419 | struct jffs2_inode_info *f; |
415 | int ret; | 420 | int ret; |
416 | 421 | ||
417 | D1(printk(KERN_DEBUG "jffs2_new_inode(): dir_i %ld, mode 0x%x\n", dir_i->i_ino, mode)); | 422 | jffs2_dbg(1, "%s(): dir_i %ld, mode 0x%x\n", |
423 | __func__, dir_i->i_ino, mode); | ||
418 | 424 | ||
419 | c = JFFS2_SB_INFO(sb); | 425 | c = JFFS2_SB_INFO(sb); |
420 | 426 | ||
@@ -550,17 +556,17 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) | |||
550 | if ((ret = jffs2_do_mount_fs(c))) | 556 | if ((ret = jffs2_do_mount_fs(c))) |
551 | goto out_inohash; | 557 | goto out_inohash; |
552 | 558 | ||
553 | D1(printk(KERN_DEBUG "jffs2_do_fill_super(): Getting root inode\n")); | 559 | jffs2_dbg(1, "%s(): Getting root inode\n", __func__); |
554 | root_i = jffs2_iget(sb, 1); | 560 | root_i = jffs2_iget(sb, 1); |
555 | if (IS_ERR(root_i)) { | 561 | if (IS_ERR(root_i)) { |
556 | D1(printk(KERN_WARNING "get root inode failed\n")); | 562 | jffs2_dbg(1, "get root inode failed\n"); |
557 | ret = PTR_ERR(root_i); | 563 | ret = PTR_ERR(root_i); |
558 | goto out_root; | 564 | goto out_root; |
559 | } | 565 | } |
560 | 566 | ||
561 | ret = -ENOMEM; | 567 | ret = -ENOMEM; |
562 | 568 | ||
563 | D1(printk(KERN_DEBUG "jffs2_do_fill_super(): d_alloc_root()\n")); | 569 | jffs2_dbg(1, "%s(): d_alloc_root()\n", __func__); |
564 | sb->s_root = d_alloc_root(root_i); | 570 | sb->s_root = d_alloc_root(root_i); |
565 | if (!sb->s_root) | 571 | if (!sb->s_root) |
566 | goto out_root_i; | 572 | goto out_root_i; |
@@ -620,20 +626,21 @@ struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, | |||
620 | */ | 626 | */ |
621 | inode = ilookup(OFNI_BS_2SFFJ(c), inum); | 627 | inode = ilookup(OFNI_BS_2SFFJ(c), inum); |
622 | if (!inode) { | 628 | if (!inode) { |
623 | D1(printk(KERN_DEBUG "ilookup() failed for ino #%u; inode is probably deleted.\n", | 629 | jffs2_dbg(1, "ilookup() failed for ino #%u; inode is probably deleted.\n", |
624 | inum)); | 630 | inum); |
625 | 631 | ||
626 | spin_lock(&c->inocache_lock); | 632 | spin_lock(&c->inocache_lock); |
627 | ic = jffs2_get_ino_cache(c, inum); | 633 | ic = jffs2_get_ino_cache(c, inum); |
628 | if (!ic) { | 634 | if (!ic) { |
629 | D1(printk(KERN_DEBUG "Inode cache for ino #%u is gone.\n", inum)); | 635 | jffs2_dbg(1, "Inode cache for ino #%u is gone\n", |
636 | inum); | ||
630 | spin_unlock(&c->inocache_lock); | 637 | spin_unlock(&c->inocache_lock); |
631 | return NULL; | 638 | return NULL; |
632 | } | 639 | } |
633 | if (ic->state != INO_STATE_CHECKEDABSENT) { | 640 | if (ic->state != INO_STATE_CHECKEDABSENT) { |
634 | /* Wait for progress. Don't just loop */ | 641 | /* Wait for progress. Don't just loop */ |
635 | D1(printk(KERN_DEBUG "Waiting for ino #%u in state %d\n", | 642 | jffs2_dbg(1, "Waiting for ino #%u in state %d\n", |
636 | ic->ino, ic->state)); | 643 | ic->ino, ic->state); |
637 | sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); | 644 | sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); |
638 | } else { | 645 | } else { |
639 | spin_unlock(&c->inocache_lock); | 646 | spin_unlock(&c->inocache_lock); |