X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=fs%2Fcoda%2Fdir.c;h=fc66861b359855d46b4fbdfae5a4fa1889906629;hb=969b4e2c197006b8a6792266f1afcbd0b3427f20;hp=b7d3a05c062c0517bdcee3aedf01619f60bddc7a;hpb=8b1e54c48f3298ac84cafca13ad65901117b43a9;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git diff --git a/fs/coda/dir.c b/fs/coda/dir.c index b7d3a05c062..fc66861b359 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -391,8 +391,7 @@ static int coda_readdir(struct file *coda_file, void *buf, filldir_t filldir) if (!host_file->f_op) return -ENOTDIR; - if (host_file->f_op->readdir) - { + if (host_file->f_op->readdir) { /* potemkin case: we were handed a directory inode. * We can't use vfs_readdir because we have to keep the file * position in sync between the coda_file and the host_file. @@ -410,8 +409,20 @@ static int coda_readdir(struct file *coda_file, void *buf, filldir_t filldir) coda_file->f_pos = host_file->f_pos; mutex_unlock(&host_inode->i_mutex); - } - else /* Venus: we must read Venus dirents from a file */ + } else if (host_file->f_op->iterate) { + struct inode *host_inode = file_inode(host_file); + struct dir_context *ctx = buf; + + mutex_lock(&host_inode->i_mutex); + ret = -ENOENT; + if (!IS_DEADDIR(host_inode)) { + ret = host_file->f_op->iterate(host_file, ctx); + file_accessed(host_file); + } + mutex_unlock(&host_inode->i_mutex); + + coda_file->f_pos = ctx->pos; + } else /* Venus: we must read Venus dirents from a file */ ret = coda_venus_readdir(coda_file, buf, filldir); return ret;