aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-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/inode-item.c
parent88fd146c27da0f34c512f47e2b3776a0762ecd81 (diff)
Btrfs: transaction handles everywhere
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-rw-r--r--fs/btrfs/inode-item.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index 4908f9afdf86..7caeb11e8756 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -4,9 +4,11 @@
4#include "radix-tree.h" 4#include "radix-tree.h"
5#include "ctree.h" 5#include "ctree.h"
6#include "disk-io.h" 6#include "disk-io.h"
7#include "transaction.h"
7 8
8int btrfs_insert_inode(struct btrfs_root *root, u64 objectid, 9int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root
9 struct btrfs_inode_item *inode_item) 10 *root, u64 objectid, struct btrfs_inode_item
11 *inode_item)
10{ 12{
11 struct btrfs_path path; 13 struct btrfs_path path;
12 struct btrfs_key key; 14 struct btrfs_key key;
@@ -17,13 +19,14 @@ int btrfs_insert_inode(struct btrfs_root *root, u64 objectid,
17 key.offset = 0; 19 key.offset = 0;
18 20
19 btrfs_init_path(&path); 21 btrfs_init_path(&path);
20 ret = btrfs_insert_item(root, &key, inode_item, sizeof(*inode_item)); 22 ret = btrfs_insert_item(trans, root, &key, inode_item,
23 sizeof(*inode_item));
21 btrfs_release_path(root, &path); 24 btrfs_release_path(root, &path);
22 return ret; 25 return ret;
23} 26}
24 27
25int btrfs_lookup_inode(struct btrfs_root *root, struct btrfs_path *path, 28int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
26 u64 objectid, int mod) 29 *root, struct btrfs_path *path, u64 objectid, int mod)
27{ 30{
28 struct btrfs_key key; 31 struct btrfs_key key;
29 int ins_len = mod < 0 ? -1 : 0; 32 int ins_len = mod < 0 ? -1 : 0;
@@ -33,5 +36,5 @@ int btrfs_lookup_inode(struct btrfs_root *root, struct btrfs_path *path,
33 key.flags = 0; 36 key.flags = 0;
34 btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY); 37 btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY);
35 key.offset = 0; 38 key.offset = 0;
36 return btrfs_search_slot(root, &key, path, ins_len, cow); 39 return btrfs_search_slot(trans, root, &key, path, ins_len, cow);
37} 40}