aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dir-item.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-16 16:20:31 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-16 16:20:31 -0400
commite089f05c18ab36ed5fa7e2319052e03ab800d518 (patch)
treef20d727233bb23fa5a37fc050cf0cc5c9d5e7b48 /fs/btrfs/dir-item.c
parent88fd146c27da0f34c512f47e2b3776a0762ecd81 (diff)
Btrfs: transaction handles everywhere
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/dir-item.c')
-rw-r--r--fs/btrfs/dir-item.c20
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
9int btrfs_insert_dir_item(struct btrfs_root *root, char *name, int name_len, 10int 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
43int btrfs_lookup_dir_item(struct btrfs_root *root, struct btrfs_path *path, 45int 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
60int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path, 63int 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;