Commit ebbefc01 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro

[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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 1c925604
...@@ -1135,12 +1135,15 @@ static int blkdev_open(struct inode * inode, struct file * filp) ...@@ -1135,12 +1135,15 @@ static int blkdev_open(struct inode * inode, struct file * filp)
if (res) if (res)
return res; return res;
if (!(filp->f_mode & FMODE_EXCL)) if (filp->f_mode & FMODE_EXCL) {
return 0; 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); blkdev_put(bdev, filp->f_mode);
return res; return res;
} }
......
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