From: Yan Hong <clouds.yan@xxxxxxxxx> Subject: 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@xxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/block_dev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff -puN fs/block_dev.c~fs-block_devc-need-not-to-check-inode-i_bdev-in-bd_forget fs/block_dev.c --- a/fs/block_dev.c~fs-block_devc-need-not-to-check-inode-i_bdev-in-bd_forget +++ a/fs/block_dev.c @@ -616,11 +616,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) _ -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html