|
@@ -1051,10 +1051,11 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer,
|
|
return err;
|
|
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 file *filp = lo->lo_backing_file;
|
|
gfp_t gfp = lo->old_gfp_mask;
|
|
gfp_t gfp = lo->old_gfp_mask;
|
|
|
|
+ struct block_device *bdev = lo->lo_device;
|
|
|
|
|
|
if (lo->lo_state != Lo_bound)
|
|
if (lo->lo_state != Lo_bound)
|
|
return -ENXIO;
|
|
return -ENXIO;
|
|
@@ -1372,7 +1373,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
|
|
break;
|
|
break;
|
|
case LOOP_CLR_FD:
|
|
case LOOP_CLR_FD:
|
|
/* loop_clr_fd would have unlocked lo_ctl_mutex on success */
|
|
/* loop_clr_fd would have unlocked lo_ctl_mutex on success */
|
|
- err = loop_clr_fd(lo, bdev);
|
|
|
|
|
|
+ err = loop_clr_fd(lo);
|
|
if (!err)
|
|
if (!err)
|
|
goto out_unlocked;
|
|
goto out_unlocked;
|
|
break;
|
|
break;
|
|
@@ -1583,7 +1584,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode)
|
|
* In autoclear mode, stop the loop thread
|
|
* In autoclear mode, stop the loop thread
|
|
* and remove configuration after last close.
|
|
* and remove configuration after last close.
|
|
*/
|
|
*/
|
|
- err = loop_clr_fd(lo, lo->lo_device);
|
|
|
|
|
|
+ err = loop_clr_fd(lo);
|
|
if (!err)
|
|
if (!err)
|
|
goto out_unlocked;
|
|
goto out_unlocked;
|
|
} else {
|
|
} else {
|