summaryrefslogtreecommitdiffstats
path: root/fs/readdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/readdir.c')
-rw-r--r--fs/readdir.c13
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)
{
struct inode *inode = file_inode(file);
int res = -ENOTDIR;
- if (!file->f_op || (!file->f_op->readdir && !file->f_op->iterate))
+ if (!file->f_op || !file->f_op->iterate)
goto out;
res = security_file_permission(file, MAY_READ);
@@ -37,14 +37,9 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
res = -ENOENT;
if (!IS_DEADDIR(inode)) {
- if (file->f_op->iterate) {
- ctx->pos = file->f_pos;
- res = file->f_op->iterate(file, ctx);
- file->f_pos = ctx->pos;
- } else {
- res = file->f_op->readdir(file, ctx, ctx->actor);
- ctx->pos = file->f_pos;
- }
+ ctx->pos = file->f_pos;
+ res = file->f_op->iterate(file, ctx);
+ file->f_pos = ctx->pos;
file_accessed(file);
}
mutex_unlock(&inode->i_mutex);
OpenPOWER on IntegriCloud