diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-16 12:07:31 -0400 |
---|---|---|
committer | Pawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local> | 2015-03-27 14:37:35 +0100 |
commit | 47b2ca32c6a3b1d4dc3f6ff242cfe7a346283832 (patch) | |
tree | 4f32e50c89eaad07991b8199d749a0108eb9955d /fs/hppfs/hppfs.c | |
parent | 1e742a9dd283ea4cc338c8b7c1bbe0f6fb1b3aa8 (diff) | |
download | linux-3.10-47b2ca32c6a3b1d4dc3f6ff242cfe7a346283832.tar.gz linux-3.10-47b2ca32c6a3b1d4dc3f6ff242cfe7a346283832.tar.bz2 linux-3.10-47b2ca32c6a3b1d4dc3f6ff242cfe7a346283832.zip |
convert procfs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hppfs/hppfs.c')
-rw-r--r-- | fs/hppfs/hppfs.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index cd3e38972c8..fc90ab11c34 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c @@ -542,8 +542,8 @@ static const struct file_operations hppfs_file_fops = { }; struct hppfs_dirent { - void *vfs_dirent; - filldir_t filldir; + struct dir_context ctx; + struct dir_context *caller; struct dentry *dentry; }; @@ -555,34 +555,29 @@ static int hppfs_filldir(void *d, const char *name, int size, if (file_removed(dirent->dentry, name)) return 0; - return (*dirent->filldir)(dirent->vfs_dirent, name, size, offset, - inode, type); + dirent->caller->pos = dirent->ctx.pos; + return !dir_emit(dirent->caller, name, size, inode, type); } -static int hppfs_readdir(struct file *file, void *ent, filldir_t filldir) +static int hppfs_readdir(struct file *file, struct dir_context *ctx) { struct hppfs_private *data = file->private_data; struct file *proc_file = data->proc_file; - int (*readdir)(struct file *, void *, filldir_t); - struct hppfs_dirent dirent = ((struct hppfs_dirent) - { .vfs_dirent = ent, - .filldir = filldir, - .dentry = file->f_path.dentry - }); + struct hppfs_dirent d = { + .ctx.actor = hppfs_filldir, + .caller = ctx, + .dentry = file->f_path.dentry + }; int err; - - readdir = file_inode(proc_file)->i_fop->readdir; - - proc_file->f_pos = file->f_pos; - err = (*readdir)(proc_file, &dirent, hppfs_filldir); - file->f_pos = proc_file->f_pos; - + proc_file->f_pos = ctx->pos; + err = iterate_dir(proc_file, &d.ctx); + ctx->pos = d.ctx.pos; return err; } static const struct file_operations hppfs_dir_fops = { .owner = NULL, - .readdir = hppfs_readdir, + .iterate = hppfs_readdir, .open = hppfs_dir_open, .llseek = default_llseek, .release = hppfs_release, |