mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[PATCH] clean up blkdev_get a little bit
The way the bd_claim for the FMODE_EXCL case is implemented is rather confusing. Clean it up to the most logical style. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1c925604e1
commit
ebbefc011e
1 changed files with 7 additions and 4 deletions
|
@ -1135,12 +1135,15 @@ static int blkdev_open(struct inode * inode, struct file * filp)
|
|||
if (res)
|
||||
return res;
|
||||
|
||||
if (!(filp->f_mode & FMODE_EXCL))
|
||||
return 0;
|
||||
if (filp->f_mode & FMODE_EXCL) {
|
||||
res = bd_claim(bdev, filp);
|
||||
if (res)
|
||||
goto out_blkdev_put;
|
||||
}
|
||||
|
||||
if (!(res = bd_claim(bdev, filp)))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
out_blkdev_put:
|
||||
blkdev_put(bdev, filp->f_mode);
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue