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

Yan Hong
2012-09-26T11:38:47Z

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

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
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