From 2deeb46eeb4ca2c12f00ac7b68c9500a38979ca3 Mon Sep 17 00:00:00 2001 From: Yan Hong Date: Fri, 28 Sep 2012 10:19:02 +1000 Subject: [PATCH] fs/block_dev.c: no need to check inode->i_bdev in bd_forget() Its only caller evict() has promised a non-NULL inode->i_bdev. Signed-off-by: Yan Hong Cc: Al Viro Signed-off-by: Andrew Morton --- 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 37967bcea05c..246a81ea2f11 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -696,11 +696,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) -- 2.39.5