• Al Viro's avatar
    helper for mount rootwards traversal · 7ef482fa
    Al Viro authored
    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: default avatarAl Viro <viro@zeniv.linux.org.uk>
    7ef482fa
namei.c 121 KB