aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-item.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-02 11:20:42 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-02 11:20:42 -0400
commit5caf2a002901f0fde475371c4bf1c553b51884af (patch)
tree1c262f723307fe924ea4e960761354f194f3843e /fs/btrfs/inode-item.c
parent2c90e5d658424bc71b111eb5a972240d5d06fe86 (diff)
Btrfs: dynamic allocation of path struct
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-rw-r--r--fs/btrfs/inode-item.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index 8d8c26a6c1a0..6bfa980790c2 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -7,7 +7,7 @@ int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root
7 *root, u64 objectid, struct btrfs_inode_item 7 *root, u64 objectid, struct btrfs_inode_item
8 *inode_item) 8 *inode_item)
9{ 9{
10 struct btrfs_path path; 10 struct btrfs_path *path;
11 struct btrfs_key key; 11 struct btrfs_key key;
12 int ret; 12 int ret;
13 key.objectid = objectid; 13 key.objectid = objectid;
@@ -15,10 +15,13 @@ int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root
15 btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY); 15 btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY);
16 key.offset = 0; 16 key.offset = 0;
17 17
18 btrfs_init_path(&path); 18 path = btrfs_alloc_path();
19 BUG_ON(!path);
20 btrfs_init_path(path);
19 ret = btrfs_insert_item(trans, root, &key, inode_item, 21 ret = btrfs_insert_item(trans, root, &key, inode_item,
20 sizeof(*inode_item)); 22 sizeof(*inode_item));
21 btrfs_release_path(root, &path); 23 btrfs_release_path(root, path);
24 btrfs_free_path(path);
22 return ret; 25 return ret;
23} 26}
24 27