mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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:
parent
93b8959a0a
commit
dbeaf8c984
1 changed files with 7 additions and 14 deletions
21
fs/nfs/dir.c
21
fs/nfs/dir.c
|
@ -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...
|
* Once we've found the start of the dirent within a page: fill 'er up...
|
||||||
*/
|
*/
|
||||||
static
|
static void nfs_do_filldir(struct nfs_readdir_descriptor *desc)
|
||||||
int nfs_do_filldir(nfs_readdir_descriptor_t *desc)
|
|
||||||
{
|
{
|
||||||
struct file *file = desc->file;
|
struct file *file = desc->file;
|
||||||
int i = 0;
|
struct nfs_cache_array *array;
|
||||||
int res = 0;
|
unsigned int i = 0;
|
||||||
struct nfs_cache_array *array = NULL;
|
|
||||||
|
|
||||||
array = kmap(desc->page);
|
array = kmap(desc->page);
|
||||||
for (i = desc->cache_entry_index; i < array->size; i++) {
|
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;
|
desc->eof = true;
|
||||||
|
|
||||||
kunmap(desc->page);
|
kunmap(desc->page);
|
||||||
dfprintk(DIRCACHE, "NFS: nfs_do_filldir() filling ended @ cookie %Lu; returning = %d\n",
|
dfprintk(DIRCACHE, "NFS: nfs_do_filldir() filling ended @ cookie %llu\n",
|
||||||
(unsigned long long)desc->dir_cookie, res);
|
(unsigned long long)desc->dir_cookie);
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -957,7 +954,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc)
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
goto out_release;
|
goto out_release;
|
||||||
|
|
||||||
status = nfs_do_filldir(desc);
|
nfs_do_filldir(desc);
|
||||||
|
|
||||||
out_release:
|
out_release:
|
||||||
nfs_readdir_clear_array(desc->page);
|
nfs_readdir_clear_array(desc->page);
|
||||||
|
@ -1032,10 +1029,8 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
res = nfs_do_filldir(desc);
|
nfs_do_filldir(desc);
|
||||||
nfs_readdir_page_unlock_and_put_cached(desc);
|
nfs_readdir_page_unlock_and_put_cached(desc);
|
||||||
if (res < 0)
|
|
||||||
break;
|
|
||||||
} while (!desc->eof);
|
} while (!desc->eof);
|
||||||
|
|
||||||
spin_lock(&file->f_lock);
|
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);
|
spin_unlock(&file->f_lock);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (res > 0)
|
|
||||||
res = 0;
|
|
||||||
dfprintk(FILE, "NFS: readdir(%pD2) returns %d\n", file, res);
|
dfprintk(FILE, "NFS: readdir(%pD2) returns %d\n", file, res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue