mirror of https://gitee.com/openkylin/linux.git
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: 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>
This commit is contained in:
parent
04df32fa10
commit
b4ea2eaa11
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue