aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/root.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-05-16 12:07:31 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:56:32 -0400
commitf0c3b5093addc8bfe9fe3a5b01acb7ec7969eafa (patch)
tree3bad119186fd14fa95886cfc73c6953a4dd00e74 /fs/proc/root.c
parent68c61471138402e34489edc5efde4f0fc5beaa25 (diff)
[readdir] convert procfs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/root.c')
-rw-r--r--fs/proc/root.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 41a6ea93f486..229e366598da 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -202,21 +202,14 @@ static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentr
202 return proc_pid_lookup(dir, dentry, flags); 202 return proc_pid_lookup(dir, dentry, flags);
203} 203}
204 204
205static int proc_root_readdir(struct file * filp, 205static int proc_root_readdir(struct file *file, struct dir_context *ctx)
206 void * dirent, filldir_t filldir)
207{ 206{
208 unsigned int nr = filp->f_pos; 207 if (ctx->pos < FIRST_PROCESS_ENTRY) {
209 int ret; 208 proc_readdir(file, ctx);
210 209 ctx->pos = FIRST_PROCESS_ENTRY;
211 if (nr < FIRST_PROCESS_ENTRY) {
212 int error = proc_readdir(filp, dirent, filldir);
213 if (error <= 0)
214 return error;
215 filp->f_pos = FIRST_PROCESS_ENTRY;
216 } 210 }
217 211
218 ret = proc_pid_readdir(filp, dirent, filldir); 212 return proc_pid_readdir(file, ctx);
219 return ret;
220} 213}
221 214
222/* 215/*
@@ -226,7 +219,7 @@ static int proc_root_readdir(struct file * filp,
226 */ 219 */
227static const struct file_operations proc_root_operations = { 220static const struct file_operations proc_root_operations = {
228 .read = generic_read_dir, 221 .read = generic_read_dir,
229 .readdir = proc_root_readdir, 222 .iterate = proc_root_readdir,
230 .llseek = default_llseek, 223 .llseek = default_llseek,
231}; 224};
232 225