aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/root-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/root-tree.c')
-rw-r--r--fs/btrfs/root-tree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index a821b5d1e233..f37dab87de16 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -45,6 +45,7 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
45 struct btrfs_leaf *l; 45 struct btrfs_leaf *l;
46 int ret; 46 int ret;
47 int slot; 47 int slot;
48 struct btrfs_root_item *update_item;
48 49
49 btrfs_init_path(&path); 50 btrfs_init_path(&path);
50 ret = btrfs_search_slot(trans, root, key, &path, 0, 1); 51 ret = btrfs_search_slot(trans, root, key, &path, 0, 1);
@@ -53,9 +54,9 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
53 BUG_ON(ret != 0); 54 BUG_ON(ret != 0);
54 l = btrfs_buffer_leaf(path.nodes[0]); 55 l = btrfs_buffer_leaf(path.nodes[0]);
55 slot = path.slots[0]; 56 slot = path.slots[0];
56 memcpy(btrfs_item_ptr(l, slot, struct btrfs_root_item), item, 57 update_item = btrfs_item_ptr(l, slot, struct btrfs_root_item);
57 sizeof(*item)); 58 btrfs_memcpy(root, l, update_item, item, sizeof(*item));
58 mark_buffer_dirty(path.nodes[0]); 59 btrfs_mark_buffer_dirty(path.nodes[0]);
59out: 60out:
60 btrfs_release_path(root, &path); 61 btrfs_release_path(root, &path);
61 return ret; 62 return ret;