diff options
Diffstat (limited to 'fs/coda')
-rw-r--r-- | fs/coda/dir.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index b7d3a05c062c..fc66861b3598 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) | |||
391 | if (!host_file->f_op) | 391 | if (!host_file->f_op) |
392 | return -ENOTDIR; | 392 | return -ENOTDIR; |
393 | 393 | ||
394 | if (host_file->f_op->readdir) | 394 | if (host_file->f_op->readdir) { |
395 | { | ||
396 | /* potemkin case: we were handed a directory inode. | 395 | /* potemkin case: we were handed a directory inode. |
397 | * We can't use vfs_readdir because we have to keep the file | 396 | * We can't use vfs_readdir because we have to keep the file |
398 | * position in sync between the coda_file and the host_file. | 397 | * 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) | |||
410 | 409 | ||
411 | coda_file->f_pos = host_file->f_pos; | 410 | coda_file->f_pos = host_file->f_pos; |
412 | mutex_unlock(&host_inode->i_mutex); | 411 | mutex_unlock(&host_inode->i_mutex); |
413 | } | 412 | } else if (host_file->f_op->iterate) { |
414 | else /* Venus: we must read Venus dirents from a file */ | 413 | struct inode *host_inode = file_inode(host_file); |
414 | struct dir_context *ctx = buf; | ||
415 | |||
416 | mutex_lock(&host_inode->i_mutex); | ||
417 | ret = -ENOENT; | ||
418 | if (!IS_DEADDIR(host_inode)) { | ||
419 | ret = host_file->f_op->iterate(host_file, ctx); | ||
420 | file_accessed(host_file); | ||
421 | } | ||
422 | mutex_unlock(&host_inode->i_mutex); | ||
423 | |||
424 | coda_file->f_pos = ctx->pos; | ||
425 | } else /* Venus: we must read Venus dirents from a file */ | ||
415 | ret = coda_venus_readdir(coda_file, buf, filldir); | 426 | ret = coda_venus_readdir(coda_file, buf, filldir); |
416 | 427 | ||
417 | return ret; | 428 | return ret; |