Commit b7bed712 authored by Ryusuke Konishi's avatar Ryusuke Konishi Committed by Linus Torvalds

nilfs2: use nilfs_warning() in allocator implementation

This uses nilfs_warning() to replace "printk(KERN_WARNING ...);" in the
bitmap based allocator implementation of nilfs2.  The warning messages are
modified to include the device name and the inode number in each message.
This makes it clear which metadata file of which device has output
warnings such as "entry number xxxx already freed".
Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent da80a39f
...@@ -583,8 +583,10 @@ void nilfs_palloc_commit_free_entry(struct inode *inode, ...@@ -583,8 +583,10 @@ void nilfs_palloc_commit_free_entry(struct inode *inode,
if (!nilfs_clear_bit_atomic(nilfs_mdt_bgl_lock(inode, group), if (!nilfs_clear_bit_atomic(nilfs_mdt_bgl_lock(inode, group),
group_offset, bitmap)) group_offset, bitmap))
printk(KERN_WARNING "%s: entry number %llu already freed\n", nilfs_warning(inode->i_sb, __func__,
__func__, (unsigned long long)req->pr_entry_nr); "entry number %llu already freed: ino=%lu\n",
(unsigned long long)req->pr_entry_nr,
(unsigned long)inode->i_ino);
else else
nilfs_palloc_group_desc_add_entries(inode, group, desc, 1); nilfs_palloc_group_desc_add_entries(inode, group, desc, 1);
...@@ -620,8 +622,10 @@ void nilfs_palloc_abort_alloc_entry(struct inode *inode, ...@@ -620,8 +622,10 @@ void nilfs_palloc_abort_alloc_entry(struct inode *inode,
bitmap = bitmap_kaddr + bh_offset(req->pr_bitmap_bh); bitmap = bitmap_kaddr + bh_offset(req->pr_bitmap_bh);
if (!nilfs_clear_bit_atomic(nilfs_mdt_bgl_lock(inode, group), if (!nilfs_clear_bit_atomic(nilfs_mdt_bgl_lock(inode, group),
group_offset, bitmap)) group_offset, bitmap))
printk(KERN_WARNING "%s: entry number %llu already freed\n", nilfs_warning(inode->i_sb, __func__,
__func__, (unsigned long long)req->pr_entry_nr); "entry number %llu already freed: ino=%lu\n",
(unsigned long long)req->pr_entry_nr,
(unsigned long)inode->i_ino);
else else
nilfs_palloc_group_desc_add_entries(inode, group, desc, 1); nilfs_palloc_group_desc_add_entries(inode, group, desc, 1);
...@@ -734,10 +738,10 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems) ...@@ -734,10 +738,10 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
if (!nilfs_clear_bit_atomic( if (!nilfs_clear_bit_atomic(
nilfs_mdt_bgl_lock(inode, group), nilfs_mdt_bgl_lock(inode, group),
group_offset, bitmap)) { group_offset, bitmap)) {
printk(KERN_WARNING nilfs_warning(inode->i_sb, __func__,
"%s: entry number %llu already freed\n", "entry number %llu already freed: ino=%lu\n",
__func__, (unsigned long long)entry_nrs[j],
(unsigned long long)entry_nrs[j]); (unsigned long)inode->i_ino);
} else { } else {
n++; n++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment