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)
downloadkernel_goldelico_gta04-5caf2a002901f0fde475371c4bf1c553b51884af.zip
kernel_goldelico_gta04-5caf2a002901f0fde475371c4bf1c553b51884af.tar.gz
kernel_goldelico_gta04-5caf2a002901f0fde475371c4bf1c553b51884af.tar.bz2
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 8d8c26a..6bfa980 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
*root, u64 objectid, struct btrfs_inode_item
*inode_item)
{
- struct btrfs_path path;
+ struct btrfs_path *path;
struct btrfs_key key;
int ret;
key.objectid = objectid;
@@ -15,10 +15,13 @@ int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY);
key.offset = 0;
- btrfs_init_path(&path);
+ path = btrfs_alloc_path();
+ BUG_ON(!path);
+ btrfs_init_path(path);
ret = btrfs_insert_item(trans, root, &key, inode_item,
sizeof(*inode_item));
- btrfs_release_path(root, &path);
+ btrfs_release_path(root, path);
+ btrfs_free_path(path);
return ret;
}