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/volumes.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/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 92303f42baaa..b68afe32419f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -125,7 +125,7 @@ static void btrfs_kobject_uevent(struct block_device *bdev, | |||
125 | 125 | ||
126 | ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action); | 126 | ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action); |
127 | if (ret) | 127 | if (ret) |
128 | pr_warn("Sending event '%d' to kobject: '%s' (%p): failed\n", | 128 | pr_warn("BTRFS: Sending event '%d' to kobject: '%s' (%p): failed\n", |
129 | action, | 129 | action, |
130 | kobject_name(&disk_to_dev(bdev->bd_disk)->kobj), | 130 | kobject_name(&disk_to_dev(bdev->bd_disk)->kobj), |
131 | &disk_to_dev(bdev->bd_disk)->kobj); | 131 | &disk_to_dev(bdev->bd_disk)->kobj); |
@@ -200,7 +200,7 @@ btrfs_get_bdev_and_sb(const char *device_path, fmode_t flags, void *holder, | |||
200 | 200 | ||
201 | if (IS_ERR(*bdev)) { | 201 | if (IS_ERR(*bdev)) { |
202 | ret = PTR_ERR(*bdev); | 202 | ret = PTR_ERR(*bdev); |
203 | printk(KERN_INFO "btrfs: open %s failed\n", device_path); | 203 | printk(KERN_INFO "BTRFS: open %s failed\n", device_path); |
204 | goto error; | 204 | goto error; |
205 | } | 205 | } |
206 | 206 | ||
@@ -912,9 +912,9 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, | |||
912 | if (disk_super->label[0]) { | 912 | if (disk_super->label[0]) { |
913 | if (disk_super->label[BTRFS_LABEL_SIZE - 1]) | 913 | if (disk_super->label[BTRFS_LABEL_SIZE - 1]) |
914 | disk_super->label[BTRFS_LABEL_SIZE - 1] = '\0'; | 914 | disk_super->label[BTRFS_LABEL_SIZE - 1] = '\0'; |
915 | printk(KERN_INFO "btrfs: device label %s ", disk_super->label); | 915 | printk(KERN_INFO "BTRFS: device label %s ", disk_super->label); |
916 | } else { | 916 | } else { |
917 | printk(KERN_INFO "btrfs: device fsid %pU ", disk_super->fsid); | 917 | printk(KERN_INFO "BTRFS: device fsid %pU ", disk_super->fsid); |
918 | } | 918 | } |
919 | 919 | ||
920 | printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path); | 920 | printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path); |
@@ -1813,7 +1813,7 @@ int btrfs_find_device_missing_or_by_path(struct btrfs_root *root, | |||
1813 | } | 1813 | } |
1814 | 1814 | ||
1815 | if (!*device) { | 1815 | if (!*device) { |
1816 | pr_err("btrfs: no missing device found\n"); | 1816 | btrfs_err(root->fs_info, "no missing device found"); |
1817 | return -ENOENT; | 1817 | return -ENOENT; |
1818 | } | 1818 | } |
1819 | 1819 | ||
@@ -3052,7 +3052,7 @@ loop: | |||
3052 | error: | 3052 | error: |
3053 | btrfs_free_path(path); | 3053 | btrfs_free_path(path); |
3054 | if (enospc_errors) { | 3054 | if (enospc_errors) { |
3055 | printk(KERN_INFO "btrfs: %d enospc errors during balance\n", | 3055 | btrfs_info(fs_info, "%d enospc errors during balance", |
3056 | enospc_errors); | 3056 | enospc_errors); |
3057 | if (!ret) | 3057 | if (!ret) |
3058 | ret = -ENOSPC; | 3058 | ret = -ENOSPC; |
@@ -3138,8 +3138,8 @@ int btrfs_balance(struct btrfs_balance_control *bctl, | |||
3138 | if (!(bctl->flags & BTRFS_BALANCE_DATA) || | 3138 | if (!(bctl->flags & BTRFS_BALANCE_DATA) || |
3139 | !(bctl->flags & BTRFS_BALANCE_METADATA) || | 3139 | !(bctl->flags & BTRFS_BALANCE_METADATA) || |
3140 | memcmp(&bctl->data, &bctl->meta, sizeof(bctl->data))) { | 3140 | memcmp(&bctl->data, &bctl->meta, sizeof(bctl->data))) { |
3141 | printk(KERN_ERR "btrfs: with mixed groups data and " | 3141 | btrfs_err(fs_info, "with mixed groups data and " |
3142 | "metadata balance options must be the same\n"); | 3142 | "metadata balance options must be the same"); |
3143 | ret = -EINVAL; | 3143 | ret = -EINVAL; |
3144 | goto out; | 3144 | goto out; |
3145 | } | 3145 | } |
@@ -3165,8 +3165,8 @@ int btrfs_balance(struct btrfs_balance_control *bctl, | |||
3165 | if ((bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) && | 3165 | if ((bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) && |
3166 | (!alloc_profile_is_valid(bctl->data.target, 1) || | 3166 | (!alloc_profile_is_valid(bctl->data.target, 1) || |
3167 | (bctl->data.target & ~allowed))) { | 3167 | (bctl->data.target & ~allowed))) { |
3168 | printk(KERN_ERR "btrfs: unable to start balance with target " | 3168 | btrfs_err(fs_info, "unable to start balance with target " |
3169 | "data profile %llu\n", | 3169 | "data profile %llu", |
3170 | bctl->data.target); | 3170 | bctl->data.target); |
3171 | ret = -EINVAL; | 3171 | ret = -EINVAL; |
3172 | goto out; | 3172 | goto out; |
@@ -3174,8 +3174,8 @@ int btrfs_balance(struct btrfs_balance_control *bctl, | |||
3174 | if ((bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT) && | 3174 | if ((bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT) && |
3175 | (!alloc_profile_is_valid(bctl->meta.target, 1) || | 3175 | (!alloc_profile_is_valid(bctl->meta.target, 1) || |
3176 | (bctl->meta.target & ~allowed))) { | 3176 | (bctl->meta.target & ~allowed))) { |
3177 | printk(KERN_ERR "btrfs: unable to start balance with target " | 3177 | btrfs_err(fs_info, |
3178 | "metadata profile %llu\n", | 3178 | "unable to start balance with target metadata profile %llu", |
3179 | bctl->meta.target); | 3179 | bctl->meta.target); |
3180 | ret = -EINVAL; | 3180 | ret = -EINVAL; |
3181 | goto out; | 3181 | goto out; |
@@ -3183,8 +3183,8 @@ int btrfs_balance(struct btrfs_balance_control *bctl, | |||
3183 | if ((bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT) && | 3183 | if ((bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT) && |
3184 | (!alloc_profile_is_valid(bctl->sys.target, 1) || | 3184 | (!alloc_profile_is_valid(bctl->sys.target, 1) || |
3185 | (bctl->sys.target & ~allowed))) { | 3185 | (bctl->sys.target & ~allowed))) { |
3186 | printk(KERN_ERR "btrfs: unable to start balance with target " | 3186 | btrfs_err(fs_info, |
3187 | "system profile %llu\n", | 3187 | "unable to start balance with target system profile %llu", |
3188 | bctl->sys.target); | 3188 | bctl->sys.target); |
3189 | ret = -EINVAL; | 3189 | ret = -EINVAL; |
3190 | goto out; | 3190 | goto out; |
@@ -3193,7 +3193,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl, | |||
3193 | /* allow dup'ed data chunks only in mixed mode */ | 3193 | /* allow dup'ed data chunks only in mixed mode */ |
3194 | if (!mixed && (bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) && | 3194 | if (!mixed && (bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) && |
3195 | (bctl->data.target & BTRFS_BLOCK_GROUP_DUP)) { | 3195 | (bctl->data.target & BTRFS_BLOCK_GROUP_DUP)) { |
3196 | printk(KERN_ERR "btrfs: dup for data is not allowed\n"); | 3196 | btrfs_err(fs_info, "dup for data is not allowed"); |
3197 | ret = -EINVAL; | 3197 | ret = -EINVAL; |
3198 | goto out; | 3198 | goto out; |
3199 | } | 3199 | } |
@@ -3213,11 +3213,10 @@ int btrfs_balance(struct btrfs_balance_control *bctl, | |||
3213 | (fs_info->avail_metadata_alloc_bits & allowed) && | 3213 | (fs_info->avail_metadata_alloc_bits & allowed) && |
3214 | !(bctl->meta.target & allowed))) { | 3214 | !(bctl->meta.target & allowed))) { |
3215 | if (bctl->flags & BTRFS_BALANCE_FORCE) { | 3215 | if (bctl->flags & BTRFS_BALANCE_FORCE) { |
3216 | printk(KERN_INFO "btrfs: force reducing metadata " | 3216 | btrfs_info(fs_info, "force reducing metadata integrity"); |
3217 | "integrity\n"); | ||
3218 | } else { | 3217 | } else { |
3219 | printk(KERN_ERR "btrfs: balance will reduce metadata " | 3218 | btrfs_err(fs_info, "balance will reduce metadata " |
3220 | "integrity, use force if you want this\n"); | 3219 | "integrity, use force if you want this"); |
3221 | ret = -EINVAL; | 3220 | ret = -EINVAL; |
3222 | goto out; | 3221 | goto out; |
3223 | } | 3222 | } |
@@ -3303,7 +3302,7 @@ static int balance_kthread(void *data) | |||
3303 | mutex_lock(&fs_info->balance_mutex); | 3302 | mutex_lock(&fs_info->balance_mutex); |
3304 | 3303 | ||
3305 | if (fs_info->balance_ctl) { | 3304 | if (fs_info->balance_ctl) { |
3306 | printk(KERN_INFO "btrfs: continuing balance\n"); | 3305 | btrfs_info(fs_info, "continuing balance"); |
3307 | ret = btrfs_balance(fs_info->balance_ctl, NULL); | 3306 | ret = btrfs_balance(fs_info->balance_ctl, NULL); |
3308 | } | 3307 | } |
3309 | 3308 | ||
@@ -3325,7 +3324,7 @@ int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info) | |||
3325 | spin_unlock(&fs_info->balance_lock); | 3324 | spin_unlock(&fs_info->balance_lock); |
3326 | 3325 | ||
3327 | if (btrfs_test_opt(fs_info->tree_root, SKIP_BALANCE)) { | 3326 | if (btrfs_test_opt(fs_info->tree_root, SKIP_BALANCE)) { |
3328 | printk(KERN_INFO "btrfs: force skipping balance\n"); | 3327 | btrfs_info(fs_info, "force skipping balance"); |
3329 | return 0; | 3328 | return 0; |
3330 | } | 3329 | } |
3331 | 3330 | ||
@@ -3543,7 +3542,7 @@ update_tree: | |||
3543 | BTRFS_UUID_KEY_SUBVOL, | 3542 | BTRFS_UUID_KEY_SUBVOL, |
3544 | key.objectid); | 3543 | key.objectid); |
3545 | if (ret < 0) { | 3544 | if (ret < 0) { |
3546 | pr_warn("btrfs: uuid_tree_add failed %d\n", | 3545 | btrfs_warn(fs_info, "uuid_tree_add failed %d", |
3547 | ret); | 3546 | ret); |
3548 | break; | 3547 | break; |
3549 | } | 3548 | } |
@@ -3555,7 +3554,7 @@ update_tree: | |||
3555 | BTRFS_UUID_KEY_RECEIVED_SUBVOL, | 3554 | BTRFS_UUID_KEY_RECEIVED_SUBVOL, |
3556 | key.objectid); | 3555 | key.objectid); |
3557 | if (ret < 0) { | 3556 | if (ret < 0) { |
3558 | pr_warn("btrfs: uuid_tree_add failed %d\n", | 3557 | btrfs_warn(fs_info, "uuid_tree_add failed %d", |
3559 | ret); | 3558 | ret); |
3560 | break; | 3559 | break; |
3561 | } | 3560 | } |
@@ -3590,7 +3589,7 @@ out: | |||
3590 | if (trans && !IS_ERR(trans)) | 3589 | if (trans && !IS_ERR(trans)) |
3591 | btrfs_end_transaction(trans, fs_info->uuid_root); | 3590 | btrfs_end_transaction(trans, fs_info->uuid_root); |
3592 | if (ret) | 3591 | if (ret) |
3593 | pr_warn("btrfs: btrfs_uuid_scan_kthread failed %d\n", ret); | 3592 | btrfs_warn(fs_info, "btrfs_uuid_scan_kthread failed %d", ret); |
3594 | else | 3593 | else |
3595 | fs_info->update_uuid_tree_gen = 1; | 3594 | fs_info->update_uuid_tree_gen = 1; |
3596 | up(&fs_info->uuid_tree_rescan_sem); | 3595 | up(&fs_info->uuid_tree_rescan_sem); |
@@ -3654,7 +3653,7 @@ static int btrfs_uuid_rescan_kthread(void *data) | |||
3654 | */ | 3653 | */ |
3655 | ret = btrfs_uuid_tree_iterate(fs_info, btrfs_check_uuid_tree_entry); | 3654 | ret = btrfs_uuid_tree_iterate(fs_info, btrfs_check_uuid_tree_entry); |
3656 | if (ret < 0) { | 3655 | if (ret < 0) { |
3657 | pr_warn("btrfs: iterating uuid_tree failed %d\n", ret); | 3656 | btrfs_warn(fs_info, "iterating uuid_tree failed %d", ret); |
3658 | up(&fs_info->uuid_tree_rescan_sem); | 3657 | up(&fs_info->uuid_tree_rescan_sem); |
3659 | return ret; | 3658 | return ret; |
3660 | } | 3659 | } |
@@ -3695,7 +3694,7 @@ int btrfs_create_uuid_tree(struct btrfs_fs_info *fs_info) | |||
3695 | task = kthread_run(btrfs_uuid_scan_kthread, fs_info, "btrfs-uuid"); | 3694 | task = kthread_run(btrfs_uuid_scan_kthread, fs_info, "btrfs-uuid"); |
3696 | if (IS_ERR(task)) { | 3695 | if (IS_ERR(task)) { |
3697 | /* fs_info->update_uuid_tree_gen remains 0 in all error case */ | 3696 | /* fs_info->update_uuid_tree_gen remains 0 in all error case */ |
3698 | pr_warn("btrfs: failed to start uuid_scan task\n"); | 3697 | btrfs_warn(fs_info, "failed to start uuid_scan task"); |
3699 | up(&fs_info->uuid_tree_rescan_sem); | 3698 | up(&fs_info->uuid_tree_rescan_sem); |
3700 | return PTR_ERR(task); | 3699 | return PTR_ERR(task); |
3701 | } | 3700 | } |
@@ -3711,7 +3710,7 @@ int btrfs_check_uuid_tree(struct btrfs_fs_info *fs_info) | |||
3711 | task = kthread_run(btrfs_uuid_rescan_kthread, fs_info, "btrfs-uuid"); | 3710 | task = kthread_run(btrfs_uuid_rescan_kthread, fs_info, "btrfs-uuid"); |
3712 | if (IS_ERR(task)) { | 3711 | if (IS_ERR(task)) { |
3713 | /* fs_info->update_uuid_tree_gen remains 0 in all error case */ | 3712 | /* fs_info->update_uuid_tree_gen remains 0 in all error case */ |
3714 | pr_warn("btrfs: failed to start uuid_rescan task\n"); | 3713 | btrfs_warn(fs_info, "failed to start uuid_rescan task"); |
3715 | up(&fs_info->uuid_tree_rescan_sem); | 3714 | up(&fs_info->uuid_tree_rescan_sem); |
3716 | return PTR_ERR(task); | 3715 | return PTR_ERR(task); |
3717 | } | 3716 | } |
@@ -4033,7 +4032,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, | |||
4033 | max_stripe_size = 32 * 1024 * 1024; | 4032 | max_stripe_size = 32 * 1024 * 1024; |
4034 | max_chunk_size = 2 * max_stripe_size; | 4033 | max_chunk_size = 2 * max_stripe_size; |
4035 | } else { | 4034 | } else { |
4036 | printk(KERN_ERR "btrfs: invalid chunk type 0x%llx requested\n", | 4035 | btrfs_err(info, "invalid chunk type 0x%llx requested\n", |
4037 | type); | 4036 | type); |
4038 | BUG_ON(1); | 4037 | BUG_ON(1); |
4039 | } | 4038 | } |
@@ -4065,7 +4064,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, | |||
4065 | 4064 | ||
4066 | if (!device->writeable) { | 4065 | if (!device->writeable) { |
4067 | WARN(1, KERN_ERR | 4066 | WARN(1, KERN_ERR |
4068 | "btrfs: read-only device in alloc_list\n"); | 4067 | "BTRFS: read-only device in alloc_list\n"); |
4069 | continue; | 4068 | continue; |
4070 | } | 4069 | } |
4071 | 4070 | ||
@@ -5193,13 +5192,13 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | |||
5193 | read_unlock(&em_tree->lock); | 5192 | read_unlock(&em_tree->lock); |
5194 | 5193 | ||
5195 | if (!em) { | 5194 | if (!em) { |
5196 | printk(KERN_ERR "btrfs: couldn't find em for chunk %Lu\n", | 5195 | printk(KERN_ERR "BTRFS: couldn't find em for chunk %Lu\n", |
5197 | chunk_start); | 5196 | chunk_start); |
5198 | return -EIO; | 5197 | return -EIO; |
5199 | } | 5198 | } |
5200 | 5199 | ||
5201 | if (em->start != chunk_start) { | 5200 | if (em->start != chunk_start) { |
5202 | printk(KERN_ERR "btrfs: bad chunk start, em=%Lu, wanted=%Lu\n", | 5201 | printk(KERN_ERR "BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n", |
5203 | em->start, chunk_start); | 5202 | em->start, chunk_start); |
5204 | free_extent_map(em); | 5203 | free_extent_map(em); |
5205 | return -EIO; | 5204 | return -EIO; |
@@ -6123,7 +6122,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans, | |||
6123 | BUG_ON(!path); | 6122 | BUG_ON(!path); |
6124 | ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); | 6123 | ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); |
6125 | if (ret < 0) { | 6124 | if (ret < 0) { |
6126 | printk_in_rcu(KERN_WARNING "btrfs: error %d while searching for dev_stats item for device %s!\n", | 6125 | printk_in_rcu(KERN_WARNING "BTRFS: " |
6126 | "error %d while searching for dev_stats item for device %s!\n", | ||
6127 | ret, rcu_str_deref(device->name)); | 6127 | ret, rcu_str_deref(device->name)); |
6128 | goto out; | 6128 | goto out; |
6129 | } | 6129 | } |
@@ -6133,7 +6133,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans, | |||
6133 | /* need to delete old one and insert a new one */ | 6133 | /* need to delete old one and insert a new one */ |
6134 | ret = btrfs_del_item(trans, dev_root, path); | 6134 | ret = btrfs_del_item(trans, dev_root, path); |
6135 | if (ret != 0) { | 6135 | if (ret != 0) { |
6136 | printk_in_rcu(KERN_WARNING "btrfs: delete too small dev_stats item for device %s failed %d!\n", | 6136 | printk_in_rcu(KERN_WARNING "BTRFS: " |
6137 | "delete too small dev_stats item for device %s failed %d!\n", | ||
6137 | rcu_str_deref(device->name), ret); | 6138 | rcu_str_deref(device->name), ret); |
6138 | goto out; | 6139 | goto out; |
6139 | } | 6140 | } |
@@ -6146,7 +6147,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans, | |||
6146 | ret = btrfs_insert_empty_item(trans, dev_root, path, | 6147 | ret = btrfs_insert_empty_item(trans, dev_root, path, |
6147 | &key, sizeof(*ptr)); | 6148 | &key, sizeof(*ptr)); |
6148 | if (ret < 0) { | 6149 | if (ret < 0) { |
6149 | printk_in_rcu(KERN_WARNING "btrfs: insert dev_stats item for device %s failed %d!\n", | 6150 | printk_in_rcu(KERN_WARNING "BTRFS: " |
6151 | "insert dev_stats item for device %s failed %d!\n", | ||
6150 | rcu_str_deref(device->name), ret); | 6152 | rcu_str_deref(device->name), ret); |
6151 | goto out; | 6153 | goto out; |
6152 | } | 6154 | } |
@@ -6199,16 +6201,14 @@ static void btrfs_dev_stat_print_on_error(struct btrfs_device *dev) | |||
6199 | { | 6201 | { |
6200 | if (!dev->dev_stats_valid) | 6202 | if (!dev->dev_stats_valid) |
6201 | return; | 6203 | return; |
6202 | printk_ratelimited_in_rcu(KERN_ERR | 6204 | printk_ratelimited_in_rcu(KERN_ERR "BTRFS: " |
6203 | "btrfs: bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", | 6205 | "bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", |
6204 | rcu_str_deref(dev->name), | 6206 | rcu_str_deref(dev->name), |
6205 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS), | 6207 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS), |
6206 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_READ_ERRS), | 6208 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_READ_ERRS), |
6207 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_FLUSH_ERRS), | 6209 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_FLUSH_ERRS), |
6208 | btrfs_dev_stat_read(dev, | 6210 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_CORRUPTION_ERRS), |
6209 | BTRFS_DEV_STAT_CORRUPTION_ERRS), | 6211 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_GENERATION_ERRS)); |
6210 | btrfs_dev_stat_read(dev, | ||
6211 | BTRFS_DEV_STAT_GENERATION_ERRS)); | ||
6212 | } | 6212 | } |
6213 | 6213 | ||
6214 | static void btrfs_dev_stat_print_on_load(struct btrfs_device *dev) | 6214 | static void btrfs_dev_stat_print_on_load(struct btrfs_device *dev) |
@@ -6221,7 +6221,8 @@ static void btrfs_dev_stat_print_on_load(struct btrfs_device *dev) | |||
6221 | if (i == BTRFS_DEV_STAT_VALUES_MAX) | 6221 | if (i == BTRFS_DEV_STAT_VALUES_MAX) |
6222 | return; /* all values == 0, suppress message */ | 6222 | return; /* all values == 0, suppress message */ |
6223 | 6223 | ||
6224 | printk_in_rcu(KERN_INFO "btrfs: bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", | 6224 | printk_in_rcu(KERN_INFO "BTRFS: " |
6225 | "bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", | ||
6225 | rcu_str_deref(dev->name), | 6226 | rcu_str_deref(dev->name), |
6226 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS), | 6227 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS), |
6227 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_READ_ERRS), | 6228 | btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_READ_ERRS), |
@@ -6242,12 +6243,10 @@ int btrfs_get_dev_stats(struct btrfs_root *root, | |||
6242 | mutex_unlock(&fs_devices->device_list_mutex); | 6243 | mutex_unlock(&fs_devices->device_list_mutex); |
6243 | 6244 | ||
6244 | if (!dev) { | 6245 | if (!dev) { |
6245 | printk(KERN_WARNING | 6246 | btrfs_warn(root->fs_info, "get dev_stats failed, device not found"); |
6246 | "btrfs: get dev_stats failed, device not found\n"); | ||
6247 | return -ENODEV; | 6247 | return -ENODEV; |
6248 | } else if (!dev->dev_stats_valid) { | 6248 | } else if (!dev->dev_stats_valid) { |
6249 | printk(KERN_WARNING | 6249 | btrfs_warn(root->fs_info, "get dev_stats failed, not yet valid"); |
6250 | "btrfs: get dev_stats failed, not yet valid\n"); | ||
6251 | return -ENODEV; | 6250 | return -ENODEV; |
6252 | } else if (stats->flags & BTRFS_DEV_STATS_RESET) { | 6251 | } else if (stats->flags & BTRFS_DEV_STATS_RESET) { |
6253 | for (i = 0; i < BTRFS_DEV_STAT_VALUES_MAX; i++) { | 6252 | for (i = 0; i < BTRFS_DEV_STAT_VALUES_MAX; i++) { |