[PATCH 1/3] fs/block_dev.c: need not to check inode->i_bdev in bd_forget()

From: Yan Hong
Date: Wed Sep 26 2012 - 07:38:38 EST


Its only caller evict() has promised a non-NULL inode->i_bdev.

Signed-off-by: Yan Hong <clouds.yan@xxxxxxxxx>
---
fs/block_dev.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 38e721b..9bdbd9b 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -669,11 +669,9 @@ void bd_forget(struct inode *inode)
struct block_device *bdev = NULL;

spin_lock(&bdev_lock);
- if (inode->i_bdev) {
- if (!sb_is_blkdev_sb(inode->i_sb))
- bdev = inode->i_bdev;
- __bd_forget(inode);
- }
+ if (!sb_is_blkdev_sb(inode->i_sb))
+ bdev = inode->i_bdev;
+ __bd_forget(inode);
spin_unlock(&bdev_lock);

if (bdev)
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/