summaryrefslogtreecommitdiff
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-09 15:59:24 -0800
committerIngo Molnar <mingo@hera.kernel.org>2006-01-09 15:59:24 -0800
commit1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch)
treeb0b36d4f41d28c9d6514fb309d33c1a084d6309b /mm/swapfile.c
parent794ee1baee1c26be40410233e6c20bceb2b03c08 (diff)
downloadlinux-3.10-1b1dcc1b57a49136f118a0f16367256ff9994a69.tar.gz
linux-3.10-1b1dcc1b57a49136f118a0f16367256ff9994a69.tar.bz2
linux-3.10-1b1dcc1b57a49136f118a0f16367256ff9994a69.zip
[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on XFS and compiled as much as one can consider on an ia64. Anyway your luck with it might be different. Modified-by: Ingo Molnar <mingo@elte.hu> (finished the conversion) Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 80f948a2028..6544565a7c0 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1187,9 +1187,9 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
set_blocksize(bdev, p->old_block_size);
bd_release(bdev);
} else {
- down(&inode->i_sem);
+ mutex_lock(&inode->i_mutex);
inode->i_flags &= ~S_SWAPFILE;
- up(&inode->i_sem);
+ mutex_unlock(&inode->i_mutex);
}
filp_close(swap_file, NULL);
err = 0;
@@ -1406,7 +1406,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
p->bdev = bdev;
} else if (S_ISREG(inode->i_mode)) {
p->bdev = inode->i_sb->s_bdev;
- down(&inode->i_sem);
+ mutex_lock(&inode->i_mutex);
did_down = 1;
if (IS_SWAPFILE(inode)) {
error = -EBUSY;
@@ -1596,7 +1596,7 @@ out:
if (did_down) {
if (!error)
inode->i_flags |= S_SWAPFILE;
- up(&inode->i_sem);
+ mutex_unlock(&inode->i_mutex);
}
return error;
}