]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit6f786e6341c991727b3006cdcd4555bb82a92986
tree4b6866893fe4f0e54228e743d3779fea06e87cc1
parentfddda830cca953b0744e101d940b46bd90eebc0b
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