diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-22 21:44:23 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:04 -0400 |
commit | 2233f31aade393641f0eaed43a71110e629bb900 (patch) | |
tree | 3993793028cb6c8dae41d407cb2217d221d9399c /fs/readdir.c | |
parent | 2de5f059c4422e357b7df021b487a37b1d61356b (diff) |
[readdir] ->readdir() is gone
everything's converted to ->iterate()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/readdir.c')
-rw-r--r-- | fs/readdir.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/readdir.c b/fs/readdir.c index 5d6578affbbf..a6245c9fd0e6 100644 --- a/fs/readdir.c +++ b/fs/readdir.c | |||
@@ -24,7 +24,7 @@ int iterate_dir(struct file *file, struct dir_context *ctx) | |||
24 | { | 24 | { |
25 | struct inode *inode = file_inode(file); | 25 | struct inode *inode = file_inode(file); |
26 | int res = -ENOTDIR; | 26 | int res = -ENOTDIR; |
27 | if (!file->f_op || (!file->f_op->readdir && !file->f_op->iterate)) | 27 | if (!file->f_op || !file->f_op->iterate) |
28 | goto out; | 28 | goto out; |
29 | 29 | ||
30 | res = security_file_permission(file, MAY_READ); | 30 | res = security_file_permission(file, MAY_READ); |
@@ -37,14 +37,9 @@ int iterate_dir(struct file *file, struct dir_context *ctx) | |||
37 | 37 | ||
38 | res = -ENOENT; | 38 | res = -ENOENT; |
39 | if (!IS_DEADDIR(inode)) { | 39 | if (!IS_DEADDIR(inode)) { |
40 | if (file->f_op->iterate) { | 40 | ctx->pos = file->f_pos; |
41 | ctx->pos = file->f_pos; | 41 | res = file->f_op->iterate(file, ctx); |
42 | res = file->f_op->iterate(file, ctx); | 42 | file->f_pos = ctx->pos; |
43 | file->f_pos = ctx->pos; | ||
44 | } else { | ||
45 | res = file->f_op->readdir(file, ctx, ctx->actor); | ||
46 | ctx->pos = file->f_pos; | ||
47 | } | ||
48 | file_accessed(file); | 43 | file_accessed(file); |
49 | } | 44 | } |
50 | mutex_unlock(&inode->i_mutex); | 45 | mutex_unlock(&inode->i_mutex); |