[readdir] convert hostfs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1bbae9f818
commit
8e28bc7e71
|
@ -277,7 +277,7 @@ static const struct super_operations hostfs_sbops = {
|
||||||
.show_options = hostfs_show_options,
|
.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;
|
void *dir;
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -292,12 +292,11 @@ int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
|
||||||
__putname(name);
|
__putname(name);
|
||||||
if (dir == NULL)
|
if (dir == NULL)
|
||||||
return -error;
|
return -error;
|
||||||
next = file->f_pos;
|
next = ctx->pos;
|
||||||
while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) {
|
while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) {
|
||||||
error = (*filldir)(ent, name, len, file->f_pos,
|
if (!dir_emit(ctx, name, len, ino, type))
|
||||||
ino, type);
|
break;
|
||||||
if (error) break;
|
ctx->pos = next;
|
||||||
file->f_pos = next;
|
|
||||||
}
|
}
|
||||||
close_dir(dir);
|
close_dir(dir);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -393,7 +392,7 @@ static const struct file_operations hostfs_file_fops = {
|
||||||
|
|
||||||
static const struct file_operations hostfs_dir_fops = {
|
static const struct file_operations hostfs_dir_fops = {
|
||||||
.llseek = generic_file_llseek,
|
.llseek = generic_file_llseek,
|
||||||
.readdir = hostfs_readdir,
|
.iterate = hostfs_readdir,
|
||||||
.read = generic_read_dir,
|
.read = generic_read_dir,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue