aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2009-09-02 20:17:36 -0400
committerJoel Becker <joel.becker@oracle.com>2010-05-10 14:50:10 -0400
commite4b963f10e9026c83419b5c25b93a0350413cf16 (patch)
treed162595c9f79626d040cb28c84e53fd8b7fe50ff /fs/ocfs2/super.c
parent0467ae954d1843de65e7cf8f706f88fe65cd8418 (diff)
ocfs2: Wrap signal blocking in void functions.
ocfs2 sometimes needs to block signals around dlm operations, but it currently does it with sigprocmask(). Even worse, it's checking the error code of sigprocmask(). The in-kernel sigprocmask() can only error if you get the SIG_* argument wrong. We don't. Wrap the sigprocmask() calls with ocfs2_[un]block_signals(). These functions are void, but they will BUG() if somehow sigprocmask() returns an error. Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 12c2203a62f..cf6d87b5745 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -2560,5 +2560,25 @@ void __ocfs2_abort(struct super_block* sb,
2560 ocfs2_handle_error(sb); 2560 ocfs2_handle_error(sb);
2561} 2561}
2562 2562
2563/*
2564 * Void signal blockers, because in-kernel sigprocmask() only fails
2565 * when SIG_* is wrong.
2566 */
2567void ocfs2_block_signals(sigset_t *oldset)
2568{
2569 int rc;
2570 sigset_t blocked;
2571
2572 sigfillset(&blocked);
2573 rc = sigprocmask(SIG_BLOCK, &blocked, oldset);
2574 BUG_ON(rc);
2575}
2576
2577void ocfs2_unblock_signals(sigset_t *oldset)
2578{
2579 int rc = sigprocmask(SIG_SETMASK, oldset, NULL);
2580 BUG_ON(rc);
2581}
2582
2563module_init(ocfs2_init); 2583module_init(ocfs2_init);
2564module_exit(ocfs2_exit); 2584module_exit(ocfs2_exit);