aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/fuse_i.h
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-06-25 08:48:50 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:19 -0400
commit51eb01e73599efb88c6c20b1c226d20309a75450 (patch)
treec37e7a61ce7c049a4615dfb2ee994866d3c85bd6 /fs/fuse/fuse_i.h
parent3e8c54fad89144b8d63cc41619f363df1ec7cc42 (diff)
[PATCH] fuse: no backgrounding on interrupt
Don't put requests into the background when a fatal interrupt occurs while the request is in userspace. This removes a major wart from the implementation. Backgrounding of requests was introduced to allow breaking of deadlocks. However now the same can be achieved by aborting the filesystem through the 'abort' sysfs attribute. This is a change in the interface, but should not cause problems, since these kinds of deadlocks never happen during normal operation. 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.h49
1 files changed, 13 insertions, 36 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 0474202cb5d..25f8581a770 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -8,12 +8,12 @@
8 8
9#include <linux/fuse.h> 9#include <linux/fuse.h>
10#include <linux/fs.h> 10#include <linux/fs.h>
11#include <linux/mount.h>
11#include <linux/wait.h> 12#include <linux/wait.h>
12#include <linux/list.h> 13#include <linux/list.h>
13#include <linux/spinlock.h> 14#include <linux/spinlock.h>
14#include <linux/mm.h> 15#include <linux/mm.h>
15#include <linux/backing-dev.h> 16#include <linux/backing-dev.h>
16#include <asm/semaphore.h>
17 17
18/** Max number of pages that can be used in a single read request */ 18/** Max number of pages that can be used in a single read request */
19#define FUSE_MAX_PAGES_PER_REQ 32 19#define FUSE_MAX_PAGES_PER_REQ 32
@@ -135,9 +135,6 @@ struct fuse_req {
135 fuse_conn */ 135 fuse_conn */
136 struct list_head list; 136 struct list_head list;
137 137
138 /** Entry on the background list */
139 struct list_head bg_entry;
140
141 /** refcount */ 138 /** refcount */
142 atomic_t count; 139 atomic_t count;
143 140
@@ -150,6 +147,9 @@ struct fuse_req {
150 /** True if the request has reply */ 147 /** True if the request has reply */
151 unsigned isreply:1; 148 unsigned isreply:1;
152 149
150 /** Force sending of the request even if interrupted */
151 unsigned force:1;
152
153 /** The request was interrupted */ 153 /** The request was interrupted */
154 unsigned interrupted:1; 154 unsigned interrupted:1;
155 155
@@ -192,15 +192,15 @@ struct fuse_req {
192 /** offset of data on first page */ 192 /** offset of data on first page */
193 unsigned page_offset; 193 unsigned page_offset;
194 194
195 /** Inode used in the request */
196 struct inode *inode;
197
198 /** Second inode used in the request (or NULL) */
199 struct inode *inode2;
200
201 /** File used in the request (or NULL) */ 195 /** File used in the request (or NULL) */
202 struct file *file; 196 struct file *file;
203 197
198 /** vfsmount used in release */
199 struct vfsmount *vfsmount;
200
201 /** dentry used in release */
202 struct dentry *dentry;
203
204 /** Request completion callback */ 204 /** Request completion callback */
205 void (*end)(struct fuse_conn *, struct fuse_req *); 205 void (*end)(struct fuse_conn *, struct fuse_req *);
206}; 206};
@@ -243,10 +243,6 @@ struct fuse_conn {
243 /** The list of requests under I/O */ 243 /** The list of requests under I/O */
244 struct list_head io; 244 struct list_head io;
245 245
246 /** Requests put in the background (RELEASE or any other
247 interrupted request) */
248 struct list_head background;
249
250 /** Number of requests currently in the background */ 246 /** Number of requests currently in the background */
251 unsigned num_background; 247 unsigned num_background;
252 248
@@ -258,15 +254,9 @@ struct fuse_conn {
258 /** waitq for blocked connection */ 254 /** waitq for blocked connection */
259 wait_queue_head_t blocked_waitq; 255 wait_queue_head_t blocked_waitq;
260 256
261 /** RW semaphore for exclusion with fuse_put_super() */
262 struct rw_semaphore sbput_sem;
263
264 /** The next unique request id */ 257 /** The next unique request id */
265 u64 reqctr; 258 u64 reqctr;
266 259
267 /** Mount is active */
268 unsigned mounted;
269
270 /** Connection established, cleared on umount, connection 260 /** Connection established, cleared on umount, connection
271 abort and device release */ 261 abort and device release */
272 unsigned connected; 262 unsigned connected;
@@ -383,12 +373,9 @@ void fuse_file_free(struct fuse_file *ff);
383void fuse_finish_open(struct inode *inode, struct file *file, 373void fuse_finish_open(struct inode *inode, struct file *file,
384 struct fuse_file *ff, struct fuse_open_out *outarg); 374 struct fuse_file *ff, struct fuse_open_out *outarg);
385 375
386/** 376/** */
387 * Send a RELEASE request 377struct fuse_req *fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags,
388 */ 378 int opcode);
389void fuse_send_release(struct fuse_conn *fc, struct fuse_file *ff,
390 u64 nodeid, struct inode *inode, int flags, int isdir);
391
392/** 379/**
393 * Send RELEASE or RELEASEDIR request 380 * Send RELEASE or RELEASEDIR request
394 */ 381 */
@@ -446,11 +433,6 @@ struct fuse_req *fuse_request_alloc(void);
446void fuse_request_free(struct fuse_req *req); 433void fuse_request_free(struct fuse_req *req);
447 434
448/** 435/**
449 * Reinitialize a request, the preallocated flag is left unmodified
450 */
451void fuse_reset_request(struct fuse_req *req);
452
453/**
454 * Reserve a preallocated request 436 * Reserve a preallocated request
455 */ 437 */
456struct fuse_req *fuse_get_req(struct fuse_conn *fc); 438struct fuse_req *fuse_get_req(struct fuse_conn *fc);
@@ -476,11 +458,6 @@ void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req);
476 */ 458 */
477void request_send_background(struct fuse_conn *fc, struct fuse_req *req); 459void request_send_background(struct fuse_conn *fc, struct fuse_req *req);
478 460
479/**
480 * Release inodes and file associated with background request
481 */
482void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req);
483
484/* Abort all requests */ 461/* Abort all requests */
485void fuse_abort_conn(struct fuse_conn *fc); 462void fuse_abort_conn(struct fuse_conn *fc);
486 463