fs: ecryptfs: constify actor fix
authorvlw <vlwwwwww@gmail.com>
Sat, 14 Jan 2017 11:32:36 +0000 (14:32 +0300)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:03:59 +0000 (18:03 +0200)
Change-Id: I2eb27ff4835fa8a34ce40ca25176abf1fbb732f6

fs/ecryptfs/file.c

index 3200bc9605d4985d6949f24f827daf4097d2bd81..d61d0b1362f90a37570f58c3c6104a8c95fddf3c 100644 (file)
@@ -138,18 +138,20 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir)
        int rc;
        struct file *lower_file;
        struct inode *inode;
-       struct ecryptfs_getdents_callback buf;
+       struct ecryptfs_getdents_callback buf = {
+               .dirent = dirent,
+               .dentry = file->f_path.dentry,
+               .filldir = filldir,
+               .filldir_called = 0,
+               .entries_written = 0,
+               .ctx.actor = ecryptfs_filldir
+       };
 
        lower_file = ecryptfs_file_to_lower(file);
        lower_file->f_pos = file->f_pos;
        inode = file_inode(file);
        memset(&buf, 0, sizeof(buf));
-       buf.dirent = dirent;
-       buf.dentry = file->f_path.dentry;
-       buf.filldir = filldir;
-       buf.filldir_called = 0;
-       buf.entries_written = 0;
-       buf.ctx.actor = ecryptfs_filldir;
+       
        rc = iterate_dir(lower_file, &buf.ctx);
        file->f_pos = lower_file->f_pos;
        if (rc < 0)