From a4a87303874c1a7d49cc18a8fe33676b0002ffbf Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Fri, 8 Jul 2022 09:43:12 +0800 Subject: autofs: use dentry info count instead of simple_empty() The dentry info. field count is used to check if a dentry is in use during expire. But, to be used for this the count field must account for the presence of child dentries in a directory dentry. Therefore it can also be used to check for an empty directory dentry which can be done without having to to take an additional lock or account for the presence of a readdir cursor dentry as is done by simple_empty(). Link: https://lkml.kernel.org/r/165724459238.30914.1504611159945950108.stgit@donald.themaw.net Signed-off-by: Ian Kent Cc: Al Viro Cc: David Howells Cc: Miklos Szeredi Signed-off-by: Andrew Morton --- fs/autofs/expire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/autofs/expire.c') diff --git a/fs/autofs/expire.c b/fs/autofs/expire.c index b3fefd6237c3..038b3d2d9f57 100644 --- a/fs/autofs/expire.c +++ b/fs/autofs/expire.c @@ -371,7 +371,7 @@ static struct dentry *should_expire(struct dentry *dentry, return NULL; } - if (simple_empty(dentry)) + if (autofs_empty(ino)) return NULL; /* Case 2: tree mount, expire iff entire tree is not busy */ -- cgit v1.2.3