Skip to content

Commit

Permalink
fs/block_dev.c: no need to check inode->i_bdev in bd_forget()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan Hong authored and Linus Torvalds committed May 1, 2013
1 parent 04df32f commit b4ea2ea
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b4ea2ea

Please sign in to comment.