Commit acb0c854 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

vfs: remove superflous sb == NULL checks

inode->i_sb is always set, not need to check for it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 578c8183
...@@ -250,7 +250,7 @@ void clear_inode(struct inode *inode) ...@@ -250,7 +250,7 @@ void clear_inode(struct inode *inode)
BUG_ON(inode->i_state & I_CLEAR); BUG_ON(inode->i_state & I_CLEAR);
wait_on_inode(inode); wait_on_inode(inode);
DQUOT_DROP(inode); DQUOT_DROP(inode);
if (inode->i_sb && inode->i_sb->s_op->clear_inode) if (inode->i_sb->s_op->clear_inode)
inode->i_sb->s_op->clear_inode(inode); inode->i_sb->s_op->clear_inode(inode);
if (S_ISBLK(inode->i_mode) && inode->i_bdev) if (S_ISBLK(inode->i_mode) && inode->i_bdev)
bd_forget(inode); bd_forget(inode);
...@@ -1040,7 +1040,7 @@ static void generic_forget_inode(struct inode *inode) ...@@ -1040,7 +1040,7 @@ static void generic_forget_inode(struct inode *inode)
if (!(inode->i_state & (I_DIRTY|I_LOCK))) if (!(inode->i_state & (I_DIRTY|I_LOCK)))
list_move(&inode->i_list, &inode_unused); list_move(&inode->i_list, &inode_unused);
inodes_stat.nr_unused++; inodes_stat.nr_unused++;
if (!sb || (sb->s_flags & MS_ACTIVE)) { if (sb->s_flags & MS_ACTIVE) {
spin_unlock(&inode_lock); spin_unlock(&inode_lock);
return; return;
} }
......
...@@ -67,8 +67,6 @@ static int file_ioctl(struct file *filp, unsigned int cmd, ...@@ -67,8 +67,6 @@ static int file_ioctl(struct file *filp, unsigned int cmd,
return put_user(res, p); return put_user(res, p);
} }
case FIGETBSZ: case FIGETBSZ:
if (inode->i_sb == NULL)
return -EBADF;
return put_user(inode->i_sb->s_blocksize, p); return put_user(inode->i_sb->s_blocksize, p);
case FIONREAD: case FIONREAD:
return put_user(i_size_read(inode) - filp->f_pos, p); return put_user(i_size_read(inode) - filp->f_pos, p);
......
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