diff options
author | Ayan George <ayan@ayan.net> | 2011-09-21 04:02:13 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2011-09-21 04:02:13 -0400 |
commit | 4c823cc3d568277aa6340d8df6981e34f4c4dee5 (patch) | |
tree | 69d160a2baf1c6d346b1e4978cb294a2af9ad66f /drivers/block/loop.c | |
parent | 8a9c594422ecad912d6470888acdee9a1236ad68 (diff) |
drivers/block/loop.c: remove unnecessary bdev argument from loop_clr_fd()
If the loop device is associated (lo->lo_state == Lo_bound), it will have
a valid bdev pointed to by lo->lo_device. There is no reason to ever pass
an additional block_device pointer.
Signed-off-by: Ayan George <ayan.george@canonical.com>
Cc: Phillip Susi <psusi@cfl.rr.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r-- | drivers/block/loop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index c2ce03cf3a58..9b2f5d3c19ab 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -1051,10 +1051,11 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer, | |||
1051 | return err; | 1051 | return err; |
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev) | 1054 | static int loop_clr_fd(struct loop_device *lo) |
1055 | { | 1055 | { |
1056 | struct file *filp = lo->lo_backing_file; | 1056 | struct file *filp = lo->lo_backing_file; |
1057 | gfp_t gfp = lo->old_gfp_mask; | 1057 | gfp_t gfp = lo->old_gfp_mask; |
1058 | struct block_device *bdev = lo->lo_device; | ||
1058 | 1059 | ||
1059 | if (lo->lo_state != Lo_bound) | 1060 | if (lo->lo_state != Lo_bound) |
1060 | return -ENXIO; | 1061 | return -ENXIO; |
@@ -1372,7 +1373,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode, | |||
1372 | break; | 1373 | break; |
1373 | case LOOP_CLR_FD: | 1374 | case LOOP_CLR_FD: |
1374 | /* loop_clr_fd would have unlocked lo_ctl_mutex on success */ | 1375 | /* loop_clr_fd would have unlocked lo_ctl_mutex on success */ |
1375 | err = loop_clr_fd(lo, bdev); | 1376 | err = loop_clr_fd(lo); |
1376 | if (!err) | 1377 | if (!err) |
1377 | goto out_unlocked; | 1378 | goto out_unlocked; |
1378 | break; | 1379 | break; |
@@ -1583,7 +1584,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode) | |||
1583 | * In autoclear mode, stop the loop thread | 1584 | * In autoclear mode, stop the loop thread |
1584 | * and remove configuration after last close. | 1585 | * and remove configuration after last close. |
1585 | */ | 1586 | */ |
1586 | err = loop_clr_fd(lo, lo->lo_device); | 1587 | err = loop_clr_fd(lo); |
1587 | if (!err) | 1588 | if (!err) |
1588 | goto out_unlocked; | 1589 | goto out_unlocked; |
1589 | } else { | 1590 | } else { |