[readdir] constify ->actor
[firefly-linux-kernel-4.4.55.git] / fs / exportfs / expfs.c
index 6c8ef1dd4bdf8fc37285884813947f7fe371d419..43b448ddc3dc3e479e457d75720cebb6e512e22f 100644 (file)
@@ -255,7 +255,11 @@ static int get_name(const struct path *path, char *name, struct dentry *child)
        struct inode *dir = path->dentry->d_inode;
        int error;
        struct file *file;
-       struct getdents_callback buffer;
+       struct getdents_callback buffer = {
+               .ctx.actor = filldir_one,
+               .name = name,
+               .ino = child->d_inode->i_ino
+       };
 
        error = -ENOTDIR;
        if (!dir || !S_ISDIR(dir->i_mode))
@@ -275,11 +279,7 @@ static int get_name(const struct path *path, char *name, struct dentry *child)
        if (!file->f_op->readdir && !file->f_op->iterate)
                goto out_close;
 
-       buffer.name = name;
-       buffer.ino = child->d_inode->i_ino;
-       buffer.found = 0;
        buffer.sequence = 0;
-       buffer.ctx.actor = filldir_one;
        while (1) {
                int old_seq = buffer.sequence;