diff options
author | eivind <eivind@FreeBSD.org> | 2000-01-08 16:20:06 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 2000-01-08 16:20:06 +0000 |
commit | 767bad2cc1f381bd5077391c9521964b65163796 (patch) | |
tree | d74107b7888790b8e1a9aec6400aa6ca12877245 /sys/kern/vfs_subr.c | |
parent | b01aee8509d989b16357d27db2a9e3d106bacc88 (diff) | |
download | FreeBSD-src-767bad2cc1f381bd5077391c9521964b65163796.zip FreeBSD-src-767bad2cc1f381bd5077391c9521964b65163796.tar.gz |
Change NDFREE() from a macro to a function for the time being; the macro
version caused intolerable bloat (30k). I'm likely to revisit this with an
attempt at a smarter macro.
Bloat noticed by: bde
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index f59d819..54c7ad1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -56,6 +56,7 @@ #include <sys/kthread.h> #include <sys/malloc.h> #include <sys/mount.h> +#include <sys/namei.h> #include <sys/proc.h> #include <sys/reboot.h> #include <sys/socket.h> @@ -2888,3 +2889,36 @@ vn_isdisk(vp) return (1); } +void +NDFREE(ndp, flags) + struct nameidata *ndp; + const uint flags; +{ + if (!(flags & NDF_NO_FREE_PNBUF) && + (ndp->ni_cnd.cn_flags & HASBUF)) { + zfree(namei_zone, ndp->ni_cnd.cn_pnbuf); + ndp->ni_cnd.cn_flags &= ~HASBUF; + } + if (!(flags & NDF_NO_DVP_UNLOCK) && + (ndp->ni_cnd.cn_flags & LOCKPARENT) && + ndp->ni_dvp != ndp->ni_vp) + VOP_UNLOCK(ndp->ni_dvp, 0, ndp->ni_cnd.cn_proc); + if (!(flags & NDF_NO_DVP_RELE) && + (ndp->ni_cnd.cn_flags & (LOCKPARENT|WANTPARENT))) { + vrele(ndp->ni_dvp); + ndp->ni_dvp = NULL; + } + if (!(flags & NDF_NO_VP_UNLOCK) && + (ndp->ni_cnd.cn_flags & LOCKLEAF) && ndp->ni_vp) + VOP_UNLOCK(ndp->ni_vp, 0, ndp->ni_cnd.cn_proc); + if (!(flags & NDF_NO_VP_RELE) && + ndp->ni_vp) { + vrele(ndp->ni_vp); + ndp->ni_vp = NULL; + } + if (!(flags & NDF_NO_STARTDIR_RELE) && + (ndp->ni_cnd.cn_flags & SAVESTART)) { + vrele(ndp->ni_startdir); + ndp->ni_startdir = NULL; + } +} |