aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2002-12-10 14:54:57 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2002-12-10 14:54:57 +0000
commit383a9dfa0011cce8b5619a6a3f6b69142f8388b8 (patch)
tree9a0397ea3c370a9fc7ecb0986fa994bba8ab00a3 /kernel
parentc8ba2379a8dae3cc7a7fdeb6ee00fb95332212aa (diff)
downloadlibfuse-383a9dfa0011cce8b5619a6a3f6b69142f8388b8.tar.gz
release() changes
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dev.c6
-rw-r--r--kernel/file.c21
-rw-r--r--kernel/fuse_i.h3
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 */