diff options
author | mckusick <mckusick@FreeBSD.org> | 2015-11-29 21:01:02 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2015-11-29 21:01:02 +0000 |
commit | cb4ab786a10727b3013ae5be67aadaf4cc10ca31 (patch) | |
tree | 28e73ebc7868b1922684e34406848eec29c359b8 /sys/fs/nfsclient/nfs_clnode.c | |
parent | c1dbc31d595184f214e7d03ebf80901cffe0b713 (diff) | |
download | FreeBSD-src-cb4ab786a10727b3013ae5be67aadaf4cc10ca31.zip FreeBSD-src-cb4ab786a10727b3013ae5be67aadaf4cc10ca31.tar.gz |
For performance reasons, it is useful to have a single string used as
the name of a filesystem when setting it as the first parameter to the
getnewvnode() function. Most filesystems call getnewvnode from just one
place so can use a literal string as the first parameter. However, NFS
calls getnewvnode from two places, so we create a global constant string
that can be used by the two instances. This change also collapses two
instances of getnewvnode() in the UFS filesystem to a single call.
Reviewed by: kib
Tested by: Peter Holm
Diffstat (limited to 'sys/fs/nfsclient/nfs_clnode.c')
-rw-r--r-- | sys/fs/nfsclient/nfs_clnode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index b1a3451..124989a 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -64,6 +64,8 @@ MALLOC_DECLARE(M_NEWNFSREQ); uma_zone_t newnfsnode_zone; +const char nfs_vnode_tag[] = "nfs"; + static void nfs_freesillyrename(void *arg, __unused int pending); void @@ -122,7 +124,7 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp, } np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO); - error = getnewvnode("nfs", mntp, &newnfs_vnodeops, &nvp); + error = getnewvnode(nfs_vnode_tag, mntp, &newnfs_vnodeops, &nvp); if (error) { uma_zfree(newnfsnode_zone, np); return (error); @@ -330,4 +332,3 @@ ncl_invalcaches(struct vnode *vp) KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); mtx_unlock(&np->n_mtx); } - |