vfs: remove superflous sb == NULL checks
authorChristoph Hellwig <hch@lst.de>
Tue, 8 May 2007 07:25:52 +0000 (00:25 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:02 +0000 (11:15 -0700)
inode->i_sb is always set, not need to check for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/inode.c
fs/ioctl.c

index b4296bf62739727ea0370e59a59c3f76cb477600..c03089421b6f47f8e65e18a772bae185f28b61eb 100644 (file)
@@ -250,7 +250,7 @@ void clear_inode(struct inode *inode)
        BUG_ON(inode->i_state & I_CLEAR);
        wait_on_inode(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);
        if (S_ISBLK(inode->i_mode) && inode->i_bdev)
                bd_forget(inode);
@@ -1040,7 +1040,7 @@ static void generic_forget_inode(struct inode *inode)
                if (!(inode->i_state & (I_DIRTY|I_LOCK)))
                        list_move(&inode->i_list, &inode_unused);
                inodes_stat.nr_unused++;
-               if (!sb || (sb->s_flags & MS_ACTIVE)) {
+               if (sb->s_flags & MS_ACTIVE) {
                        spin_unlock(&inode_lock);
                        return;
                }
index ff61772ceedd88362c35e9a9a550ca3cf1d8752a..479c1038ed4a4f7d3354e5939f6eae6a910e1d4f 100644 (file)
@@ -67,8 +67,6 @@ static int file_ioctl(struct file *filp, unsigned int cmd,
                        return put_user(res, p);
                }
                case FIGETBSZ:
-                       if (inode->i_sb == NULL)
-                               return -EBADF;
                        return put_user(inode->i_sb->s_blocksize, p);
                case FIONREAD:
                        return put_user(i_size_read(inode) - filp->f_pos, p);