Whamcloud - gitweb
LU-1346 libcfs: cleanup macros in portals_compat25.h
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-prim.c
index e399b77..27d95e9 100644 (file)
@@ -262,16 +262,15 @@ void cfs_enter_debugger(void)
 sigset_t
 cfs_block_allsigs(void)
 {
-        unsigned long          flags;
-        sigset_t        old;
-
-        SIGNAL_MASK_LOCK(current, flags);
-        old = current->blocked;
-        sigfillset(&current->blocked);
-        RECALC_SIGPENDING;
-        SIGNAL_MASK_UNLOCK(current, flags);
+       unsigned long   flags;
+       sigset_t        old;
 
-        return old;
+       spin_lock_irqsave(&current->sighand->siglock, flags);
+       old = current->blocked;
+       sigfillset(&current->blocked);
+       recalc_sigpending();
+       spin_unlock_irqrestore(&current->sighand->siglock, flags);
+       return old;
 }
 
 sigset_t cfs_block_sigs(unsigned long sigs)
@@ -279,11 +278,11 @@ sigset_t cfs_block_sigs(unsigned long sigs)
        unsigned long  flags;
        sigset_t        old;
 
-       SIGNAL_MASK_LOCK(current, flags);
+       spin_lock_irqsave(&current->sighand->siglock, flags);
        old = current->blocked;
        sigaddsetmask(&current->blocked, sigs);
-       RECALC_SIGPENDING;
-       SIGNAL_MASK_UNLOCK(current, flags);
+       recalc_sigpending();
+       spin_unlock_irqrestore(&current->sighand->siglock, flags);
        return old;
 }
 
@@ -293,40 +292,39 @@ sigset_t cfs_block_sigsinv(unsigned long sigs)
        unsigned long flags;
        sigset_t old;
 
-       SIGNAL_MASK_LOCK(current, flags);
+       spin_lock_irqsave(&current->sighand->siglock, flags);
        old = current->blocked;
        sigaddsetmask(&current->blocked, ~sigs);
-       RECALC_SIGPENDING;
-       SIGNAL_MASK_UNLOCK(current, flags);
-
+       recalc_sigpending();
+       spin_unlock_irqrestore(&current->sighand->siglock, flags);
        return old;
 }
 
 void
 cfs_restore_sigs (cfs_sigset_t old)
 {
-        unsigned long  flags;
+       unsigned long  flags;
 
-        SIGNAL_MASK_LOCK(current, flags);
-        current->blocked = old;
-        RECALC_SIGPENDING;
-        SIGNAL_MASK_UNLOCK(current, flags);
+       spin_lock_irqsave(&current->sighand->siglock, flags);
+       current->blocked = old;
+       recalc_sigpending();
+       spin_unlock_irqrestore(&current->sighand->siglock, flags);
 }
 
 int
 cfs_signal_pending(void)
 {
-        return signal_pending(current);
+       return signal_pending(current);
 }
 
 void
 cfs_clear_sigpending(void)
 {
-        unsigned long flags;
+       unsigned long flags;
 
-        SIGNAL_MASK_LOCK(current, flags);
-        CLEAR_SIGPENDING;
-        SIGNAL_MASK_UNLOCK(current, flags);
+       spin_lock_irqsave(&current->sighand->siglock, flags);
+       clear_tsk_thread_flag(current, TIF_SIGPENDING);
+       spin_unlock_irqrestore(&current->sighand->siglock, flags);
 }
 
 int