mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-22 11:30:38 +07:00
mm: cleanup claim_swapfile
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>
This commit is contained in:
parent
e455ed2290
commit
ef16e1d98c
@ -2920,10 +2920,10 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
|
||||
int error;
|
||||
|
||||
if (S_ISBLK(inode->i_mode)) {
|
||||
p->bdev = bdgrab(I_BDEV(inode));
|
||||
error = blkdev_get(p->bdev,
|
||||
p->bdev = blkdev_get_by_dev(inode->i_rdev,
|
||||
FMODE_READ | FMODE_WRITE | FMODE_EXCL, p);
|
||||
if (error < 0) {
|
||||
if (IS_ERR(p->bdev)) {
|
||||
error = PTR_ERR(p->bdev);
|
||||
p->bdev = NULL;
|
||||
return error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user