Date: Sat, 1 Aug 2020 06:33:11 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363753 - in head/sys: kern sys Message-ID: <202008010633.0716XBSg041613@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sat Aug 1 06:33:11 2020 New Revision: 363753 URL: https://svnweb.freebsd.org/changeset/base/363753 Log: vfs: convert ni_rigthsneeded to a pointer Shaves 8 bytes of struct nameidata on 64-bit platforms. Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Aug 1 06:32:25 2020 (r363752) +++ head/sys/kern/vfs_lookup.c Sat Aug 1 06:33:11 2020 (r363753) @@ -347,7 +347,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, *dpp = pwd->pwd_cdir; vrefact(*dpp); } else { - rights = ndp->ni_rightsneeded; + rights = *ndp->ni_rightsneeded; cap_rights_set_one(&rights, CAP_LOOKUP); if (cnp->cn_flags & AUDITVNODE1) @@ -403,7 +403,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, ndp->ni_beneath_latch = pwd->pwd_cdir; vrefact(ndp->ni_beneath_latch); } else { - rights = ndp->ni_rightsneeded; + rights = *ndp->ni_rightsneeded; cap_rights_set_one(&rights, CAP_LOOKUP); error = fgetvp_rights(td, ndp->ni_dirfd, &rights, &dirfd_caps, &ndp->ni_beneath_latch); @@ -1381,7 +1381,7 @@ NDINIT_ALL(struct nameidata *ndp, u_long op, u_long fl ndp->ni_resflags = 0; filecaps_init(&ndp->ni_filecaps); ndp->ni_cnd.cn_thread = td; - ndp->ni_rightsneeded = *rightsp; + ndp->ni_rightsneeded = rightsp; } /* Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sat Aug 1 06:32:25 2020 (r363752) +++ head/sys/sys/namei.h Sat Aug 1 06:33:11 2020 (r363753) @@ -69,7 +69,7 @@ struct nameidata { */ const char *ni_dirp; /* pathname pointer */ enum uio_seg ni_segflg; /* location of pathname */ - cap_rights_t ni_rightsneeded; /* rights required to look up vnode */ + cap_rights_t *ni_rightsneeded; /* rights required to look up vnode */ /* * Arguments to lookup. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008010633.0716XBSg041613>