]> err.no Git - linux-2.6/blobdiff - fs/fuse/fuse_i.h
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6] / fs / fuse / fuse_i.h
index 6ed812fd62009e73a7a03ef2ce4884a3d7dc64bf..0474202cb5dc09d8b0bd9c75c47d7e01a87b700a 100644 (file)
@@ -18,8 +18,8 @@
 /** Max number of pages that can be used in a single read request */
 #define FUSE_MAX_PAGES_PER_REQ 32
 
-/** If more requests are outstanding, then the operation will block */
-#define FUSE_MAX_OUTSTANDING 10
+/** Maximum number of outstanding background requests */
+#define FUSE_MAX_BACKGROUND 10
 
 /** It could be as large as PATH_MAX, but would that have any uses? */
 #define FUSE_NAME_MAX 1024
@@ -131,8 +131,8 @@ struct fuse_conn;
  * A request to the client
  */
 struct fuse_req {
-       /** This can be on either unused_list, pending processing or
-           io lists in fuse_conn */
+       /** This can be on either pending processing or io lists in
+           fuse_conn */
        struct list_head list;
 
        /** Entry on the background list */
@@ -150,9 +150,6 @@ struct fuse_req {
        /** True if the request has reply */
        unsigned isreply:1;
 
-       /** The request is preallocated */
-       unsigned preallocated:1;
-
        /** The request was interrupted */
        unsigned interrupted:1;
 
@@ -162,6 +159,9 @@ struct fuse_req {
        /** Data is being copied to/from the request */
        unsigned locked:1;
 
+       /** Request is counted as "waiting" */
+       unsigned waiting:1;
+
        /** State of the request */
        enum fuse_req_state state;
 
@@ -247,19 +247,20 @@ struct fuse_conn {
            interrupted request) */
        struct list_head background;
 
-       /** Controls the maximum number of outstanding requests */
-       struct semaphore outstanding_sem;
+       /** Number of requests currently in the background */
+       unsigned num_background;
 
-       /** This counts the number of outstanding requests if
-           outstanding_sem would go negative */
-       unsigned outstanding_debt;
+       /** Flag indicating if connection is blocked.  This will be
+           the case before the INIT reply is received, and if there
+           are too many outstading backgrounds requests */
+       int blocked;
+
+       /** waitq for blocked connection */
+       wait_queue_head_t blocked_waitq;
 
        /** RW semaphore for exclusion with fuse_put_super() */
        struct rw_semaphore sbput_sem;
 
-       /** The list of unused requests */
-       struct list_head unused_list;
-
        /** The next unique request id */
        u64 reqctr;
 
@@ -452,11 +453,11 @@ void fuse_reset_request(struct fuse_req *req);
 /**
  * Reserve a preallocated request
  */
-struct fuse_req *fuse_get_request(struct fuse_conn *fc);
+struct fuse_req *fuse_get_req(struct fuse_conn *fc);
 
 /**
- * Decrement reference count of a request.  If count goes to zero put
- * on unused list (preallocated) or free request (not preallocated).
+ * Decrement reference count of a request.  If count goes to zero free
+ * the request.
  */
 void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req);