aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/fuse_i.h
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-06-25 08:48:52 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:19 -0400
commit33649c91a3df57c1090a657637d44b896de367e7 (patch)
tree1ee4871a65f2b37a931c796463eb39737a32cbaa /fs/fuse/fuse_i.h
parent7142125937e1482ad3ae4366594c6586153dfc86 (diff)
[PATCH] fuse: ensure FLUSH reaches userspace
All POSIX locks owned by the current task are removed on close(). If the FLUSH request resulting initiated by close() fails to reach userspace, there might be locks remaining, which cannot be removed. The only reason it could fail, is if allocating the request fails. In this case use the request reserved for RELEASE, or if that is currently used by another FLUSH, wait for it to become available. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r--fs/fuse/fuse_i.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index eb3166625ca9..f7c74516f3a6 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -65,7 +65,7 @@ struct fuse_inode {
65/** FUSE specific file data */ 65/** FUSE specific file data */
66struct fuse_file { 66struct fuse_file {
67 /** Request reserved for flush and release */ 67 /** Request reserved for flush and release */
68 struct fuse_req *release_req; 68 struct fuse_req *reserved_req;
69 69
70 /** File handle used by userspace */ 70 /** File handle used by userspace */
71 u64 fh; 71 u64 fh;
@@ -213,6 +213,9 @@ struct fuse_req {
213 213
214 /** Request completion callback */ 214 /** Request completion callback */
215 void (*end)(struct fuse_conn *, struct fuse_req *); 215 void (*end)(struct fuse_conn *, struct fuse_req *);
216
217 /** Request is stolen from fuse_file->reserved_req */
218 struct file *stolen_file;
216}; 219};
217 220
218/** 221/**
@@ -456,11 +459,16 @@ struct fuse_req *fuse_request_alloc(void);
456void fuse_request_free(struct fuse_req *req); 459void fuse_request_free(struct fuse_req *req);
457 460
458/** 461/**
459 * Reserve a preallocated request 462 * Get a request, may fail with -ENOMEM
460 */ 463 */
461struct fuse_req *fuse_get_req(struct fuse_conn *fc); 464struct fuse_req *fuse_get_req(struct fuse_conn *fc);
462 465
463/** 466/**
467 * Gets a requests for a file operation, always succeeds
468 */
469struct fuse_req *fuse_get_req_nofail(struct fuse_conn *fc, struct file *file);
470
471/**
464 * Decrement reference count of a request. If count goes to zero free 472 * Decrement reference count of a request. If count goes to zero free
465 * the request. 473 * the request.
466 */ 474 */