nfs_lookup: don't bother with d_instantiate(dentry, NULL)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2016-03-07 22:40:43 -05:00
parent 9d95afd597
commit 130f9ab75d
1 changed files with 4 additions and 8 deletions

View File

@ -1360,19 +1360,15 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
dfprintk(VFS, "NFS: lookup(%pd2)\n", dentry); dfprintk(VFS, "NFS: lookup(%pd2)\n", dentry);
nfs_inc_stats(dir, NFSIOS_VFSLOOKUP); nfs_inc_stats(dir, NFSIOS_VFSLOOKUP);
res = ERR_PTR(-ENAMETOOLONG); if (unlikely(dentry->d_name.len > NFS_SERVER(dir)->namelen))
if (dentry->d_name.len > NFS_SERVER(dir)->namelen) return ERR_PTR(-ENAMETOOLONG);
goto out;
/* /*
* If we're doing an exclusive create, optimize away the lookup * If we're doing an exclusive create, optimize away the lookup
* but don't hash the dentry. * but don't hash the dentry.
*/ */
if (nfs_is_exclusive_create(dir, flags)) { if (nfs_is_exclusive_create(dir, flags))
d_instantiate(dentry, NULL); return NULL;
res = NULL;
goto out;
}
res = ERR_PTR(-ENOMEM); res = ERR_PTR(-ENOMEM);
fhandle = nfs_alloc_fhandle(); fhandle = nfs_alloc_fhandle();