]> git.baikalelectronics.ru Git - kernel.git/commit
helper for mount rootwards traversal
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 26 Feb 2020 22:50:13 +0000 (17:50 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 Apr 2020 05:09:21 +0000 (01:09 -0400)
commita309123b38dba18fdfe9ae02731fd7fa8efccfc4
tree3e96c7120638e473ba1296121fe4257184851ecd
parentf0573c449d41f942fb6bcc5c2e546bab8b0c1ef5
helper for mount rootwards traversal

The loops in follow_dotdot{_rcu()} are doing the same thing:
we have a mount and we want to find out how far up the chain
of mounts do we need to go.

We follow the chain of mount until we find one that is not
directly overmounting the root of another mount.  If such
a mount is found, we want the location it's mounted upon.
If we run out of chain (i.e. get to a mount that is not
mounted on anything else) or run into process' root, we
report failure.

On success, we want (in RCU case) d_seq of resulting location
sampled or (in non-RCU case) references to that location
acquired.

This commit introduces such primitive for RCU case and
switches follow_dotdot_rcu() to it; non-RCU case will be
go in the next commit.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c