]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fuse: don't mess with blocking signals
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 19 Jul 2016 07:08:27 +0000 (03:08 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 19 Jul 2016 07:08:27 +0000 (03:08 -0400)
just use wait_event_killable{,_exclusive}().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fuse/dev.c

index cbece1221417bb0ad5c60a143c724e6b3a5b06e8..9406f35d1a1ee3c312963d99447105d6c202af89 100644 (file)
@@ -99,19 +99,6 @@ void fuse_request_free(struct fuse_req *req)
        kmem_cache_free(fuse_req_cachep, req);
 }
 
-static void block_sigs(sigset_t *oldset)
-{
-       sigset_t mask;
-
-       siginitsetinv(&mask, sigmask(SIGKILL));
-       sigprocmask(SIG_BLOCK, &mask, oldset);
-}
-
-static void restore_sigs(sigset_t *oldset)
-{
-       sigprocmask(SIG_SETMASK, oldset, NULL);
-}
-
 void __fuse_get_request(struct fuse_req *req)
 {
        atomic_inc(&req->count);
@@ -151,15 +138,9 @@ static struct fuse_req *__fuse_get_req(struct fuse_conn *fc, unsigned npages,
        atomic_inc(&fc->num_waiting);
 
        if (fuse_block_alloc(fc, for_background)) {
-               sigset_t oldset;
-               int intr;
-
-               block_sigs(&oldset);
-               intr = wait_event_interruptible_exclusive(fc->blocked_waitq,
-                               !fuse_block_alloc(fc, for_background));
-               restore_sigs(&oldset);
                err = -EINTR;
-               if (intr)
+               if (wait_event_killable_exclusive(fc->blocked_waitq,
+                               !fuse_block_alloc(fc, for_background)))
                        goto out;
        }
        /* Matches smp_wmb() in fuse_set_initialized() */
@@ -446,14 +427,9 @@ static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req)
        }
 
        if (!test_bit(FR_FORCE, &req->flags)) {
-               sigset_t oldset;
-
                /* Only fatal signals may interrupt this */
-               block_sigs(&oldset);
-               err = wait_event_interruptible(req->waitq,
+               err = wait_event_killable(req->waitq,
                                        test_bit(FR_FINISHED, &req->flags));
-               restore_sigs(&oldset);
-
                if (!err)
                        return;