summaryrefslogtreecommitdiff
path: root/fs/9p/vfs_dir.c
diff options
context:
space:
mode:
authorGreg Kurz <gkurz@linux.vnet.ibm.com>2020-09-23 17:11:44 +0300
committerDominique Martinet <asmadeus@codewreck.org>2020-11-03 11:29:46 +0300
commit987a64850996db22bbcf2c1d0a051446a343fa2c (patch)
tree70596e685ff828cc5225956c3426d5f559eb5f28 /fs/9p/vfs_dir.c
parent154372e67d4053e56591245eb413686621941333 (diff)
downloadlinux-987a64850996db22bbcf2c1d0a051446a343fa2c.tar.xz
fs/9p: track open fids
This patch adds accounting of open fids in a list hanging off the i_private field of the corresponding inode. This allows faster lookups compared to searching the full 9p client list. The lookup code is modified accordingly. Link: http://lkml.kernel.org/r/20200923141146.90046-3-jianyong.wu@arm.com Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'fs/9p/vfs_dir.c')
-rw-r--r--fs/9p/vfs_dir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 674d22bf4f6f..d82d8a346f86 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -210,6 +210,9 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
fid = filp->private_data;
p9_debug(P9_DEBUG_VFS, "inode: %p filp: %p fid: %d\n",
inode, filp, fid ? fid->fid : -1);
+ spin_lock(&inode->i_lock);
+ hlist_del(&fid->ilist);
+ spin_unlock(&inode->i_lock);
if (fid)
p9_client_clunk(fid);
return 0;