Skip to content

Commit 8668a0d

Browse files
neilbrownbrauner
authored andcommitted
coda: use iterate_dir() in coda_readdir()
The code in coda_readdir() is nearly identical to iterate_dir(). Differences are: - iterate_dir() is killable - iterate_dir() adds permission checking and accessing notifications I believe these are not harmful for coda so it is best to use iterate_dir() directly. This will allow locking changes without touching the code in coda. Signed-off-by: NeilBrown <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent e2a9a3d commit 8668a0d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

fs/coda/dir.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,17 +429,9 @@ static int coda_readdir(struct file *coda_file, struct dir_context *ctx)
429429
cfi = coda_ftoc(coda_file);
430430
host_file = cfi->cfi_container;
431431

432-
if (host_file->f_op->iterate_shared) {
433-
struct inode *host_inode = file_inode(host_file);
434-
ret = -ENOENT;
435-
if (!IS_DEADDIR(host_inode)) {
436-
inode_lock_shared(host_inode);
437-
ret = host_file->f_op->iterate_shared(host_file, ctx);
438-
file_accessed(host_file);
439-
inode_unlock_shared(host_inode);
440-
}
432+
ret = iterate_dir(host_file, ctx);
433+
if (ret != -ENOTDIR)
441434
return ret;
442-
}
443435
/* Venus: we must read Venus dirents from a file */
444436
return coda_venus_readdir(coda_file, ctx);
445437
}

0 commit comments

Comments
 (0)