linux-stable/fs/autofs
Al Viro ff09297ec9 autofs: simplify get_next_positive_...(), get rid of trylocks
* new helper: positive_after(parent, child); parent->d_lock is
held by caller, grabs and returns the first thing after child
in the list of children that has simple_positive() true.  NULL
if nothing's found; NULL child == search the entire list.

* get_next_positive_subdir() loses the redundant check for
d_count and switches to use of that helper.  BTW, dput(NULL) is
a no-op for a good reason...

* get_next_positive_dentry() switched to the same helper.  Logics:
look for positive child in prev; if not found, look for the
positive child of prev's parent following prev, etc.  That way
we are guaranteed that we are only moving rootwards through the
ancestors of prev, which is pinned and thus not going anywhere.
Since ->d_parent on autofs never changes, the same goes for
the entire chain of ancestors and we don't need overlapping
->d_lock on them.  Which avoids the trylock loops, in addition
to simplifying the logics in there...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2019-07-24 23:02:21 -04:00
..
autofs_i.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
dev-ioctl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
expire.c autofs: simplify get_next_positive_...(), get rid of trylocks 2019-07-24 23:02:21 -04:00
init.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
inode.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
root.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
symlink.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
waitq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00