introduce ->iterate(), ctx->pos, dir_emit()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / nfsd / nfs4recover.c
index 4f8cc6ba7c28ea979678439b9a1b8e7ac62cc03a..45509c23c7a049c979c0d545b644cde414290293 100644 (file)
@@ -240,6 +240,11 @@ struct name_list {
        struct list_head list;
 };
 
        struct list_head list;
 };
 
+struct nfs4_dir_ctx {
+       struct dir_context ctx;
+       struct list_head names;
+};
+
 static int
 nfsd4_build_namelist(void *arg, const char *name, int namlen,
                loff_t offset, u64 ino, unsigned int d_type)
 static int
 nfsd4_build_namelist(void *arg, const char *name, int namlen,
                loff_t offset, u64 ino, unsigned int d_type)
@@ -254,7 +259,7 @@ nfsd4_build_namelist(void *arg, const char *name, int namlen,
                return -ENOMEM;
        memcpy(entry->name, name, HEXDIR_LEN - 1);
        entry->name[HEXDIR_LEN - 1] = '\0';
                return -ENOMEM;
        memcpy(entry->name, name, HEXDIR_LEN - 1);
        entry->name[HEXDIR_LEN - 1] = '\0';
-       list_add(&entry->list, names);
+       list_add(&entry->list, &ctx->names);
        return 0;
 }
 
        return 0;
 }
 
@@ -263,10 +268,7 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn)
 {
        const struct cred *original_cred;
        struct dentry *dir = nn->rec_file->f_path.dentry;
 {
        const struct cred *original_cred;
        struct dentry *dir = nn->rec_file->f_path.dentry;
-       struct {
-               struct dir_context ctx;
-               struct list_head names;
-       } ctx;
+       struct nfs4_dir_ctx ctx;
        int status;
 
        status = nfs4_save_creds(&original_cred);
        int status;
 
        status = nfs4_save_creds(&original_cred);