btrfs: use printk_ratelimited instead of printk_ratelimit
As per printk_ratelimit comment, it should not be used. Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
182608c829
commit
7a36ddec10
|
@ -29,6 +29,7 @@
|
||||||
#include <linux/crc32c.h>
|
#include <linux/crc32c.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/migrate.h>
|
#include <linux/migrate.h>
|
||||||
|
#include <linux/ratelimit.h>
|
||||||
#include <asm/unaligned.h>
|
#include <asm/unaligned.h>
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "ctree.h"
|
#include "ctree.h"
|
||||||
|
@ -254,14 +255,12 @@ static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
|
||||||
memcpy(&found, result, csum_size);
|
memcpy(&found, result, csum_size);
|
||||||
|
|
||||||
read_extent_buffer(buf, &val, 0, csum_size);
|
read_extent_buffer(buf, &val, 0, csum_size);
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited(KERN_INFO "btrfs: %s checksum verify "
|
||||||
printk(KERN_INFO "btrfs: %s checksum verify "
|
|
||||||
"failed on %llu wanted %X found %X "
|
"failed on %llu wanted %X found %X "
|
||||||
"level %d\n",
|
"level %d\n",
|
||||||
root->fs_info->sb->s_id,
|
root->fs_info->sb->s_id,
|
||||||
(unsigned long long)buf->start, val, found,
|
(unsigned long long)buf->start, val, found,
|
||||||
btrfs_header_level(buf));
|
btrfs_header_level(buf));
|
||||||
}
|
|
||||||
if (result != (char *)&inline_result)
|
if (result != (char *)&inline_result)
|
||||||
kfree(result);
|
kfree(result);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -296,13 +295,11 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited("parent transid verify failed on %llu wanted %llu "
|
||||||
printk("parent transid verify failed on %llu wanted %llu "
|
|
||||||
"found %llu\n",
|
"found %llu\n",
|
||||||
(unsigned long long)eb->start,
|
(unsigned long long)eb->start,
|
||||||
(unsigned long long)parent_transid,
|
(unsigned long long)parent_transid,
|
||||||
(unsigned long long)btrfs_header_generation(eb));
|
(unsigned long long)btrfs_header_generation(eb));
|
||||||
}
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
clear_extent_buffer_uptodate(io_tree, eb, &cached_state);
|
clear_extent_buffer_uptodate(io_tree, eb, &cached_state);
|
||||||
out:
|
out:
|
||||||
|
@ -533,12 +530,10 @@ static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end,
|
||||||
|
|
||||||
found_start = btrfs_header_bytenr(eb);
|
found_start = btrfs_header_bytenr(eb);
|
||||||
if (found_start != start) {
|
if (found_start != start) {
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited(KERN_INFO "btrfs bad tree block start "
|
||||||
printk(KERN_INFO "btrfs bad tree block start "
|
|
||||||
"%llu %llu\n",
|
"%llu %llu\n",
|
||||||
(unsigned long long)found_start,
|
(unsigned long long)found_start,
|
||||||
(unsigned long long)eb->start);
|
(unsigned long long)eb->start);
|
||||||
}
|
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
@ -550,10 +545,8 @@ static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end,
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (check_tree_block_fsid(root, eb)) {
|
if (check_tree_block_fsid(root, eb)) {
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited(KERN_INFO "btrfs bad fsid on block %llu\n",
|
||||||
printk(KERN_INFO "btrfs bad fsid on block %llu\n",
|
|
||||||
(unsigned long long)eb->start);
|
(unsigned long long)eb->start);
|
||||||
}
|
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
@ -2108,11 +2101,9 @@ static void btrfs_end_buffer_write_sync(struct buffer_head *bh, int uptodate)
|
||||||
if (uptodate) {
|
if (uptodate) {
|
||||||
set_buffer_uptodate(bh);
|
set_buffer_uptodate(bh);
|
||||||
} else {
|
} else {
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited(KERN_WARNING "lost page write due to "
|
||||||
printk(KERN_WARNING "lost page write due to "
|
|
||||||
"I/O error on %s\n",
|
"I/O error on %s\n",
|
||||||
bdevname(bh->b_bdev, b));
|
bdevname(bh->b_bdev, b));
|
||||||
}
|
|
||||||
/* note, we dont' set_buffer_write_io_error because we have
|
/* note, we dont' set_buffer_write_io_error because we have
|
||||||
* our own ways of dealing with the IO errors
|
* our own ways of dealing with the IO errors
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <linux/posix_acl.h>
|
#include <linux/posix_acl.h>
|
||||||
#include <linux/falloc.h>
|
#include <linux/falloc.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/ratelimit.h>
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "ctree.h"
|
#include "ctree.h"
|
||||||
#include "disk-io.h"
|
#include "disk-io.h"
|
||||||
|
@ -2004,12 +2005,10 @@ good:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
zeroit:
|
zeroit:
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited(KERN_INFO "btrfs csum failed ino %lu off %llu csum %u "
|
||||||
printk(KERN_INFO "btrfs csum failed ino %lu off %llu csum %u "
|
|
||||||
"private %llu\n", page->mapping->host->i_ino,
|
"private %llu\n", page->mapping->host->i_ino,
|
||||||
(unsigned long long)start, csum,
|
(unsigned long long)start, csum,
|
||||||
(unsigned long long)private);
|
(unsigned long long)private);
|
||||||
}
|
|
||||||
memset(kaddr + offset, 1, end - start + 1);
|
memset(kaddr + offset, 1, end - start + 1);
|
||||||
flush_dcache_page(page);
|
flush_dcache_page(page);
|
||||||
kunmap_atomic(kaddr, KM_USER0);
|
kunmap_atomic(kaddr, KM_USER0);
|
||||||
|
@ -4243,24 +4242,20 @@ void btrfs_dirty_inode(struct inode *inode)
|
||||||
btrfs_end_transaction(trans, root);
|
btrfs_end_transaction(trans, root);
|
||||||
trans = btrfs_start_transaction(root, 1);
|
trans = btrfs_start_transaction(root, 1);
|
||||||
if (IS_ERR(trans)) {
|
if (IS_ERR(trans)) {
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited(KERN_ERR "btrfs: fail to "
|
||||||
printk(KERN_ERR "btrfs: fail to "
|
|
||||||
"dirty inode %lu error %ld\n",
|
"dirty inode %lu error %ld\n",
|
||||||
inode->i_ino, PTR_ERR(trans));
|
inode->i_ino, PTR_ERR(trans));
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btrfs_set_trans_block_group(trans, inode);
|
btrfs_set_trans_block_group(trans, inode);
|
||||||
|
|
||||||
ret = btrfs_update_inode(trans, root, inode);
|
ret = btrfs_update_inode(trans, root, inode);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (printk_ratelimit()) {
|
printk_ratelimited(KERN_ERR "btrfs: fail to "
|
||||||
printk(KERN_ERR "btrfs: fail to "
|
|
||||||
"dirty inode %lu error %d\n",
|
"dirty inode %lu error %d\n",
|
||||||
inode->i_ino, ret);
|
inode->i_ino, ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
btrfs_end_transaction(trans, root);
|
btrfs_end_transaction(trans, root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue