diff mbox

[9/9] Btrfs-progs: remove btrfs_init_path calls from ctree.c

Message ID 1367010370-21571-10-git-send-email-sandeen@redhat.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Eric Sandeen April 26, 2013, 9:06 p.m. UTC
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.

[Eric Sandeen: port kernel commit e00f730 to userspace]

(Note, the rest of userspace has an on-path stack, so the actual
function remains for now).

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 ctree.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/ctree.c b/ctree.c
index 7257e6f..24ca6f3 100644
--- a/ctree.c
+++ b/ctree.c
@@ -42,11 +42,7 @@  inline void btrfs_init_path(struct btrfs_path *p)
 struct btrfs_path *btrfs_alloc_path(void)
 {
 	struct btrfs_path *path;
-	path = kmalloc(sizeof(struct btrfs_path), GFP_NOFS);
-	if (path) {
-		btrfs_init_path(path);
-		path->reada = 0;
-	}
+	path = kzalloc(sizeof(struct btrfs_path), GFP_NOFS);
 	return path;
 }