block: use bd{grab,put}() instead of open-coding

- bd_acquire() and bd_forget() open-code bdgrab() and bdput()
- raw driver uses igrab() but never checks its return value and always
  holds another ref from bind_set() while calling it, so it's
  equivalent to bdgrab()

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Ilya Dryomov
2015-11-20 22:18:43 +01:00
committed by Jens Axboe
parent e36f620428
commit ed8a9d2c81
2 changed files with 4 additions and 4 deletions

View File

@@ -71,7 +71,7 @@ static int raw_open(struct inode *inode, struct file *filp)
err = -ENODEV;
if (!bdev)
goto out;
igrab(bdev->bd_inode);
bdgrab(bdev);
err = blkdev_get(bdev, filp->f_mode | FMODE_EXCL, raw_open);
if (err)
goto out;