Skip to content

Commit

Permalink
[readdir] convert hostfs
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jun 29, 2013
1 parent 1bbae9f commit 8e28bc7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions fs/hostfs/hostfs_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static const struct super_operations hostfs_sbops = {
.show_options = hostfs_show_options,
};

int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
int hostfs_readdir(struct file *file, struct dir_context *ctx)
{
void *dir;
char *name;
Expand All @@ -292,12 +292,11 @@ int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
__putname(name);
if (dir == NULL)
return -error;
next = file->f_pos;
next = ctx->pos;
while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) {
error = (*filldir)(ent, name, len, file->f_pos,
ino, type);
if (error) break;
file->f_pos = next;
if (!dir_emit(ctx, name, len, ino, type))
break;
ctx->pos = next;
}
close_dir(dir);
return 0;
Expand Down Expand Up @@ -393,7 +392,7 @@ static const struct file_operations hostfs_file_fops = {

static const struct file_operations hostfs_dir_fops = {
.llseek = generic_file_llseek,
.readdir = hostfs_readdir,
.iterate = hostfs_readdir,
.read = generic_read_dir,
};

Expand Down

0 comments on commit 8e28bc7

Please sign in to comment.