]> 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>
Fri, 28 Sep 2012 00:19:02 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Sep 2012 06:06:41 +0000 (16:06 +1000)
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 37967bcea05c10be626bc9a3c55d882ebb119adf..246a81ea2f1109707fe39d970635938f16c1056a 100644 (file)
@@ -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)