aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/fuse_i.h
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-04-11 01:54:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:49 -0400
commitce1d5a491f0ee50560416a73faa5e4ddbab074bd (patch)
tree21f91d983b467ad05df0213f54fe00aad84e5761 /fs/fuse/fuse_i.h
parenta87046d822f2d982d25b24c4a644d34f22d4888a (diff)
[PATCH] fuse: clean up request accounting
FUSE allocated most requests from a fixed size pool filled at mount time. However in some cases (release/forget) non-pool requests were used. File locking operations aren't well served by the request pool, since they may block indefinetly thus exhausting the pool. This patch removes the request pool and always allocates requests on demand. 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.h26
1 files changed, 5 insertions, 21 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 6ed812fd6200..242e69cb1251 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -18,9 +18,6 @@
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
20 20
21/** If more requests are outstanding, then the operation will block */
22#define FUSE_MAX_OUTSTANDING 10
23
24/** It could be as large as PATH_MAX, but would that have any uses? */ 21/** It could be as large as PATH_MAX, but would that have any uses? */
25#define FUSE_NAME_MAX 1024 22#define FUSE_NAME_MAX 1024
26 23
@@ -131,8 +128,8 @@ struct fuse_conn;
131 * A request to the client 128 * A request to the client
132 */ 129 */
133struct fuse_req { 130struct fuse_req {
134 /** This can be on either unused_list, pending processing or 131 /** This can be on either pending processing or io lists in
135 io lists in fuse_conn */ 132 fuse_conn */
136 struct list_head list; 133 struct list_head list;
137 134
138 /** Entry on the background list */ 135 /** Entry on the background list */
@@ -150,9 +147,6 @@ 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
153 /** The request is preallocated */
154 unsigned preallocated:1;
155
156 /** The request was interrupted */ 150 /** The request was interrupted */
157 unsigned interrupted:1; 151 unsigned interrupted:1;
158 152
@@ -247,19 +241,9 @@ struct fuse_conn {
247 interrupted request) */ 241 interrupted request) */
248 struct list_head background; 242 struct list_head background;
249 243
250 /** Controls the maximum number of outstanding requests */
251 struct semaphore outstanding_sem;
252
253 /** This counts the number of outstanding requests if
254 outstanding_sem would go negative */
255 unsigned outstanding_debt;
256
257 /** RW semaphore for exclusion with fuse_put_super() */ 244 /** RW semaphore for exclusion with fuse_put_super() */
258 struct rw_semaphore sbput_sem; 245 struct rw_semaphore sbput_sem;
259 246
260 /** The list of unused requests */
261 struct list_head unused_list;
262
263 /** The next unique request id */ 247 /** The next unique request id */
264 u64 reqctr; 248 u64 reqctr;
265 249
@@ -452,11 +436,11 @@ void fuse_reset_request(struct fuse_req *req);
452/** 436/**
453 * Reserve a preallocated request 437 * Reserve a preallocated request
454 */ 438 */
455struct fuse_req *fuse_get_request(struct fuse_conn *fc); 439struct fuse_req *fuse_get_req(struct fuse_conn *fc);
456 440
457/** 441/**
458 * Decrement reference count of a request. If count goes to zero put 442 * Decrement reference count of a request. If count goes to zero free
459 * on unused list (preallocated) or free request (not preallocated). 443 * the request.
460 */ 444 */
461void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req); 445void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req);
462 446