提交 0fc66c9d 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

zram: cleanup backing_dev_store

Use blkdev_get_by_dev instead of bdgrab + blkdev_get.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 b8d95484
...@@ -491,9 +491,10 @@ static ssize_t backing_dev_store(struct device *dev, ...@@ -491,9 +491,10 @@ static ssize_t backing_dev_store(struct device *dev,
goto out; goto out;
} }
bdev = bdgrab(I_BDEV(inode)); bdev = blkdev_get_by_dev(inode->i_rdev,
err = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram); FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram);
if (err < 0) { if (IS_ERR(bdev)) {
err = PTR_ERR(bdev);
bdev = NULL; bdev = NULL;
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册