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.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index a24b47274037..9cccecc0f431 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -20,7 +20,7 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid,
20 search_key.offset = (u32)-1; 20 search_key.offset = (u32)-1;
21 21
22 btrfs_init_path(&path); 22 btrfs_init_path(&path);
23 ret = btrfs_search_slot(root, &search_key, &path, 0, 0); 23 ret = btrfs_search_slot(NULL, root, &search_key, &path, 0, 0);
24 if (ret < 0) 24 if (ret < 0)
25 goto out; 25 goto out;
26 BUG_ON(ret == 0); 26 BUG_ON(ret == 0);
@@ -40,8 +40,9 @@ out:
40 return ret; 40 return ret;
41} 41}
42 42
43int btrfs_update_root(struct btrfs_root *root, struct btrfs_key *key, 43int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
44 struct btrfs_root_item *item) 44 *root, struct btrfs_key *key, struct btrfs_root_item
45 *item)
45{ 46{
46 struct btrfs_path path; 47 struct btrfs_path path;
47 struct btrfs_leaf *l; 48 struct btrfs_leaf *l;
@@ -49,7 +50,7 @@ int btrfs_update_root(struct btrfs_root *root, struct btrfs_key *key,
49 int slot; 50 int slot;
50 51
51 btrfs_init_path(&path); 52 btrfs_init_path(&path);
52 ret = btrfs_search_slot(root, key, &path, 0, 1); 53 ret = btrfs_search_slot(trans, root, key, &path, 0, 1);
53 if (ret < 0) 54 if (ret < 0)
54 goto out; 55 goto out;
55 BUG_ON(ret != 0); 56 BUG_ON(ret != 0);
@@ -62,26 +63,28 @@ out:
62 return ret; 63 return ret;
63} 64}
64 65
65int btrfs_insert_root(struct btrfs_root *root, struct btrfs_key *key, 66int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root
66 struct btrfs_root_item *item) 67 *root, struct btrfs_key *key, struct btrfs_root_item
68 *item)
67{ 69{
68 int ret; 70 int ret;
69 ret = btrfs_insert_item(root, key, item, sizeof(*item)); 71 ret = btrfs_insert_item(trans, root, key, item, sizeof(*item));
70 BUG_ON(ret); 72 BUG_ON(ret);
71 return ret; 73 return ret;
72} 74}
73 75
74int btrfs_del_root(struct btrfs_root *root, struct btrfs_key *key) 76int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
77 struct btrfs_key *key)
75{ 78{
76 struct btrfs_path path; 79 struct btrfs_path path;
77 int ret; 80 int ret;
78 81
79 btrfs_init_path(&path); 82 btrfs_init_path(&path);
80 ret = btrfs_search_slot(root, key, &path, -1, 1); 83 ret = btrfs_search_slot(trans, root, key, &path, -1, 1);
81 if (ret < 0) 84 if (ret < 0)
82 goto out; 85 goto out;
83 BUG_ON(ret != 0); 86 BUG_ON(ret != 0);
84 ret = btrfs_del_item(root, &path); 87 ret = btrfs_del_item(trans, root, &path);
85out: 88out:
86 btrfs_release_path(root, &path); 89 btrfs_release_path(root, &path);
87 return ret; 90 return ret;