diff options
author | Frank Holton <fholton@gmail.com> | 2013-12-20 11:37:06 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-28 16:20:05 -0500 |
commit | efe120a067c8674a8ae21b194f0e68f098b61ee2 (patch) | |
tree | 1edb3b59b689a96ec15b548387c048ee959fb6fd /fs/btrfs/scrub.c | |
parent | 5de865eebb8330eee19c37b31fb6f315a09d4273 (diff) |
Btrfs: convert printk to btrfs_ and fix BTRFS prefix
Convert all applicable cases of printk and pr_* to the btrfs_* macros.
Fix all uses of the BTRFS prefix.
Signed-off-by: Frank Holton <fholton@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index adebe12e497e..7806e2c47f89 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -505,7 +505,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root, | |||
505 | * hold all of the paths here | 505 | * hold all of the paths here |
506 | */ | 506 | */ |
507 | for (i = 0; i < ipath->fspath->elem_cnt; ++i) | 507 | for (i = 0; i < ipath->fspath->elem_cnt; ++i) |
508 | printk_in_rcu(KERN_WARNING "btrfs: %s at logical %llu on dev " | 508 | printk_in_rcu(KERN_WARNING "BTRFS: %s at logical %llu on dev " |
509 | "%s, sector %llu, root %llu, inode %llu, offset %llu, " | 509 | "%s, sector %llu, root %llu, inode %llu, offset %llu, " |
510 | "length %llu, links %u (path: %s)\n", swarn->errstr, | 510 | "length %llu, links %u (path: %s)\n", swarn->errstr, |
511 | swarn->logical, rcu_str_deref(swarn->dev->name), | 511 | swarn->logical, rcu_str_deref(swarn->dev->name), |
@@ -517,7 +517,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root, | |||
517 | return 0; | 517 | return 0; |
518 | 518 | ||
519 | err: | 519 | err: |
520 | printk_in_rcu(KERN_WARNING "btrfs: %s at logical %llu on dev " | 520 | printk_in_rcu(KERN_WARNING "BTRFS: %s at logical %llu on dev " |
521 | "%s, sector %llu, root %llu, inode %llu, offset %llu: path " | 521 | "%s, sector %llu, root %llu, inode %llu, offset %llu: path " |
522 | "resolving failed with ret=%d\n", swarn->errstr, | 522 | "resolving failed with ret=%d\n", swarn->errstr, |
523 | swarn->logical, rcu_str_deref(swarn->dev->name), | 523 | swarn->logical, rcu_str_deref(swarn->dev->name), |
@@ -580,7 +580,7 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock) | |||
580 | ret = tree_backref_for_extent(&ptr, eb, ei, item_size, | 580 | ret = tree_backref_for_extent(&ptr, eb, ei, item_size, |
581 | &ref_root, &ref_level); | 581 | &ref_root, &ref_level); |
582 | printk_in_rcu(KERN_WARNING | 582 | printk_in_rcu(KERN_WARNING |
583 | "btrfs: %s at logical %llu on dev %s, " | 583 | "BTRFS: %s at logical %llu on dev %s, " |
584 | "sector %llu: metadata %s (level %d) in tree " | 584 | "sector %llu: metadata %s (level %d) in tree " |
585 | "%llu\n", errstr, swarn.logical, | 585 | "%llu\n", errstr, swarn.logical, |
586 | rcu_str_deref(dev->name), | 586 | rcu_str_deref(dev->name), |
@@ -782,8 +782,8 @@ out: | |||
782 | btrfs_dev_replace_stats_inc( | 782 | btrfs_dev_replace_stats_inc( |
783 | &sctx->dev_root->fs_info->dev_replace. | 783 | &sctx->dev_root->fs_info->dev_replace. |
784 | num_uncorrectable_read_errors); | 784 | num_uncorrectable_read_errors); |
785 | printk_ratelimited_in_rcu(KERN_ERR | 785 | printk_ratelimited_in_rcu(KERN_ERR "BTRFS: " |
786 | "btrfs: unable to fixup (nodatasum) error at logical %llu on dev %s\n", | 786 | "unable to fixup (nodatasum) error at logical %llu on dev %s\n", |
787 | fixup->logical, rcu_str_deref(fixup->dev->name)); | 787 | fixup->logical, rcu_str_deref(fixup->dev->name)); |
788 | } | 788 | } |
789 | 789 | ||
@@ -1184,7 +1184,7 @@ corrected_error: | |||
1184 | sctx->stat.corrected_errors++; | 1184 | sctx->stat.corrected_errors++; |
1185 | spin_unlock(&sctx->stat_lock); | 1185 | spin_unlock(&sctx->stat_lock); |
1186 | printk_ratelimited_in_rcu(KERN_ERR | 1186 | printk_ratelimited_in_rcu(KERN_ERR |
1187 | "btrfs: fixed up error at logical %llu on dev %s\n", | 1187 | "BTRFS: fixed up error at logical %llu on dev %s\n", |
1188 | logical, rcu_str_deref(dev->name)); | 1188 | logical, rcu_str_deref(dev->name)); |
1189 | } | 1189 | } |
1190 | } else { | 1190 | } else { |
@@ -1193,7 +1193,7 @@ did_not_correct_error: | |||
1193 | sctx->stat.uncorrectable_errors++; | 1193 | sctx->stat.uncorrectable_errors++; |
1194 | spin_unlock(&sctx->stat_lock); | 1194 | spin_unlock(&sctx->stat_lock); |
1195 | printk_ratelimited_in_rcu(KERN_ERR | 1195 | printk_ratelimited_in_rcu(KERN_ERR |
1196 | "btrfs: unable to fixup (regular) error at logical %llu on dev %s\n", | 1196 | "BTRFS: unable to fixup (regular) error at logical %llu on dev %s\n", |
1197 | logical, rcu_str_deref(dev->name)); | 1197 | logical, rcu_str_deref(dev->name)); |
1198 | } | 1198 | } |
1199 | 1199 | ||
@@ -1441,8 +1441,9 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, | |||
1441 | int ret; | 1441 | int ret; |
1442 | 1442 | ||
1443 | if (!page_bad->dev->bdev) { | 1443 | if (!page_bad->dev->bdev) { |
1444 | printk_ratelimited(KERN_WARNING | 1444 | printk_ratelimited(KERN_WARNING "BTRFS: " |
1445 | "btrfs: scrub_repair_page_from_good_copy(bdev == NULL) is unexpected!\n"); | 1445 | "scrub_repair_page_from_good_copy(bdev == NULL) " |
1446 | "is unexpected!\n"); | ||
1446 | return -EIO; | 1447 | return -EIO; |
1447 | } | 1448 | } |
1448 | 1449 | ||
@@ -1900,7 +1901,7 @@ static void scrub_submit(struct scrub_ctx *sctx) | |||
1900 | * This case is handled correctly (but _very_ slowly). | 1901 | * This case is handled correctly (but _very_ slowly). |
1901 | */ | 1902 | */ |
1902 | printk_ratelimited(KERN_WARNING | 1903 | printk_ratelimited(KERN_WARNING |
1903 | "btrfs: scrub_submit(bio bdev == NULL) is unexpected!\n"); | 1904 | "BTRFS: scrub_submit(bio bdev == NULL) is unexpected!\n"); |
1904 | bio_endio(sbio->bio, -EIO); | 1905 | bio_endio(sbio->bio, -EIO); |
1905 | } else { | 1906 | } else { |
1906 | btrfsic_submit_bio(READ, sbio->bio); | 1907 | btrfsic_submit_bio(READ, sbio->bio); |
@@ -2440,9 +2441,9 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, | |||
2440 | 2441 | ||
2441 | if (key.objectid < logical && | 2442 | if (key.objectid < logical && |
2442 | (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK)) { | 2443 | (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK)) { |
2443 | printk(KERN_ERR | 2444 | btrfs_err(fs_info, |
2444 | "btrfs scrub: tree block %llu spanning " | 2445 | "scrub: tree block %llu spanning " |
2445 | "stripes, ignored. logical=%llu\n", | 2446 | "stripes, ignored. logical=%llu", |
2446 | key.objectid, logical); | 2447 | key.objectid, logical); |
2447 | goto next; | 2448 | goto next; |
2448 | } | 2449 | } |
@@ -2812,8 +2813,8 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start, | |||
2812 | * check some assumptions | 2813 | * check some assumptions |
2813 | */ | 2814 | */ |
2814 | if (fs_info->chunk_root->nodesize != fs_info->chunk_root->leafsize) { | 2815 | if (fs_info->chunk_root->nodesize != fs_info->chunk_root->leafsize) { |
2815 | printk(KERN_ERR | 2816 | btrfs_err(fs_info, |
2816 | "btrfs_scrub: size assumption nodesize == leafsize (%d == %d) fails\n", | 2817 | "scrub: size assumption nodesize == leafsize (%d == %d) fails", |
2817 | fs_info->chunk_root->nodesize, | 2818 | fs_info->chunk_root->nodesize, |
2818 | fs_info->chunk_root->leafsize); | 2819 | fs_info->chunk_root->leafsize); |
2819 | return -EINVAL; | 2820 | return -EINVAL; |
@@ -2825,16 +2826,17 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start, | |||
2825 | * the way scrub is implemented. Do not handle this | 2826 | * the way scrub is implemented. Do not handle this |
2826 | * situation at all because it won't ever happen. | 2827 | * situation at all because it won't ever happen. |
2827 | */ | 2828 | */ |
2828 | printk(KERN_ERR | 2829 | btrfs_err(fs_info, |
2829 | "btrfs_scrub: size assumption nodesize <= BTRFS_STRIPE_LEN (%d <= %d) fails\n", | 2830 | "scrub: size assumption nodesize <= BTRFS_STRIPE_LEN (%d <= %d) fails", |
2830 | fs_info->chunk_root->nodesize, BTRFS_STRIPE_LEN); | 2831 | fs_info->chunk_root->nodesize, BTRFS_STRIPE_LEN); |
2831 | return -EINVAL; | 2832 | return -EINVAL; |
2832 | } | 2833 | } |
2833 | 2834 | ||
2834 | if (fs_info->chunk_root->sectorsize != PAGE_SIZE) { | 2835 | if (fs_info->chunk_root->sectorsize != PAGE_SIZE) { |
2835 | /* not supported for data w/o checksums */ | 2836 | /* not supported for data w/o checksums */ |
2836 | printk(KERN_ERR | 2837 | btrfs_err(fs_info, |
2837 | "btrfs_scrub: size assumption sectorsize != PAGE_SIZE (%d != %lu) fails\n", | 2838 | "scrub: size assumption sectorsize != PAGE_SIZE " |
2839 | "(%d != %lu) fails", | ||
2838 | fs_info->chunk_root->sectorsize, PAGE_SIZE); | 2840 | fs_info->chunk_root->sectorsize, PAGE_SIZE); |
2839 | return -EINVAL; | 2841 | return -EINVAL; |
2840 | } | 2842 | } |
@@ -2847,7 +2849,8 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start, | |||
2847 | * would exhaust the array bounds of pagev member in | 2849 | * would exhaust the array bounds of pagev member in |
2848 | * struct scrub_block | 2850 | * struct scrub_block |
2849 | */ | 2851 | */ |
2850 | pr_err("btrfs_scrub: size assumption nodesize and sectorsize <= SCRUB_MAX_PAGES_PER_BLOCK (%d <= %d && %d <= %d) fails\n", | 2852 | btrfs_err(fs_info, "scrub: size assumption nodesize and sectorsize " |
2853 | "<= SCRUB_MAX_PAGES_PER_BLOCK (%d <= %d && %d <= %d) fails", | ||
2851 | fs_info->chunk_root->nodesize, | 2854 | fs_info->chunk_root->nodesize, |
2852 | SCRUB_MAX_PAGES_PER_BLOCK, | 2855 | SCRUB_MAX_PAGES_PER_BLOCK, |
2853 | fs_info->chunk_root->sectorsize, | 2856 | fs_info->chunk_root->sectorsize, |
@@ -3163,7 +3166,8 @@ static void copy_nocow_pages_worker(struct btrfs_work *work) | |||
3163 | ret = iterate_inodes_from_logical(logical, fs_info, path, | 3166 | ret = iterate_inodes_from_logical(logical, fs_info, path, |
3164 | record_inode_for_nocow, nocow_ctx); | 3167 | record_inode_for_nocow, nocow_ctx); |
3165 | if (ret != 0 && ret != -ENOENT) { | 3168 | if (ret != 0 && ret != -ENOENT) { |
3166 | pr_warn("iterate_inodes_from_logical() failed: log %llu, phys %llu, len %llu, mir %u, ret %d\n", | 3169 | btrfs_warn(fs_info, "iterate_inodes_from_logical() failed: log %llu, " |
3170 | "phys %llu, len %llu, mir %u, ret %d", | ||
3167 | logical, physical_for_dev_replace, len, mirror_num, | 3171 | logical, physical_for_dev_replace, len, mirror_num, |
3168 | ret); | 3172 | ret); |
3169 | not_written = 1; | 3173 | not_written = 1; |
@@ -3285,7 +3289,7 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, | |||
3285 | again: | 3289 | again: |
3286 | page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); | 3290 | page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); |
3287 | if (!page) { | 3291 | if (!page) { |
3288 | pr_err("find_or_create_page() failed\n"); | 3292 | btrfs_err(fs_info, "find_or_create_page() failed"); |
3289 | ret = -ENOMEM; | 3293 | ret = -ENOMEM; |
3290 | goto out; | 3294 | goto out; |
3291 | } | 3295 | } |
@@ -3357,7 +3361,7 @@ static int write_page_nocow(struct scrub_ctx *sctx, | |||
3357 | return -EIO; | 3361 | return -EIO; |
3358 | if (!dev->bdev) { | 3362 | if (!dev->bdev) { |
3359 | printk_ratelimited(KERN_WARNING | 3363 | printk_ratelimited(KERN_WARNING |
3360 | "btrfs: scrub write_page_nocow(bdev == NULL) is unexpected!\n"); | 3364 | "BTRFS: scrub write_page_nocow(bdev == NULL) is unexpected!\n"); |
3361 | return -EIO; | 3365 | return -EIO; |
3362 | } | 3366 | } |
3363 | bio = btrfs_io_bio_alloc(GFP_NOFS, 1); | 3367 | bio = btrfs_io_bio_alloc(GFP_NOFS, 1); |