diff options
author | Christoph Hellwig <hch@lst.de> | 2007-04-02 18:47:20 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-04-02 18:47:20 +0000 |
commit | c33f8d32746db12ba353b0a05b25f7893a0ac344 (patch) | |
tree | 874d9ae5afa5c1d1688105974b7ef8e8c3335302 /fs/cifs/file.c | |
parent | 2e175a90047a2dbc76fde169c990164895b25dfc (diff) |
[CIFS] Remove unnecessary checks
file->f_path.dentry or file->f_path.dentry.d_inode can't be NULL since at
least ten years, similar for all but very few arguments passed in from the
VFS.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 2d3275bedb5..914b449f202 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -792,12 +792,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, int xid, long_op; struct cifsFileInfo *open_file; - if (file->f_path.dentry == NULL) - return -EBADF; - cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); - if (cifs_sb == NULL) - return -EBADF; pTcon = cifs_sb->tcon; @@ -807,14 +802,9 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, if (file->private_data == NULL) return -EBADF; - else - open_file = (struct cifsFileInfo *) file->private_data; + open_file = (struct cifsFileInfo *) file->private_data; xid = GetXid(); - if (file->f_path.dentry->d_inode == NULL) { - FreeXid(xid); - return -EBADF; - } if (*poffset > file->f_path.dentry->d_inode->i_size) long_op = 2; /* writes past end of file can take a long time */ @@ -908,12 +898,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data, int xid, long_op; struct cifsFileInfo *open_file; - if (file->f_path.dentry == NULL) - return -EBADF; - cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); - if (cifs_sb == NULL) - return -EBADF; pTcon = cifs_sb->tcon; @@ -922,14 +907,9 @@ static ssize_t cifs_write(struct file *file, const char *write_data, if (file->private_data == NULL) return -EBADF; - else - open_file = (struct cifsFileInfo *)file->private_data; + open_file = (struct cifsFileInfo *)file->private_data; xid = GetXid(); - if (file->f_path.dentry->d_inode == NULL) { - FreeXid(xid); - return -EBADF; - } if (*poffset > file->f_path.dentry->d_inode->i_size) long_op = 2; /* writes past end of file can take a long time */ @@ -957,11 +937,6 @@ static ssize_t cifs_write(struct file *file, const char *write_data, return -EBADF; } if (open_file->invalidHandle) { - if ((file->f_path.dentry == NULL) || - (file->f_path.dentry->d_inode == NULL)) { - FreeXid(xid); - return total_written; - } /* we could deadlock if we called filemap_fdatawait from here so tell reopen_file not to flush data to |