diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2009-05-13 12:55:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-19 01:15:56 -0400 |
commit | 690cc3ffe33ac4a2857583c22d4c6244ae11684d (patch) | |
tree | 47da7801ef7539260a1a64b41f43ab8131e4f551 /include | |
parent | 69e3c75f4d541a6eb151b3ef91f34033cb3ad6e1 (diff) |
syscall: Implement a convinience function restart_syscall
Currently when we have a signal pending we have the functionality
to restart that the current system call. There are other cases
such as nasty lock ordering issues where it makes sense to have
a simple fix that uses try lock and restarts the system call.
Buying time to figure out how to rework the locking strategy.
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index b4c38bc8049c..d853f6bb0baf 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2178,6 +2178,12 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) | |||
2178 | return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); | 2178 | return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); |
2179 | } | 2179 | } |
2180 | 2180 | ||
2181 | static inline int restart_syscall(void) | ||
2182 | { | ||
2183 | set_tsk_thread_flag(current, TIF_SIGPENDING); | ||
2184 | return -ERESTARTNOINTR; | ||
2185 | } | ||
2186 | |||
2181 | static inline int signal_pending(struct task_struct *p) | 2187 | static inline int signal_pending(struct task_struct *p) |
2182 | { | 2188 | { |
2183 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); | 2189 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); |