summaryrefslogtreecommitdiffstats
path: root/drivers/block/zram
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-21 09:19:50 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-23 18:43:19 +0200
commit0fc66c9d63143f9437cd57cf5eab50a258fa40ec (patch)
tree59be6c2e3e032222581f1b624d3e4119730ee9ba /drivers/block/zram
parentpktcdvd: use blkdev_get_by_dev instead of open coding it (diff)
downloadlinux-0fc66c9d63143f9437cd57cf5eab50a258fa40ec.tar.xz
linux-0fc66c9d63143f9437cd57cf5eab50a258fa40ec.zip
zram: cleanup backing_dev_store
Use blkdev_get_by_dev instead of bdgrab + blkdev_get. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/zram')
-rw-r--r--drivers/block/zram/zram_drv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index a356275605b1..91ccfe444525 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -491,9 +491,10 @@ static ssize_t backing_dev_store(struct device *dev,
goto out;
}
- bdev = bdgrab(I_BDEV(inode));
- err = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram);
- if (err < 0) {
+ bdev = blkdev_get_by_dev(inode->i_rdev,
+ FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram);
+ if (IS_ERR(bdev)) {
+ err = PTR_ERR(bdev);
bdev = NULL;
goto out;
}