diff options
Diffstat (limited to 'fs/hostfs/hostfs_kern.c')
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 32f35f187989..cddb05217512 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -277,7 +277,7 @@ static const struct super_operations hostfs_sbops = { | |||
277 | .show_options = hostfs_show_options, | 277 | .show_options = hostfs_show_options, |
278 | }; | 278 | }; |
279 | 279 | ||
280 | int hostfs_readdir(struct file *file, void *ent, filldir_t filldir) | 280 | int hostfs_readdir(struct file *file, struct dir_context *ctx) |
281 | { | 281 | { |
282 | void *dir; | 282 | void *dir; |
283 | char *name; | 283 | char *name; |
@@ -292,12 +292,11 @@ int hostfs_readdir(struct file *file, void *ent, filldir_t filldir) | |||
292 | __putname(name); | 292 | __putname(name); |
293 | if (dir == NULL) | 293 | if (dir == NULL) |
294 | return -error; | 294 | return -error; |
295 | next = file->f_pos; | 295 | next = ctx->pos; |
296 | while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) { | 296 | while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) { |
297 | error = (*filldir)(ent, name, len, file->f_pos, | 297 | if (!dir_emit(ctx, name, len, ino, type)) |
298 | ino, type); | 298 | break; |
299 | if (error) break; | 299 | ctx->pos = next; |
300 | file->f_pos = next; | ||
301 | } | 300 | } |
302 | close_dir(dir); | 301 | close_dir(dir); |
303 | return 0; | 302 | return 0; |
@@ -393,7 +392,7 @@ static const struct file_operations hostfs_file_fops = { | |||
393 | 392 | ||
394 | static const struct file_operations hostfs_dir_fops = { | 393 | static const struct file_operations hostfs_dir_fops = { |
395 | .llseek = generic_file_llseek, | 394 | .llseek = generic_file_llseek, |
396 | .readdir = hostfs_readdir, | 395 | .iterate = hostfs_readdir, |
397 | .read = generic_read_dir, | 396 | .read = generic_read_dir, |
398 | }; | 397 | }; |
399 | 398 | ||