diff options
author | Jes Sorensen <jes@sgi.com> | 2006-01-09 18:59:24 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@hera.kernel.org> | 2006-01-09 18:59:24 -0500 |
commit | 1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch) | |
tree | b0b36d4f41d28c9d6514fb309d33c1a084d6309b /mm/swapfile.c | |
parent | 794ee1baee1c26be40410233e6c20bceb2b03c08 (diff) |
[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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 80f948a2028b..6544565a7c0f 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1187,9 +1187,9 @@ asmlinkage long sys_swapoff(const char __user * specialfile) | |||
1187 | set_blocksize(bdev, p->old_block_size); | 1187 | set_blocksize(bdev, p->old_block_size); |
1188 | bd_release(bdev); | 1188 | bd_release(bdev); |
1189 | } else { | 1189 | } else { |
1190 | down(&inode->i_sem); | 1190 | mutex_lock(&inode->i_mutex); |
1191 | inode->i_flags &= ~S_SWAPFILE; | 1191 | inode->i_flags &= ~S_SWAPFILE; |
1192 | up(&inode->i_sem); | 1192 | mutex_unlock(&inode->i_mutex); |
1193 | } | 1193 | } |
1194 | filp_close(swap_file, NULL); | 1194 | filp_close(swap_file, NULL); |
1195 | err = 0; | 1195 | err = 0; |
@@ -1406,7 +1406,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) | |||
1406 | p->bdev = bdev; | 1406 | p->bdev = bdev; |
1407 | } else if (S_ISREG(inode->i_mode)) { | 1407 | } else if (S_ISREG(inode->i_mode)) { |
1408 | p->bdev = inode->i_sb->s_bdev; | 1408 | p->bdev = inode->i_sb->s_bdev; |
1409 | down(&inode->i_sem); | 1409 | mutex_lock(&inode->i_mutex); |
1410 | did_down = 1; | 1410 | did_down = 1; |
1411 | if (IS_SWAPFILE(inode)) { | 1411 | if (IS_SWAPFILE(inode)) { |
1412 | error = -EBUSY; | 1412 | error = -EBUSY; |
@@ -1596,7 +1596,7 @@ out: | |||
1596 | if (did_down) { | 1596 | if (did_down) { |
1597 | if (!error) | 1597 | if (!error) |
1598 | inode->i_flags |= S_SWAPFILE; | 1598 | inode->i_flags |= S_SWAPFILE; |
1599 | up(&inode->i_sem); | 1599 | mutex_unlock(&inode->i_mutex); |
1600 | } | 1600 | } |
1601 | return error; | 1601 | return error; |
1602 | } | 1602 | } |