diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2010-11-27 13:49:18 -0500 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-11-27 13:49:18 -0500 |
commit | f30195c50245d8ace628e1978b1daa8df86e7224 (patch) | |
tree | edf4f91c4356c41d50fb07f15cebd1e6442538ad /mm | |
parent | d07335e51df0c6dec202d315fc4f1f7e100eec4e (diff) | |
parent | d4d77629953eabd3c14f6fa5746f6b28babfc55f (diff) |
Merge branch 'cleanup-bd_claim' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc into for-2.6.38/core
Diffstat (limited to 'mm')
-rw-r--r-- | mm/swapfile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 67ddaaf98c74..b6adcfbf6f48 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1677,7 +1677,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) | |||
1677 | if (S_ISBLK(inode->i_mode)) { | 1677 | if (S_ISBLK(inode->i_mode)) { |
1678 | struct block_device *bdev = I_BDEV(inode); | 1678 | struct block_device *bdev = I_BDEV(inode); |
1679 | set_blocksize(bdev, p->old_block_size); | 1679 | set_blocksize(bdev, p->old_block_size); |
1680 | bd_release(bdev); | 1680 | blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL); |
1681 | } else { | 1681 | } else { |
1682 | mutex_lock(&inode->i_mutex); | 1682 | mutex_lock(&inode->i_mutex); |
1683 | inode->i_flags &= ~S_SWAPFILE; | 1683 | inode->i_flags &= ~S_SWAPFILE; |
@@ -1939,7 +1939,8 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) | |||
1939 | error = -EINVAL; | 1939 | error = -EINVAL; |
1940 | if (S_ISBLK(inode->i_mode)) { | 1940 | if (S_ISBLK(inode->i_mode)) { |
1941 | bdev = I_BDEV(inode); | 1941 | bdev = I_BDEV(inode); |
1942 | error = bd_claim(bdev, sys_swapon); | 1942 | error = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, |
1943 | sys_swapon); | ||
1943 | if (error < 0) { | 1944 | if (error < 0) { |
1944 | bdev = NULL; | 1945 | bdev = NULL; |
1945 | error = -EINVAL; | 1946 | error = -EINVAL; |
@@ -2136,7 +2137,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) | |||
2136 | bad_swap: | 2137 | bad_swap: |
2137 | if (bdev) { | 2138 | if (bdev) { |
2138 | set_blocksize(bdev, p->old_block_size); | 2139 | set_blocksize(bdev, p->old_block_size); |
2139 | bd_release(bdev); | 2140 | blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL); |
2140 | } | 2141 | } |
2141 | destroy_swap_extents(p); | 2142 | destroy_swap_extents(p); |
2142 | swap_cgroup_swapoff(type); | 2143 | swap_cgroup_swapoff(type); |