summaryrefslogtreecommitdiff
path: root/fs/autofs/autofs_i.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-07-25 06:01:55 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2019-07-25 06:02:21 +0300
commitff09297ec9964b3fe4bade77c92c75fde34fa8e9 (patch)
tree145157267c90462a14ecaec483657d796a37e5d5 /fs/autofs/autofs_i.h
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b (diff)
downloadlinux-ff09297ec9964b3fe4bade77c92c75fde34fa8e9.tar.xz
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/autofs/autofs_i.h')
0 files changed, 0 insertions, 0 deletions