* Defined by platform
*/
int unshare_fs_struct(void);
-sigset_t cfs_block_sigs(unsigned long sigs);
sigset_t cfs_block_sigsinv(unsigned long sigs);
void cfs_restore_sigs(sigset_t);
-void cfs_clear_sigpending(void);
int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
#define ___wait_event_idle(wq_head, condition, exclusive, ret, cmd) \
({ \
wait_queue_entry_t __wq_entry; \
+ unsigned long flags; \
long __ret = ret; /* explicit shadow */ \
sigset_t __blocked; \
\
if (condition) \
break; \
/* See justification in __l_wait_event */ \
- if (signal_pending(current)) \
- cfs_clear_sigpending(); \
- \
+ if (signal_pending(current)) { \
+ spin_lock_irqsave(¤t->sighand->siglock, \
+ flags); \
+ clear_tsk_thread_flag(current, TIF_SIGPENDING); \
+ spin_unlock_irqrestore(¤t->sighand->siglock,\
+ flags); \
+ } \
cmd; \
} \
finish_wait(&wq_head, &__wq_entry); \
#define ___wait_event_lifo(wq_head, condition, ret, cmd) \
({ \
wait_queue_entry_t __wq_entry; \
+ unsigned long flags; \
long __ret = ret; /* explicit shadow */ \
sigset_t __blocked; \
\
if (condition) \
break; \
/* See justification in __l_wait_event */ \
- if (signal_pending(current)) \
- cfs_clear_sigpending(); \
- \
+ if (signal_pending(current)) { \
+ spin_lock_irqsave(¤t->sighand->siglock, \
+ flags); \
+ clear_tsk_thread_flag(current, TIF_SIGPENDING); \
+ spin_unlock_irqrestore(¤t->sighand->siglock,\
+ flags); \
+ } \
cmd; \
} \
cfs_restore_sigs(__blocked); \
EXPORT_SYMBOL(kstrtobool_from_user);
#endif /* !HAVE_KSTRTOBOOL_FROM_USER */
-sigset_t cfs_block_sigs(unsigned long sigs)
-{
- unsigned long flags;
- sigset_t old;
-
- spin_lock_irqsave(¤t->sighand->siglock, flags);
- old = current->blocked;
- sigaddsetmask(¤t->blocked, sigs);
- recalc_sigpending();
- spin_unlock_irqrestore(¤t->sighand->siglock, flags);
- return old;
-}
-EXPORT_SYMBOL(cfs_block_sigs);
-
/* Block all signals except for the @sigs */
sigset_t cfs_block_sigsinv(unsigned long sigs)
{
spin_unlock_irqrestore(¤t->sighand->siglock, flags);
}
EXPORT_SYMBOL(cfs_restore_sigs);
-
-void
-cfs_clear_sigpending(void)
-{
- unsigned long flags;
-
- spin_lock_irqsave(¤t->sighand->siglock, flags);
- clear_tsk_thread_flag(current, TIF_SIGPENDING);
- spin_unlock_irqrestore(¤t->sighand->siglock, flags);
-}
-EXPORT_SYMBOL(cfs_clear_sigpending);
if (condition) \
break; \
if (signal_pending(current)) { \
+ unsigned long flags; \
+ \
if (info->lwi_on_signal != NULL && \
(__timeout == 0 || __allow_intr)) { \
if (info->lwi_on_signal != LWI_ON_SIGNAL_NOOP) \
/* -EINTR when the RPC actually succeeded. */ \
/* the recalc_sigpending() below will deliver the */ \
/* signal properly. */ \
- cfs_clear_sigpending(); \
+ spin_lock_irqsave(¤t->sighand->siglock, flags); \
+ clear_tsk_thread_flag(current, TIF_SIGPENDING); \
+ spin_unlock_irqrestore(¤t->sighand->siglock, flags);\
} \
} \
\