diff options
Diffstat (limited to 'fs/exportfs/expfs.c')
-rw-r--r-- | fs/exportfs/expfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index 262fc9940982..293bc2e47a73 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 */ |
@@ -254,7 +255,11 @@ static int get_name(const struct path *path, char *name, struct dentry *child) | |||
254 | struct inode *dir = path->dentry->d_inode; | 255 | struct inode *dir = path->dentry->d_inode; |
255 | int error; | 256 | int error; |
256 | struct file *file; | 257 | struct file *file; |
257 | struct getdents_callback buffer; | 258 | struct getdents_callback buffer = { |
259 | .ctx.actor = filldir_one, | ||
260 | .name = name, | ||
261 | .ino = child->d_inode->i_ino | ||
262 | }; | ||
258 | 263 | ||
259 | error = -ENOTDIR; | 264 | error = -ENOTDIR; |
260 | if (!dir || !S_ISDIR(dir->i_mode)) | 265 | if (!dir || !S_ISDIR(dir->i_mode)) |
@@ -271,17 +276,14 @@ static int get_name(const struct path *path, char *name, struct dentry *child) | |||
271 | goto out; | 276 | goto out; |
272 | 277 | ||
273 | error = -EINVAL; | 278 | error = -EINVAL; |
274 | if (!file->f_op->readdir) | 279 | if (!file->f_op->iterate) |
275 | goto out_close; | 280 | goto out_close; |
276 | 281 | ||
277 | buffer.name = name; | ||
278 | buffer.ino = child->d_inode->i_ino; | ||
279 | buffer.found = 0; | ||
280 | buffer.sequence = 0; | 282 | buffer.sequence = 0; |
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; |