summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-30 08:35:00 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-06 19:43:05 +0100
commite1e584bb545427d1cb754a0831c2520699444114 (patch)
treecb022d81b4896764d01b0df36c8ae38fa556bd62 /drivers/block
parentf1f952b305344a9d3b1b6a9021067d1d9809f5a6 (diff)
Revert "loop: Fold __loop_release into loop_release"
This reverts commit 4ee414c3b6021db621901f2697d35774926268f6 which is commit 967d1dc144b50ad005e5eecdfadfbcfb399ffff6 upstream. It is not needed in the 4.4.y tree at this time. Reported-by: Jan Kara <jack@suse.cz> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/loop.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index c15767ed92e3..ae361ee90587 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1586,15 +1586,12 @@ out:
return err;
}
-static void lo_release(struct gendisk *disk, fmode_t mode)
+static void __lo_release(struct loop_device *lo)
{
- struct loop_device *lo;
int err;
- mutex_lock(&loop_index_mutex);
- lo = disk->private_data;
if (atomic_dec_return(&lo->lo_refcnt))
- goto unlock_index;
+ return;
mutex_lock(&loop_ctl_mutex);
if (lo->lo_flags & LO_FLAGS_AUTOCLEAR) {
@@ -1604,7 +1601,7 @@ static void lo_release(struct gendisk *disk, fmode_t mode)
*/
err = loop_clr_fd(lo);
if (!err)
- goto unlock_index;
+ return;
} else {
/*
* Otherwise keep thread (if running) and config,
@@ -1614,7 +1611,12 @@ static void lo_release(struct gendisk *disk, fmode_t mode)
}
mutex_unlock(&loop_ctl_mutex);
-unlock_index:
+}
+
+static void lo_release(struct gendisk *disk, fmode_t mode)
+{
+ mutex_lock(&loop_index_mutex);
+ __lo_release(disk->private_data);
mutex_unlock(&loop_index_mutex);
}