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/exportfs | |
| 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/exportfs')
| -rw-r--r-- | fs/exportfs/expfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index 262fc9940982..7cb190426cec 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c | |||
| @@ -212,6 +212,7 @@ reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf) | |||
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | struct getdents_callback { | 214 | struct getdents_callback { |
| 215 | struct dir_context ctx; | ||
| 215 | char *name; /* name that was found. It already points to a | 216 | char *name; /* name that was found. It already points to a |
| 216 | buffer NAME_MAX+1 is size */ | 217 | buffer NAME_MAX+1 is size */ |
| 217 | unsigned long ino; /* the inum we are looking for */ | 218 | unsigned long ino; /* the inum we are looking for */ |
| @@ -278,10 +279,11 @@ static int get_name(const struct path *path, char *name, struct dentry *child) | |||
| 278 | buffer.ino = child->d_inode->i_ino; | 279 | buffer.ino = child->d_inode->i_ino; |
| 279 | buffer.found = 0; | 280 | buffer.found = 0; |
| 280 | buffer.sequence = 0; | 281 | buffer.sequence = 0; |
| 282 | buffer.ctx.actor = filldir_one; | ||
| 281 | while (1) { | 283 | while (1) { |
| 282 | int old_seq = buffer.sequence; | 284 | int old_seq = buffer.sequence; |
| 283 | 285 | ||
| 284 | error = vfs_readdir(file, filldir_one, &buffer); | 286 | error = iterate_dir(file, &buffer.ctx); |
| 285 | if (buffer.found) { | 287 | if (buffer.found) { |
| 286 | error = 0; | 288 | error = 0; |
| 287 | break; | 289 | break; |
