Skip to content

Commit 8e28bc7

Browse files
author
Al Viro
committed
[readdir] convert hostfs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1bbae9f commit 8e28bc7

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎fs/hostfs/hostfs_kern.c‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static const struct super_operations hostfs_sbops = {
277277
.show_options = hostfs_show_options,
278278
};
279279

280-
int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
280+
int hostfs_readdir(struct file *file, struct dir_context *ctx)
281281
{
282282
void *dir;
283283
char *name;
@@ -292,12 +292,11 @@ int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
292292
__putname(name);
293293
if (dir == NULL)
294294
return -error;
295-
next = file->f_pos;
295+
next = ctx->pos;
296296
while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) {
297-
error = (*filldir)(ent, name, len, file->f_pos,
298-
ino, type);
299-
if (error) break;
300-
file->f_pos = next;
297+
if (!dir_emit(ctx, name, len, ino, type))
298+
break;
299+
ctx->pos = next;
301300
}
302301
close_dir(dir);
303302
return 0;
@@ -393,7 +392,7 @@ static const struct file_operations hostfs_file_fops = {
393392

394393
static const struct file_operations hostfs_dir_fops = {
395394
.llseek = generic_file_llseek,
396-
.readdir = hostfs_readdir,
395+
.iterate = hostfs_readdir,
397396
.read = generic_read_dir,
398397
};
399398

0 commit comments

Comments
 (0)