diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-02-12 14:11:25 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-02-12 14:11:25 -0500 |
commit | e00f7308658622fbd483cb0d9fe41165bf9050d0 (patch) | |
tree | 5baeaee96a3d6789f4cce2ca17d7f4f8afb3431e /fs/btrfs | |
parent | 7951f3cefbd711f4429a0cd014aa83a844c399a0 (diff) |
Btrfs: remove btrfs_init_path
btrfs_init_path was initially used when the path objects were on the
stack. Now all the work is done by btrfs_alloc_path and btrfs_init_path
isn't required.
This patch removes it, and just uses kmem_cache_zalloc to zero out the object.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ctree.c | 11 | ||||
-rw-r--r-- | fs/btrfs/ctree.h | 1 | ||||
-rw-r--r-- | fs/btrfs/inode-map.c | 1 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 2 |
4 files changed, 2 insertions, 13 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 6674692f7023..c8f4c540cc2c 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -38,19 +38,12 @@ static int balance_node_right(struct btrfs_trans_handle *trans, | |||
38 | static int del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 38 | static int del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
39 | struct btrfs_path *path, int level, int slot); | 39 | struct btrfs_path *path, int level, int slot); |
40 | 40 | ||
41 | inline void btrfs_init_path(struct btrfs_path *p) | ||
42 | { | ||
43 | memset(p, 0, sizeof(*p)); | ||
44 | } | ||
45 | |||
46 | struct btrfs_path *btrfs_alloc_path(void) | 41 | struct btrfs_path *btrfs_alloc_path(void) |
47 | { | 42 | { |
48 | struct btrfs_path *path; | 43 | struct btrfs_path *path; |
49 | path = kmem_cache_alloc(btrfs_path_cachep, GFP_NOFS); | 44 | path = kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS); |
50 | if (path) { | 45 | if (path) |
51 | btrfs_init_path(path); | ||
52 | path->reada = 1; | 46 | path->reada = 1; |
53 | } | ||
54 | return path; | 47 | return path; |
55 | } | 48 | } |
56 | 49 | ||
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 531db112c8bd..3f7a8058df2b 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1834,7 +1834,6 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans, | |||
1834 | void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); | 1834 | void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); |
1835 | struct btrfs_path *btrfs_alloc_path(void); | 1835 | struct btrfs_path *btrfs_alloc_path(void); |
1836 | void btrfs_free_path(struct btrfs_path *p); | 1836 | void btrfs_free_path(struct btrfs_path *p); |
1837 | void btrfs_init_path(struct btrfs_path *p); | ||
1838 | void btrfs_set_path_blocking(struct btrfs_path *p); | 1837 | void btrfs_set_path_blocking(struct btrfs_path *p); |
1839 | void btrfs_clear_path_blocking(struct btrfs_path *p); | 1838 | void btrfs_clear_path_blocking(struct btrfs_path *p); |
1840 | void btrfs_unlock_up_safe(struct btrfs_path *p, int level); | 1839 | void btrfs_unlock_up_safe(struct btrfs_path *p, int level); |
diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c index 2aa79873eb46..cc7334d833c9 100644 --- a/fs/btrfs/inode-map.c +++ b/fs/btrfs/inode-map.c | |||
@@ -84,7 +84,6 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, | |||
84 | search_key.type = 0; | 84 | search_key.type = 0; |
85 | search_key.offset = 0; | 85 | search_key.offset = 0; |
86 | 86 | ||
87 | btrfs_init_path(path); | ||
88 | start_found = 0; | 87 | start_found = 0; |
89 | ret = btrfs_search_slot(trans, root, &search_key, path, 0, 0); | 88 | ret = btrfs_search_slot(trans, root, &search_key, path, 0, 0); |
90 | if (ret < 0) | 89 | if (ret < 0) |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 638bcb5e49f6..3cee77ae03c8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -2531,8 +2531,6 @@ noinline int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, | |||
2531 | key.offset = (u64)-1; | 2531 | key.offset = (u64)-1; |
2532 | key.type = (u8)-1; | 2532 | key.type = (u8)-1; |
2533 | 2533 | ||
2534 | btrfs_init_path(path); | ||
2535 | |||
2536 | search_again: | 2534 | search_again: |
2537 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); | 2535 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); |
2538 | if (ret < 0) | 2536 | if (ret < 0) |