]> 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, 12 Oct 2012 04:22:55 +0000 (15:22 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 16 Oct 2012 02:48:00 +0000 (13:48 +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)