NFS: nfs_do_filldir() does not return a value

Clean up nfs_do_filldir().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Tested-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
Trond Myklebust 2020-11-01 18:20:03 -05:00
parent 93b8959a0a
commit dbeaf8c984

View File

@ -881,13 +881,11 @@ int readdir_search_pagecache(nfs_readdir_descriptor_t *desc)
/*
* Once we've found the start of the dirent within a page: fill 'er up...
*/
static
int nfs_do_filldir(nfs_readdir_descriptor_t *desc)
static void nfs_do_filldir(struct nfs_readdir_descriptor *desc)
{
struct file *file = desc->file;
int i = 0;
int res = 0;
struct nfs_cache_array *array = NULL;
struct nfs_cache_array *array;
unsigned int i = 0;
array = kmap(desc->page);
for (i = desc->cache_entry_index; i < array->size; i++) {
@ -914,9 +912,8 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc)
desc->eof = true;
kunmap(desc->page);
dfprintk(DIRCACHE, "NFS: nfs_do_filldir() filling ended @ cookie %Lu; returning = %d\n",
(unsigned long long)desc->dir_cookie, res);
return res;
dfprintk(DIRCACHE, "NFS: nfs_do_filldir() filling ended @ cookie %llu\n",
(unsigned long long)desc->dir_cookie);
}
/*
@ -957,7 +954,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc)
if (status < 0)
goto out_release;
status = nfs_do_filldir(desc);
nfs_do_filldir(desc);
out_release:
nfs_readdir_clear_array(desc->page);
@ -1032,10 +1029,8 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
if (res < 0)
break;
res = nfs_do_filldir(desc);
nfs_do_filldir(desc);
nfs_readdir_page_unlock_and_put_cached(desc);
if (res < 0)
break;
} while (!desc->eof);
spin_lock(&file->f_lock);
@ -1046,8 +1041,6 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
spin_unlock(&file->f_lock);
out:
if (res > 0)
res = 0;
dfprintk(FILE, "NFS: readdir(%pD2) returns %d\n", file, res);
return res;
}