mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
introduce a parallel variant of ->iterate()
New method: ->iterate_shared(). Same arguments as in ->iterate(), called with the directory locked only shared. Once all filesystems switch, the old one will be gone. Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
63b6df1413
commit
6192269444
5 changed files with 48 additions and 11 deletions
|
|
@ -424,16 +424,22 @@ static int coda_readdir(struct file *coda_file, struct dir_context *ctx)
|
|||
BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);
|
||||
host_file = cfi->cfi_container;
|
||||
|
||||
if (host_file->f_op->iterate) {
|
||||
if (host_file->f_op->iterate || host_file->f_op->iterate_shared) {
|
||||
struct inode *host_inode = file_inode(host_file);
|
||||
|
||||
inode_lock(host_inode);
|
||||
ret = -ENOENT;
|
||||
if (!IS_DEADDIR(host_inode)) {
|
||||
ret = host_file->f_op->iterate(host_file, ctx);
|
||||
file_accessed(host_file);
|
||||
if (host_file->f_op->iterate_shared) {
|
||||
inode_lock_shared(host_inode);
|
||||
ret = host_file->f_op->iterate_shared(host_file, ctx);
|
||||
file_accessed(host_file);
|
||||
inode_unlock_shared(host_inode);
|
||||
} else {
|
||||
inode_lock(host_inode);
|
||||
ret = host_file->f_op->iterate(host_file, ctx);
|
||||
file_accessed(host_file);
|
||||
inode_unlock(host_inode);
|
||||
}
|
||||
}
|
||||
inode_unlock(host_inode);
|
||||
return ret;
|
||||
}
|
||||
/* Venus: we must read Venus dirents from a file */
|
||||
|
|
|
|||
Loading…
Reference in a new issue