aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2015-03-13 13:59:47 +0530
committerAmit Pundir <amit.pundir@linaro.org>2015-03-13 14:25:54 +0530
commit4be5c6a45a26cdfa7f6ad4a3c01cb69781f37535 (patch)
tree4b2e7c8af5ad017b0977df18e0f8d8cddc1f3307
parente48e8c45925185c02b23ae461671be29c91101d5 (diff)
fs: ecryptfs: readdir: constify actor
actor is a constant in dir_context struct and because of that we run into following build failure: ---------- fs/ecryptfs/file.c: In function ‘ecryptfs_readdir’: fs/ecryptfs/file.c:130:2: error: assignment of read-only member ‘actor’ make[2]: *** [fs/ecryptfs/file.o] Error 1 make[1]: *** [fs/ecryptfs] Error 2 make: *** [fs] Error 2 ---------- This fix is based on commit: b2497fc3057a([readdir] constify ->actor) Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--fs/ecryptfs/file.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 041379a646b3..faa26beb1e4e 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -116,18 +116,18 @@ 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)