diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-07-24 23:01:55 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-07-24 23:02:21 -0400 |
commit | ff09297ec9964b3fe4bade77c92c75fde34fa8e9 (patch) | |
tree | 145157267c90462a14ecaec483657d796a37e5d5 /fs/hostfs | |
parent | 5f9e832c137075045d15cd6899ab0505cfb2ca4b (diff) | |
download | linux-ff09297ec9964b3fe4bade77c92c75fde34fa8e9.tar.gz linux-ff09297ec9964b3fe4bade77c92c75fde34fa8e9.tar.bz2 linux-ff09297ec9964b3fe4bade77c92c75fde34fa8e9.zip |
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>
Diffstat (limited to 'fs/hostfs')
0 files changed, 0 insertions, 0 deletions