merging pick_link() with get_link(), part 2
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 14 Jan 2020 15:13:40 +0000 (10:13 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 14 Mar 2020 01:08:18 +0000 (21:08 -0400)
commit1ccac622f9da58a113f9c5b8c9d07d76b60bc555
tree4b6866893fe4f0e54228e743d3779fea06e87cc1
parent43679723d27f5173a01fc343fb8bf61be5ae04ed
merging pick_link() with get_link(), part 2

Fold trailing_symlink() into lookup_last() and do_last(), change
the calling conventions of those two.  Rules change:
success, we are done => NULL instead of 0
error => ERR_PTR(-E...) instead of -E...
got a symlink to follow => return the path to be followed instead of 1

The loops calling those (in path_lookupat() and path_openat()) adjusted.

A subtle change of control flow here: originally a pure-jump trailing
symlink ("/" or procfs one) would've passed through the upper level
loop once more, with "" for path to traverse.  That would've brought
us back to the lookup_last/do_last entry and we would've hit LAST_BIND
case (LAST_BIND left from get_link() called by trailing_symlink())
and pretty much skip to the point right after where we'd left the
sucker back when we picked that trailing symlink.

Now we don't bother with that extra pass through the upper level
loop - if get_link() says "I've just done a pure jump, nothing
else to do", we just treat that as non-symlink case.

Boilerplate added on that step will go away shortly - it'll migrate
into walk_component() and then to step_into(), collapsing into the
change of calling conventions for those.

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