fs/block_dev.c: no need to check inode->i_bdev in bd_forget()
authorYan Hong <clouds.yan@gmail.com>
Tue, 30 Apr 2013 22:26:47 +0000 (15:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2013 00:04:00 +0000 (17:04 -0700)
Its only caller evict() has promised a non-NULL inode->i_bdev.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/block_dev.c

index aae187a7f94a661edb82189496242fdac4c33fcf..ce08de7467a337231da89a19958a27ff6a2e8b4c 100644 (file)
@@ -617,11 +617,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)