NFS: Remove unnecessary check in nfs_read_folio()
All the callers are expected to supply a valid struct file argument, so there is no need for the NULL check. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
256093fec1
commit
2de3d04b3b
|
@ -355,13 +355,7 @@ int nfs_read_folio(struct file *file, struct folio *folio)
|
|||
if (NFS_STALE(inode))
|
||||
goto out_unlock;
|
||||
|
||||
if (file == NULL) {
|
||||
ret = -EBADF;
|
||||
desc.ctx = nfs_find_open_context(inode, NULL, FMODE_READ);
|
||||
if (desc.ctx == NULL)
|
||||
goto out_unlock;
|
||||
} else
|
||||
desc.ctx = get_nfs_open_context(nfs_file_open_context(file));
|
||||
desc.ctx = get_nfs_open_context(nfs_file_open_context(file));
|
||||
|
||||
xchg(&desc.ctx->error, 0);
|
||||
nfs_pageio_init_read(&desc.pgio, inode, false,
|
||||
|
|
Loading…
Reference in New Issue