[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>

authored by Christoph Hellwig and committed by Al Viro ebbefc01 1c925604

+7 -4
+7 -4
fs/block_dev.c
··· 1135 1135 if (res) 1136 1136 return res; 1137 1137 1138 - if (!(filp->f_mode & FMODE_EXCL)) 1139 - return 0; 1138 + if (filp->f_mode & FMODE_EXCL) { 1139 + res = bd_claim(bdev, filp); 1140 + if (res) 1141 + goto out_blkdev_put; 1142 + } 1140 1143 1141 - if (!(res = bd_claim(bdev, filp))) 1142 - return 0; 1144 + return 0; 1143 1145 1146 + out_blkdev_put: 1144 1147 blkdev_put(bdev, filp->f_mode); 1145 1148 return res; 1146 1149 }