Commit b4ea2eaa authored by Yan Hong's avatar Yan Hong Committed by Linus Torvalds

fs/block_dev.c: no need to check inode->i_bdev in bd_forget()

Its only caller evict() has promised a non-NULL inode->i_bdev.
Signed-off-by: default avatarYan Hong <clouds.yan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 04df32fa
...@@ -617,11 +617,9 @@ void bd_forget(struct inode *inode) ...@@ -617,11 +617,9 @@ void bd_forget(struct inode *inode)
struct block_device *bdev = NULL; struct block_device *bdev = NULL;
spin_lock(&bdev_lock); spin_lock(&bdev_lock);
if (inode->i_bdev) {
if (!sb_is_blkdev_sb(inode->i_sb)) if (!sb_is_blkdev_sb(inode->i_sb))
bdev = inode->i_bdev; bdev = inode->i_bdev;
__bd_forget(inode); __bd_forget(inode);
}
spin_unlock(&bdev_lock); spin_unlock(&bdev_lock);
if (bdev) if (bdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment