Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2018 01:24:48 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r334984 - projects/pnfs-planb-server/sys/fs/nfsserver
Message-ID:  <201806120124.w5C1OmRl026560@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Jun 12 01:24:48 2018
New Revision: 334984
URL: https://svnweb.freebsd.org/changeset/base/334984

Log:
  malloc a structure to save about 200bytes on the stack.

Modified:
  projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c	Mon Jun 11 23:32:06 2018	(r334983)
+++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c	Tue Jun 12 01:24:48 2018	(r334984)
@@ -4237,13 +4237,14 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, n
 {
 	mbuf_t m;
 	u_int32_t *tl;
-	struct nfsrv_descript nfsd, *nd = &nfsd;
+	struct nfsrv_descript *nd;
 	struct ucred *cred;
 	int error = 0;
 	u_int32_t callback;
 	struct nfsdsession *sep = NULL;
 	uint64_t tval;
 
+	nd = malloc(sizeof(*nd), M_TEMP, M_WAITOK | M_ZERO);
 	cred = newnfs_getcred();
 	NFSLOCKSTATE();	/* mostly for lc_cbref++ */
 	if (clp->lc_flags & LCL_NEEDSCONFIRM) {
@@ -4448,6 +4449,7 @@ errout:
 	}
 	NFSUNLOCKSTATE();
 
+	free(nd, M_TEMP);
 	NFSEXITCODE(error);
 	return (error);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806120124.w5C1OmRl026560>