cleanup
authorMiklos Szeredi <miklos@szeredi.hu>
Mon, 10 Jan 2005 11:50:10 +0000 (11:50 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Mon, 10 Jan 2005 11:50:10 +0000 (11:50 +0000)
kernel/dev.c

index e04fe3c22fcedd6fd051d55c2833af30cb452f65..d09aa9952f55e67df5304b8c6e7d984beb428ba9 100644 (file)
@@ -178,8 +178,10 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
        wake_up(&req->waitq);
        if (req->in.h.opcode == FUSE_INIT) {
                int i;
-               /* up() one less than FUSE_MAX_OUTSTANDING, because
-                  fuse_putback_request() will also do an up() */
+               /* After INIT reply is received other requests can go
+                  out.  So do (FUSE_MAX_OUTSTANDING - 1) number of
+                  up()s on outstanding_sem.  The last up() is done in
+                  fuse_putback_request() */
                for (i = 1; i < FUSE_MAX_OUTSTANDING; i++)
                        up(&fc->outstanding_sem);
        }
@@ -187,16 +189,6 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
                fuse_putback_request(fc, req);
 }
 
-static int request_wait_answer_nonint(struct fuse_req *req)
-{
-       int err;
-       sigset_t oldset;
-       block_sigs(&oldset);
-       err = wait_event_interruptible(req->waitq, req->finished);
-       restore_sigs(&oldset);
-       return err;
-}
-
 static void background_request(struct fuse_req *req)
 {
        /* Need to get hold of the inode(s) and/or file used in the
@@ -210,6 +202,16 @@ static void background_request(struct fuse_req *req)
                get_file(req->file);
 }
 
+static int request_wait_answer_nonint(struct fuse_req *req)
+{
+       int err;
+       sigset_t oldset;
+       block_sigs(&oldset);
+       err = wait_event_interruptible(req->waitq, req->finished);
+       restore_sigs(&oldset);
+       return err;
+}
+
 /* Called with fuse_lock held.  Releases, and then reacquires it. */
 static void request_wait_answer(struct fuse_req *req, int interruptible)
 {
@@ -378,7 +380,6 @@ static inline void unlock_request(struct fuse_req *req)
        }
 }
 
-
 /* Why all this complex one-page-at-a-time copying needed instead of
    just copy_to/from_user()?  The reason is that blocking on a page
    fault must be avoided while the request is locked.  This is because
@@ -828,7 +829,7 @@ static struct miscdevice fuse_miscdevice = {
 int __init fuse_dev_init(void)
 {
        int err = -ENOMEM;
-       fuse_req_cachep = kmem_cache_create("fuser_request",
+       fuse_req_cachep = kmem_cache_create("fuse_request",
                                            sizeof(struct fuse_req),
                                            0, 0, NULL, NULL);
        if (!fuse_req_cachep)