]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs/block_dev.c: no need to check inode->i_bdev in bd_forget()
authorYan Hong <clouds.yan@gmail.com>
Tue, 23 Oct 2012 02:50:09 +0000 (13:50 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 24 Oct 2012 03:20:08 +0000 (14:20 +1100)
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>
fs/block_dev.c

index b3c1d3dae77d06fcde3fa3ecf36b2af9e2b25d85..785aa3b372e05e409f545ebbc1cc3f17091bdb02 100644 (file)
@@ -695,11 +695,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)