]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Btrfs: remove btrfs_init_path
authorJeff Mahoney <jeffm@suse.com>
Thu, 12 Feb 2009 19:11:25 +0000 (14:11 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 12 Feb 2009 19:11:25 +0000 (14:11 -0500)
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>
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/inode-map.c
fs/btrfs/inode.c

index 6674692f70232fc69e762d375e2320d5d58d7bd5..c8f4c540cc2c4b47f19fe5da0713b233177bfc4a 100644 (file)
@@ -38,19 +38,12 @@ static int balance_node_right(struct btrfs_trans_handle *trans,
 static int del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root,
                   struct btrfs_path *path, int level, int slot);
 
-inline void btrfs_init_path(struct btrfs_path *p)
-{
-       memset(p, 0, sizeof(*p));
-}
-
 struct btrfs_path *btrfs_alloc_path(void)
 {
        struct btrfs_path *path;
-       path = kmem_cache_alloc(btrfs_path_cachep, GFP_NOFS);
-       if (path) {
-               btrfs_init_path(path);
+       path = kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS);
+       if (path)
                path->reada = 1;
-       }
        return path;
 }
 
index 531db112c8bd5e003bde909c4adfb8c74a8b4e64..3f7a8058df2bc7f98011cf82aefd963451746e3f 100644 (file)
@@ -1834,7 +1834,6 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
 void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p);
 struct btrfs_path *btrfs_alloc_path(void);
 void btrfs_free_path(struct btrfs_path *p);
-void btrfs_init_path(struct btrfs_path *p);
 void btrfs_set_path_blocking(struct btrfs_path *p);
 void btrfs_clear_path_blocking(struct btrfs_path *p);
 void btrfs_unlock_up_safe(struct btrfs_path *p, int level);
index 2aa79873eb46a46baa00503d6682de1861db7c45..cc7334d833c9d27f4a139b6b96232e959f1458a5 100644 (file)
@@ -84,7 +84,6 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
        search_key.type = 0;
        search_key.offset = 0;
 
-       btrfs_init_path(path);
        start_found = 0;
        ret = btrfs_search_slot(trans, root, &search_key, path, 0, 0);
        if (ret < 0)
index 638bcb5e49f68322fc737e5d3e61bd023dc93af2..3cee77ae03c81e0fe8340ceedb268ca96c2a1521 100644 (file)
@@ -2531,8 +2531,6 @@ noinline int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
        key.offset = (u64)-1;
        key.type = (u8)-1;
 
-       btrfs_init_path(path);
-
 search_again:
        ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
        if (ret < 0)