Commit 0fc66c9d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

zram: cleanup backing_dev_store

Use blkdev_get_by_dev instead of bdgrab + blkdev_get.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b8d95484
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment