diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-26 14:59:56 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-04-02 01:09:19 -0400 |
commit | 12487f3067d8d68a90dd2fc0dbc2a287ae699236 (patch) | |
tree | 0e3445827c7ed76ca3c476f4302f7ae3d2c2d369 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | c2df196876609e00d90909f51b7a3392dc8e377c (diff) |
follow_dotdot{,_rcu}(): massage loops
The logics in both of them is the same:
while true
if in process' root // uncommon
break
if *not* in mount root // normal case
find the parent
return
if at absolute root // very uncommon
break
move to underlying mountpoint
report that we are in root
Pull the common path out of the loop:
if in process' root // uncommon
goto in_root
if unlikely(in mount root)
while true
if at absolute root
goto in_root
move to underlying mountpoint
if in process' root
goto in_root
if in mount root
break;
find the parent // we are not in mount root
return
in_root:
report that we are in root
The reason for that transformation is that we get to keep the
common path straight *and* get a separate block for "move
through underlying mountpoints", which will allow to sanitize
NO_XDEV handling there. What's more, the pared-down loops
will be easier to deal with - in particular, non-RCU case
has no need to grab mount_lock and rewriting it to the
form that wouldn't do that is a non-trivial change. Better
do that with less stuff getting in the way...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions