new helper: lookup_positive_unlocked()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 31 Oct 2019 05:21:58 +0000 (01:21 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 15 Nov 2019 18:49:04 +0000 (13:49 -0500)
commit6c2d4798a8d16cf4f3a28c3cd4af4f1dcbbb4d04
tree2b14c83985da30129911f7ad455e4cc587690e58
parentd41efb522e902364ab09c782d511c1bedc388ddd
new helper: lookup_positive_unlocked()

Most of the callers of lookup_one_len_unlocked() treat negatives are
ERR_PTR(-ENOENT).  Provide a helper that would do just that.  Note
that a pinned positive dentry remains positive - it's ->d_inode is
stable, etc.; a pinned _negative_ dentry can become positive at any
point as long as you are not holding its parent at least shared.
So using lookup_one_len_unlocked() needs to be careful;
lookup_positive_unlocked() is safer and that's what the callers
end up open-coding anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/cifsfs.c
fs/debugfs/inode.c
fs/kernfs/mount.c
fs/namei.c
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs4xdr.c
fs/overlayfs/namei.c
fs/quota/dquot.c
include/linux/namei.h