diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-21 10:19:50 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-23 19:43:19 +0300 |
commit | 0fc66c9d63143f9437cd57cf5eab50a258fa40ec (patch) | |
tree | 59be6c2e3e032222581f1b624d3e4119730ee9ba /drivers/block/zram/zram_drv.c | |
parent | b8d954849cf4689d88ad84fd5cdb2d71d060f66a (diff) | |
download | linux-0fc66c9d63143f9437cd57cf5eab50a258fa40ec.tar.xz |
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/zram_drv.c')
-rw-r--r-- | drivers/block/zram/zram_drv.c | 7 |
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; } |