diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-15 13:52:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:46:46 -0400 |
commit | 5c0ba4e0762e6dabd14a5c276652e2defec38de7 (patch) | |
tree | cc2c94d81a631b0656782e1f8299da3267871964 /fs/ecryptfs/file.c | |
parent | 83a8761142cb38536e9e88dfc2432d331ea4e257 (diff) |
[readdir] introduce iterate_dir() and dir_context
iterate_dir(): new helper, replacing vfs_readdir().
struct dir_context: contains the readdir callback (and will get more stuff
in it), embedded into whatever data that callback wants to deal with;
eventually, we'll be passing it to ->readdir() replacement instead of
(data,filldir) pair.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ecryptfs/file.c')
-rw-r--r-- | fs/ecryptfs/file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index a7abbea2c096..041379a646b3 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -68,6 +68,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb, | |||
68 | } | 68 | } |
69 | 69 | ||
70 | struct ecryptfs_getdents_callback { | 70 | struct ecryptfs_getdents_callback { |
71 | struct dir_context ctx; | ||
71 | void *dirent; | 72 | void *dirent; |
72 | struct dentry *dentry; | 73 | struct dentry *dentry; |
73 | filldir_t filldir; | 74 | filldir_t filldir; |
@@ -126,7 +127,8 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir) | |||
126 | buf.filldir = filldir; | 127 | buf.filldir = filldir; |
127 | buf.filldir_called = 0; | 128 | buf.filldir_called = 0; |
128 | buf.entries_written = 0; | 129 | buf.entries_written = 0; |
129 | rc = vfs_readdir(lower_file, ecryptfs_filldir, (void *)&buf); | 130 | buf.ctx.actor = ecryptfs_filldir; |
131 | rc = iterate_dir(lower_file, &buf.ctx); | ||
130 | file->f_pos = lower_file->f_pos; | 132 | file->f_pos = lower_file->f_pos; |
131 | if (rc < 0) | 133 | if (rc < 0) |
132 | goto out; | 134 | goto out; |