handle_mounts(): start building a sane wrapper for follow_managed()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 Jan 2020 01:37:23 +0000 (20:37 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Feb 2020 19:43:56 +0000 (14:43 -0500)
commitbd7c4b508344680c843e2d2436d56b9fc8aedc9d
tree0a04fa39c8e16178e9665e6d412e4b2a4b470fdb
parent31d1726d7250021c66c9f16d8a128444676db782
handle_mounts(): start building a sane wrapper for follow_managed()

All callers of follow_managed() follow it on success with the same steps -
d_backing_inode(path->dentry) is calculated and stored into some struct inode *
variable and, in all but one case, an unsigned variable (nd->seq to be) is
zeroed.  The single exception is lookup_fast() and there zeroing is correct
thing to do - not doing it is a pointless microoptimization.

Add a wrapper for follow_managed() that would do that combination.
It's mostly a vehicle for code massage - it will be changing quite a bit,
and the current calling conventions are by no means final.  Right now it
takes path, nameidata and (as out params) inode and seq, similar to
__follow_mount_rcu().  Which will soon get folded into it...

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