OSDN Git Service

lookup_fast(): consolidate the RCU success case
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 18 Jan 2020 03:04:43 +0000 (22:04 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 14 Mar 2020 00:59:49 +0000 (20:59 -0400)
commitb023e1728bec6dbf0c6a7e2145e2cd025c89cd55
tree2c10e5cf35974df5e1bf368ce53635e7dc0973bf
parentdb3c9ade50b1f210c750886c23ba40dbf44b2bc8
lookup_fast(): consolidate the RCU success case

1) in case of __follow_mount_rcu() failure, lookup_fast() proceeds
to call unlazy_child() and, should it succeed, handle_mounts().
Note that we have status > 0 (or we wouldn't be calling
__follow_mount_rcu() at all), so all stuff conditional upon
non-positive status won't be even touched.

Consolidate just that sequence after the call of __follow_mount_rcu().

2) calling d_is_negative() and keeping its result is pointless -
we either don't get past checking ->d_seq (and don't use the results of
d_is_negative() at all), or we are guaranteed that ->d_inode and
type bits of ->d_flags had been consistent at the time of d_is_negative()
call.  IOW, we could only get to the use of its result if it's
equal to !inode.  The same ->d_seq check guarantees that after that point
this CPU won't observe ->d_flags values older than ->d_inode update.
So 'negative' variable is completely pointless these days.

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