diff --git a/drivers/block/loop.c b/drivers/block/loop.c index dbf31ec..52e1339 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -85,6 +85,7 @@ static int max_part; static int part_shift; /* + * Transfer functions */ static int transfer_none(struct loop_device *lo, int cmd, @@ -999,9 +1000,10 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer, return err; } -static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev) +static int loop_clr_fd(struct loop_device *lo) { struct file *filp = lo->lo_backing_file; + struct block_device *bdev = lo->lo_device; gfp_t gfp = lo->old_gfp_mask; if (lo->lo_state != Lo_bound) @@ -1311,7 +1313,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode, break; case LOOP_CLR_FD: /* loop_clr_fd would have unlocked lo_ctl_mutex on success */ - err = loop_clr_fd(lo, bdev); + err = loop_clr_fd(lo); if (!err) goto out_unlocked; break; @@ -1522,7 +1524,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode) * In autoclear mode, stop the loop thread * and remove configuration after last close. */ - err = loop_clr_fd(lo, NULL); + err = loop_clr_fd(lo); if (!err) goto out_unlocked; } else {