diff options
author | NeilBrown <neilb@suse.com> | 2018-05-21 14:35:12 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-25 18:29:10 +0200 |
commit | 6afe572bc76688cd840032254217a4877b66e916 (patch) | |
tree | e1021ca8f7a0064d286146e895027228ea91a51d /drivers/staging/lustre/lustre/llite/llite_mmap.c | |
parent | staging: lustre: move LERRCHKSUM() to libcfs_debug.h (diff) | |
download | linux-dev-6afe572bc76688cd840032254217a4877b66e916.tar.xz linux-dev-6afe572bc76688cd840032254217a4877b66e916.zip |
staging: lustre: discard cfs_block_sigsinv()
cfs_block_sigsinv() and cfs_restore_sigs() are simple
wrappers which save a couple of line of code and
hurt readability for people not familiar with them.
They aren't used often enough to be worthwhile,
so discard them and open-code the functionality.
The sigorsets() call isn't needed as or-ing with current->blocked is
exactly what sigprocmask(SIG_BLOCK) does.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/llite_mmap.c')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/llite_mmap.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c index 214b07554e62..d7fb5533f707 100644 --- a/drivers/staging/lustre/lustre/llite/llite_mmap.c +++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c @@ -152,7 +152,7 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage, struct vvp_io *vio; int result; u16 refcheck; - sigset_t set; + sigset_t old, new; struct inode *inode; struct ll_inode_info *lli; @@ -177,14 +177,15 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage, vio->u.fault.ft_vma = vma; vio->u.fault.ft_vmpage = vmpage; - cfs_block_sigsinv(sigmask(SIGKILL) | sigmask(SIGTERM), &set); + siginitsetinv(&new, sigmask(SIGKILL) | sigmask(SIGTERM)); + sigprocmask(SIG_BLOCK, &new, &old); inode = vvp_object_inode(io->ci_obj); lli = ll_i2info(inode); result = cl_io_loop(env, io); - cfs_restore_sigs(&set); + sigprocmask(SIG_SETMASK, &old, NULL); if (result == 0) { struct inode *inode = file_inode(vma->vm_file); @@ -328,13 +329,14 @@ static int ll_fault(struct vm_fault *vmf) int count = 0; bool printed = false; int result; - sigset_t set; + sigset_t old, new; /* Only SIGKILL and SIGTERM are allowed for fault/nopage/mkwrite * so that it can be killed by admin but not cause segfault by * other signals. */ - cfs_block_sigsinv(sigmask(SIGKILL) | sigmask(SIGTERM), &set); + siginitsetinv(&new, sigmask(SIGKILL) | sigmask(SIGTERM)); + sigprocmask(SIG_BLOCK, &new, &old); restart: result = ll_fault0(vmf->vma, vmf); @@ -360,7 +362,7 @@ restart: result = VM_FAULT_LOCKED; } - cfs_restore_sigs(&set); + sigprocmask(SIG_SETMASK, &old, NULL); return result; } |