]> Git Repo - linux.git/commitdiff
[PATCH] clean up blkdev_get a little bit
authorChristoph Hellwig <[email protected]>
Wed, 5 Nov 2008 13:54:41 +0000 (14:54 +0100)
committerAl Viro <[email protected]>
Thu, 4 Dec 2008 09:22:56 +0000 (04:22 -0500)
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 <[email protected]>
Signed-off-by: Al Viro <[email protected]>
fs/block_dev.c

index db831efbdbbdcc0d2b1298af4e3055916357fee2..7c727523bc54a62bf6f7aa3c90a8bc7fe93b24f0 100644 (file)
@@ -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;
 }
This page took 0.066534 seconds and 4 git commands to generate.