diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/dev.c | 6 | ||||
-rw-r--r-- | kernel/file.c | 21 | ||||
-rw-r--r-- | kernel/fuse_i.h | 3 |
3 files changed, 13 insertions, 17 deletions
diff --git a/kernel/dev.c b/kernel/dev.c index 002e23b..e703b11 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -142,8 +142,9 @@ static inline void destroy_request(struct fuse_conn *fc, struct fuse_req *req) } } -/* This one is currently only used for sending the FORGET request, which is - a kernel initiated request. So the outstanding semaphore is not used. */ +/* This one is currently only used for sending FORGET and RELEASE, + which are kernel initiated request. So the outstanding semaphore + is not used. */ int request_send_noreply(struct fuse_conn *fc, struct fuse_in *in) { struct fuse_req *req; @@ -447,7 +448,6 @@ static struct fuse_conn *new_conn(void) INIT_LIST_HEAD(&fc->processing); sema_init(&fc->outstanding, MAX_OUTSTANDING); fc->reqctr = 1; - fc->has_release = 1; } return fc; } diff --git a/kernel/file.c b/kernel/file.c index 4940117..0ba4892 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -43,22 +43,21 @@ static int fuse_open(struct inode *inode, struct file *file) static int fuse_release(struct inode *inode, struct file *file) { struct fuse_conn *fc = INO_FC(inode); - struct fuse_in in = FUSE_IN_INIT; - struct fuse_out out = FUSE_OUT_INIT; + struct fuse_in *in = NULL; - if(!fc->has_release) - return 0; + in = kmalloc(sizeof(struct fuse_in), GFP_NOFS); + if(!in) + return -ENOMEM; - in.h.opcode = FUSE_RELEASE; - in.h.ino = inode->i_ino; - request_send(fc, &in, &out); + memset(in, 0, sizeof(struct fuse_in)); - if(out.h.error == -ENOSYS) { - fc->has_release = 0; + in->h.opcode = FUSE_RELEASE; + in->h.ino = inode->i_ino; + if(!request_send_noreply(fc, in)) return 0; - } - return out.h.error; + kfree(in); + return 0; } diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index e4730e6..23cc914 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -56,9 +56,6 @@ struct fuse_conn { /** The next unique request id */ int reqctr; - - /* Flag indicating whether the release call is supported */ - int has_release; }; /** One input argument of a request */ |