From 31d5119338b9284ba5d3759f97572d5a81602ec5 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 7 Dec 2004 18:28:35 +0000 Subject: [PATCH] cleanup --- kernel/dev.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/kernel/dev.c b/kernel/dev.c index 48cf44a..220918a 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -33,14 +33,18 @@ static inline struct fuse_conn *fuse_get_conn(struct file *file) return fc; } +static inline void fuse_request_init(struct fuse_req *req) +{ + memset(req, 0, sizeof(*req)); + INIT_LIST_HEAD(&req->list); + init_waitqueue_head(&req->waitq); +} + struct fuse_req *fuse_request_alloc(void) { struct fuse_req *req = kmem_cache_alloc(fuse_req_cachep, SLAB_KERNEL); - if (req) { - memset(req, 0, sizeof(*req)); - INIT_LIST_HEAD(&req->list); - init_waitqueue_head(&req->waitq); - } + if (req) + fuse_request_init(req); return req; } @@ -68,10 +72,7 @@ static int get_unique(struct fuse_conn *fc) void fuse_reset_request(struct fuse_req *req) { int preallocated = req->preallocated; - - memset(req, 0, sizeof(*req)); - INIT_LIST_HEAD(&req->list); - init_waitqueue_head(&req->waitq); + fuse_request_init(req); req->preallocated = preallocated; } -- 2.30.2