]> 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>
Thu, 25 Oct 2012 01:14:45 +0000 (12:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 30 Oct 2012 04:15:10 +0000 (15:15 +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 842fcbb78417bcdffbbc527d30b485265f38bc1a..eb0553c7751a86f7bfaadef738d04c4a4c0a7d5d 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)