diff options
Diffstat (limited to 'fs/btrfs/dir-item.c')
-rw-r--r-- | fs/btrfs/dir-item.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index a42a67b99753..949c4e526798 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c | |||
@@ -5,9 +5,11 @@ | |||
5 | #include "ctree.h" | 5 | #include "ctree.h" |
6 | #include "disk-io.h" | 6 | #include "disk-io.h" |
7 | #include "hash.h" | 7 | #include "hash.h" |
8 | #include "transaction.h" | ||
8 | 9 | ||
9 | int btrfs_insert_dir_item(struct btrfs_root *root, char *name, int name_len, | 10 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root |
10 | u64 dir, u64 objectid, u8 type) | 11 | *root, char *name, int name_len, u64 dir, u64 |
12 | objectid, u8 type) | ||
11 | { | 13 | { |
12 | int ret = 0; | 14 | int ret = 0; |
13 | struct btrfs_path path; | 15 | struct btrfs_path path; |
@@ -23,7 +25,7 @@ int btrfs_insert_dir_item(struct btrfs_root *root, char *name, int name_len, | |||
23 | BUG_ON(ret); | 25 | BUG_ON(ret); |
24 | btrfs_init_path(&path); | 26 | btrfs_init_path(&path); |
25 | data_size = sizeof(*dir_item) + name_len; | 27 | data_size = sizeof(*dir_item) + name_len; |
26 | ret = btrfs_insert_empty_item(root, &path, &key, data_size); | 28 | ret = btrfs_insert_empty_item(trans, root, &path, &key, data_size); |
27 | if (ret) | 29 | if (ret) |
28 | goto out; | 30 | goto out; |
29 | 31 | ||
@@ -40,8 +42,9 @@ out: | |||
40 | return ret; | 42 | return ret; |
41 | } | 43 | } |
42 | 44 | ||
43 | int btrfs_lookup_dir_item(struct btrfs_root *root, struct btrfs_path *path, | 45 | int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root |
44 | u64 dir, char *name, int name_len, int mod) | 46 | *root, struct btrfs_path *path, u64 dir, char *name, |
47 | int name_len, int mod) | ||
45 | { | 48 | { |
46 | int ret; | 49 | int ret; |
47 | struct btrfs_key key; | 50 | struct btrfs_key key; |
@@ -53,12 +56,13 @@ int btrfs_lookup_dir_item(struct btrfs_root *root, struct btrfs_path *path, | |||
53 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); | 56 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); |
54 | ret = btrfs_name_hash(name, name_len, &key.offset); | 57 | ret = btrfs_name_hash(name, name_len, &key.offset); |
55 | BUG_ON(ret); | 58 | BUG_ON(ret); |
56 | ret = btrfs_search_slot(root, &key, path, ins_len, cow); | 59 | ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow); |
57 | return ret; | 60 | return ret; |
58 | } | 61 | } |
59 | 62 | ||
60 | int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path, | 63 | int btrfs_match_dir_item_name(struct btrfs_root *root, |
61 | char *name, int name_len) | 64 | struct btrfs_path *path, char |
65 | *name, int name_len) | ||
62 | { | 66 | { |
63 | struct btrfs_dir_item *dir_item; | 67 | struct btrfs_dir_item *dir_item; |
64 | char *name_ptr; | 68 | char *name_ptr; |