aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-07-20 12:37:47 -0400
committerDavid Sterba <dsterba@suse.com>2018-08-06 07:12:56 -0400
commit8e87e8562744e23e10afea98d610cc6b7f4ba9bb (patch)
treea784904c4928d6b9cdb83499d6ffe0d8e3b058e4
parent5e23a6fea6189d1f9d6e6ca5cb3290b4a0fe2d48 (diff)
btrfs: Remove fs_info argument from btrfs_add_dev_item
It can be referenced form the passed transaction handle. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/volumes.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index f237ef9e70a7..1c88c4c947bb 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1666,10 +1666,8 @@ error:
1666 * the btrfs_device struct should be fully filled in 1666 * the btrfs_device struct should be fully filled in
1667 */ 1667 */
1668static int btrfs_add_dev_item(struct btrfs_trans_handle *trans, 1668static int btrfs_add_dev_item(struct btrfs_trans_handle *trans,
1669 struct btrfs_fs_info *fs_info,
1670 struct btrfs_device *device) 1669 struct btrfs_device *device)
1671{ 1670{
1672 struct btrfs_root *root = fs_info->chunk_root;
1673 int ret; 1671 int ret;
1674 struct btrfs_path *path; 1672 struct btrfs_path *path;
1675 struct btrfs_dev_item *dev_item; 1673 struct btrfs_dev_item *dev_item;
@@ -1685,8 +1683,8 @@ static int btrfs_add_dev_item(struct btrfs_trans_handle *trans,
1685 key.type = BTRFS_DEV_ITEM_KEY; 1683 key.type = BTRFS_DEV_ITEM_KEY;
1686 key.offset = device->devid; 1684 key.offset = device->devid;
1687 1685
1688 ret = btrfs_insert_empty_item(trans, root, path, &key, 1686 ret = btrfs_insert_empty_item(trans, trans->fs_info->chunk_root, path,
1689 sizeof(*dev_item)); 1687 &key, sizeof(*dev_item));
1690 if (ret) 1688 if (ret)
1691 goto out; 1689 goto out;
1692 1690
@@ -1711,7 +1709,7 @@ static int btrfs_add_dev_item(struct btrfs_trans_handle *trans,
1711 ptr = btrfs_device_uuid(dev_item); 1709 ptr = btrfs_device_uuid(dev_item);
1712 write_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE); 1710 write_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE);
1713 ptr = btrfs_device_fsid(dev_item); 1711 ptr = btrfs_device_fsid(dev_item);
1714 write_extent_buffer(leaf, fs_info->fsid, ptr, BTRFS_FSID_SIZE); 1712 write_extent_buffer(leaf, trans->fs_info->fsid, ptr, BTRFS_FSID_SIZE);
1715 btrfs_mark_buffer_dirty(leaf); 1713 btrfs_mark_buffer_dirty(leaf);
1716 1714
1717 ret = 0; 1715 ret = 0;
@@ -2449,7 +2447,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
2449 } 2447 }
2450 } 2448 }
2451 2449
2452 ret = btrfs_add_dev_item(trans, fs_info, device); 2450 ret = btrfs_add_dev_item(trans, device);
2453 if (ret) { 2451 if (ret) {
2454 btrfs_abort_transaction(trans, ret); 2452 btrfs_abort_transaction(trans, ret);
2455 goto error_sysfs; 2453 goto error_sysfs;