NFS: nfs_do_filldir() does not return a value
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 1 Nov 2020 23:20:03 +0000 (18:20 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Dec 2020 19:05:52 +0000 (14:05 -0500)
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>
fs/nfs/dir.c

index bc366bd..48856ce 100644 (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;
 }