diff options
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 | } |