summaryrefslogtreecommitdiff
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 176adcff56b3..ed7e836efbcd 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2375,16 +2375,11 @@ out:
*/
static int lock_fs(struct mapped_device *md)
{
- struct block_device *bdev;
int r;
WARN_ON(test_bit(DMF_FROZEN, &md->flags));
- bdev = bdget_disk(md->disk, 0);
- if (!bdev)
- return -ENOMEM;
- r = freeze_bdev(bdev);
- bdput(bdev);
+ r = freeze_bdev(md->disk->part0);
if (!r)
set_bit(DMF_FROZEN, &md->flags);
return r;
@@ -2392,16 +2387,9 @@ static int lock_fs(struct mapped_device *md)
static void unlock_fs(struct mapped_device *md)
{
- struct block_device *bdev;
-
if (!test_bit(DMF_FROZEN, &md->flags))
return;
-
- bdev = bdget_disk(md->disk, 0);
- if (!bdev)
- return;
- thaw_bdev(bdev);
- bdput(bdev);
+ thaw_bdev(md->disk->part0);
clear_bit(DMF_FROZEN, &md->flags);
}