Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be0ef957c9eed4ebae873ee3fbcfb9dfde486dec
Commit:     be0ef957c9eed4ebae873ee3fbcfb9dfde486dec
Parent:     3e1ac130d08b0c7066615fe60fe1e7212c8eaf6a
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 15 23:41:32 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 09:05:50 2007 -0700

    nbd.c: sock_xmit: cleanup signal related code
    
    sock_xmit() re-implements sigprocmask() and dequeue_signal_lock().
    
    Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Acked-by: Paul Clements <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/block/nbd.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index c575fb1..c129510 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -122,17 +122,12 @@ static int sock_xmit(struct socket *sock, int send, void 
*buf, int size,
        int result;
        struct msghdr msg;
        struct kvec iov;
-       unsigned long flags;
-       sigset_t oldset;
+       sigset_t blocked, oldset;
 
        /* Allow interception of SIGKILL only
         * Don't allow other signals to interrupt the transmission */
-       spin_lock_irqsave(&current->sighand->siglock, flags);
-       oldset = current->blocked;
-       sigfillset(&current->blocked);
-       sigdelsetmask(&current->blocked, sigmask(SIGKILL));
-       recalc_sigpending();
-       spin_unlock_irqrestore(&current->sighand->siglock, flags);
+       siginitsetinv(&blocked, sigmask(SIGKILL));
+       sigprocmask(SIG_SETMASK, &blocked, &oldset);
 
        do {
                sock->sk->sk_allocation = GFP_NOIO;
@@ -151,11 +146,9 @@ static int sock_xmit(struct socket *sock, int send, void 
*buf, int size,
 
                if (signal_pending(current)) {
                        siginfo_t info;
-                       spin_lock_irqsave(&current->sighand->siglock, flags);
                        printk(KERN_WARNING "nbd (pid %d: %s) got signal %d\n",
-                               current->pid, current->comm, 
-                               dequeue_signal(current, &current->blocked, 
&info));
-                       spin_unlock_irqrestore(&current->sighand->siglock, 
flags);
+                               current->pid, current->comm,
+                               dequeue_signal_lock(current, &current->blocked, 
&info));
                        result = -EINTR;
                        break;
                }
@@ -169,10 +162,7 @@ static int sock_xmit(struct socket *sock, int send, void 
*buf, int size,
                buf += result;
        } while (size > 0);
 
-       spin_lock_irqsave(&current->sighand->siglock, flags);
-       current->blocked = oldset;
-       recalc_sigpending();
-       spin_unlock_irqrestore(&current->sighand->siglock, flags);
+       sigprocmask(SIG_SETMASK, &oldset, NULL);
 
        return result;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to