Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <neil@brown.name>
Link: https://lore.kernel.org/20250608230952.20539-4-neil@brown.name
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

NeilBrown and committed by
Christian Brauner
8668a0df e2a9a3d7

+2 -10
+2 -10
fs/coda/dir.c
··· 429 429 cfi = coda_ftoc(coda_file); 430 430 host_file = cfi->cfi_container; 431 431 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) 441 434 return ret; 442 - } 443 435 /* Venus: we must read Venus dirents from a file */ 444 436 return coda_venus_readdir(coda_file, ctx); 445 437 }