diff options
author | phk <phk@FreeBSD.org> | 1997-10-12 20:26:33 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1997-10-12 20:26:33 +0000 |
commit | 36e7a51ea1dedf0fc860ff3106aee1db1ab3b1f5 (patch) | |
tree | e21c1d8330cbd5fba838afec549f8e4f0f66e451 /sys/miscfs | |
parent | 8ae70d2227594ff4a283453ca3cc3031eb78c14b (diff) | |
download | FreeBSD-src-36e7a51ea1dedf0fc860ff3106aee1db1ab3b1f5.zip FreeBSD-src-36e7a51ea1dedf0fc860ff3106aee1db1ab3b1f5.tar.gz |
Last major round (Unless Bruce thinks of somthing :-) of malloc changes.
Distribute all but the most fundamental malloc types. This time I also
remembered the trick to making things static: Put "static" in front of
them.
A couple of finer points by: bde
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_tree.c | 8 | ||||
-rw-r--r-- | sys/miscfs/devfs/devfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/miscfs/fdesc/fdesc_vfsops.c | 8 | ||||
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 4 | ||||
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vfsops.c | 10 | ||||
-rw-r--r-- | sys/miscfs/nullfs/null_vfsops.c | 12 | ||||
-rw-r--r-- | sys/miscfs/portal/portal_vfsops.c | 10 | ||||
-rw-r--r-- | sys/miscfs/umapfs/umap_vfsops.c | 10 | ||||
-rw-r--r-- | sys/miscfs/union/union_vfsops.c | 10 |
9 files changed, 44 insertions, 32 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index b37b65e..be1deab 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.42 1997/10/10 07:54:05 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.43 1997/10/11 18:31:28 phk Exp $ */ #include "opt_devfs.h" @@ -11,11 +11,11 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/conf.h> +#include <sys/malloc.h> #include <sys/mount.h> #include <sys/proc.h> #include <sys/time.h> #include <sys/vnode.h> -#include <sys/malloc.h> #include <sys/devfsext.h> #include <machine/stdarg.h> @@ -23,8 +23,8 @@ #include <miscfs/devfs/devfsdefs.h> -MALLOC_DEFINE(M_DEVFSNODE, "DEVFS node", "DEVFS node"); -MALLOC_DEFINE(M_DEVFSNAME, "DEVFS name", "DEVFS name"); +static MALLOC_DEFINE(M_DEVFSNODE, "DEVFS node", "DEVFS node"); +static MALLOC_DEFINE(M_DEVFSNAME, "DEVFS name", "DEVFS name"); devnm_p dev_root; /* root of the backing tree */ struct mount *devfs_hidden_mount; diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index d043974..51bdd71 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.20 1997/08/16 19:15:10 wollman Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.21 1997/10/11 18:31:28 phk Exp $ * * */ @@ -15,7 +15,7 @@ #include <miscfs/devfs/devfsdefs.h> -MALLOC_DEFINE(M_DEVFSMNT, "DEVFS mount", "DEVFS mount structure"); +static MALLOC_DEFINE(M_DEVFSMNT, "DEVFS mount", "DEVFS mount structure"); static int devfs_statfs( struct mount *mp, struct statfs *sbp, struct proc *p); static int mountdevfs( struct mount *mp, struct proc *p); diff --git a/sys/miscfs/fdesc/fdesc_vfsops.c b/sys/miscfs/fdesc/fdesc_vfsops.c index e80c69d..b57b236 100644 --- a/sys/miscfs/fdesc/fdesc_vfsops.c +++ b/sys/miscfs/fdesc/fdesc_vfsops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * - * $Id: fdesc_vfsops.c,v 1.11 1997/08/02 14:31:59 bde Exp $ + * $Id: fdesc_vfsops.c,v 1.12 1997/08/16 19:15:12 wollman Exp $ */ /* @@ -53,6 +53,8 @@ #include <sys/malloc.h> #include <miscfs/fdesc/fdesc.h> +static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure"); + static int fdesc_fhtovp __P((struct mount *mp, struct fid *fhp, struct mbuf *nam, struct vnode **vpp, int *exflagsp, struct ucred **credanonp)); @@ -98,7 +100,7 @@ fdesc_mount(mp, path, data, ndp, p) return (error); MALLOC(fmp, struct fdescmount *, sizeof(struct fdescmount), - M_UFSMNT, M_WAITOK); /* XXX */ + M_FDESCMNT, M_WAITOK); /* XXX */ rvp->v_type = VDIR; rvp->v_flag |= VROOT; fmp->f_root = rvp; @@ -158,7 +160,7 @@ fdesc_unmount(mp, mntflags, p) /* * Finally, throw away the fdescmount structure */ - free(mp->mnt_data, M_UFSMNT); /* XXX */ + free(mp->mnt_data, M_FDESCMNT); /* XXX */ mp->mnt_data = 0; return (0); diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index bab3f53..27553a9 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -31,20 +31,20 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 - * $Id: fifo_vnops.c,v 1.26 1997/09/02 20:06:11 bde Exp $ + * $Id: fifo_vnops.c,v 1.27 1997/09/14 02:57:53 peter Exp $ */ #include <sys/param.h> #include <sys/systm.h> #include <sys/unistd.h> #include <sys/kernel.h> +#include <sys/malloc.h> #include <sys/vnode.h> #include <sys/socket.h> #include <sys/socketvar.h> #include <sys/filio.h> #include <sys/fcntl.h> #include <sys/file.h> -#include <sys/malloc.h> #include <sys/poll.h> #include <sys/un.h> #include <miscfs/fifofs/fifo.h> diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 57f1538..897e9b0 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95 - * $Id: kernfs_vfsops.c,v 1.18 1997/02/22 09:40:19 peter Exp $ + * $Id: kernfs_vfsops.c,v 1.19 1997/08/02 14:32:02 bde Exp $ */ /* @@ -52,6 +52,8 @@ #include <miscfs/kernfs/kernfs.h> +static MALLOC_DEFINE(M_KERNFSMNT, "KERNFS mount", "KERNFS mount structure"); + dev_t rrootdev = NODEV; static int cdevvp __P((dev_t dev, struct vnode **vpp)); @@ -128,11 +130,11 @@ kernfs_mount(mp, path, data, ndp, p) return (EOPNOTSUPP); MALLOC(fmp, struct kernfs_mount *, sizeof(struct kernfs_mount), - M_UFSMNT, M_WAITOK); /* XXX */ + M_KERNFSMNT, M_WAITOK); /* XXX */ error = getnewvnode(VT_KERNFS, mp, kernfs_vnodeop_p, &rvp); /* XXX */ if (error) { - FREE(fmp, M_UFSMNT); + FREE(fmp, M_KERNFSMNT); return (error); } @@ -213,7 +215,7 @@ kernfs_unmount(mp, mntflags, p) /* * Finally, throw away the kernfs_mount structure */ - free(mp->mnt_data, M_UFSMNT); /* XXX */ + free(mp->mnt_data, M_KERNFSMNT); /* XXX */ mp->mnt_data = 0; return 0; } diff --git a/sys/miscfs/nullfs/null_vfsops.c b/sys/miscfs/nullfs/null_vfsops.c index ea5711f..29be50a 100644 --- a/sys/miscfs/nullfs/null_vfsops.c +++ b/sys/miscfs/nullfs/null_vfsops.c @@ -36,7 +36,7 @@ * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94 * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 - * $Id: null_vfsops.c,v 1.18 1997/08/02 14:32:05 bde Exp $ + * $Id: null_vfsops.c,v 1.19 1997/08/16 19:15:16 wollman Exp $ */ /* @@ -48,12 +48,14 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/proc.h> +#include <sys/malloc.h> #include <sys/vnode.h> #include <sys/mount.h> #include <sys/namei.h> -#include <sys/malloc.h> #include <miscfs/nullfs/null.h> +static MALLOC_DEFINE(M_NULLFSMNT, "NULLFS mount", "NULLFS mount structure"); + static int nullfs_fhtovp __P((struct mount *mp, struct fid *fidp, struct sockaddr *nam, struct vnode **vpp, int *exflagsp, struct ucred **credanonp)); @@ -154,7 +156,7 @@ nullfs_mount(mp, path, data, ndp, p) } xmp = (struct null_mount *) malloc(sizeof(struct null_mount), - M_UFSMNT, M_WAITOK); /* XXX */ + M_NULLFSMNT, M_WAITOK); /* XXX */ /* * Save reference to underlying FS @@ -175,7 +177,7 @@ nullfs_mount(mp, path, data, ndp, p) */ if (error) { vrele(lowerrootvp); - free(xmp, M_UFSMNT); /* XXX */ + free(xmp, M_NULLFSMNT); /* XXX */ return (error); } @@ -268,7 +270,7 @@ nullfs_unmount(mp, mntflags, p) /* * Finally, throw away the null_mount structure */ - free(mp->mnt_data, M_UFSMNT); /* XXX */ + free(mp->mnt_data, M_NULLFSMNT); /* XXX */ mp->mnt_data = 0; return 0; } diff --git a/sys/miscfs/portal/portal_vfsops.c b/sys/miscfs/portal/portal_vfsops.c index c70e73e..15e81b6 100644 --- a/sys/miscfs/portal/portal_vfsops.c +++ b/sys/miscfs/portal/portal_vfsops.c @@ -35,7 +35,7 @@ * * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95 * - * $Id: portal_vfsops.c,v 1.16 1997/08/02 14:32:07 bde Exp $ + * $Id: portal_vfsops.c,v 1.17 1997/08/16 19:15:17 wollman Exp $ */ /* @@ -57,6 +57,8 @@ #include <sys/domain.h> #include <miscfs/portal/portal.h> +static MALLOC_DEFINE(M_PORTALFSMNT, "PORTAL mount", "PORTAL mount structure"); + static int portal_init __P((struct vfsconf *)); static int portal_mount __P((struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, struct proc *p)); @@ -116,11 +118,11 @@ portal_mount(mp, path, data, ndp, p) M_TEMP, M_WAITOK); MALLOC(fmp, struct portalmount *, sizeof(struct portalmount), - M_UFSMNT, M_WAITOK); /* XXX */ + M_PORTALFSMNT, M_WAITOK); /* XXX */ error = getnewvnode(VT_PORTAL, mp, portal_vnodeop_p, &rvp); /* XXX */ if (error) { - FREE(fmp, M_UFSMNT); + FREE(fmp, M_PORTALFSMNT); FREE(pn, M_TEMP); return (error); } @@ -213,7 +215,7 @@ portal_unmount(mp, mntflags, p) /* * Finally, throw away the portalmount structure */ - free(mp->mnt_data, M_UFSMNT); /* XXX */ + free(mp->mnt_data, M_PORTALFSMNT); /* XXX */ mp->mnt_data = 0; return (0); } diff --git a/sys/miscfs/umapfs/umap_vfsops.c b/sys/miscfs/umapfs/umap_vfsops.c index 20c0c4c..0281678 100644 --- a/sys/miscfs/umapfs/umap_vfsops.c +++ b/sys/miscfs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * - * $Id: umap_vfsops.c,v 1.15 1997/08/02 14:32:25 bde Exp $ + * $Id: umap_vfsops.c,v 1.16 1997/08/16 19:15:21 wollman Exp $ */ /* @@ -53,6 +53,8 @@ #include <sys/malloc.h> #include <miscfs/umapfs/umap.h> +static MALLOC_DEFINE(M_UMAPFSMNT, "UMAP mount", "UMAP mount structure"); + static int umapfs_fhtovp __P((struct mount *mp, struct fid *fidp, struct sockaddr *nam, struct vnode **vpp, int *exflagsp, struct ucred **credanonp)); @@ -138,7 +140,7 @@ umapfs_mount(mp, path, data, ndp, p) #endif amp = (struct umap_mount *) malloc(sizeof(struct umap_mount), - M_UFSMNT, M_WAITOK); /* XXX */ + M_UMAPFSMNT, M_WAITOK); /* XXX */ /* * Save reference to underlying FS @@ -190,7 +192,7 @@ umapfs_mount(mp, path, data, ndp, p) */ if (error) { vrele(lowerrootvp); - free(amp, M_UFSMNT); /* XXX */ + free(amp, M_UMAPFSMNT); /* XXX */ return (error); } @@ -283,7 +285,7 @@ umapfs_unmount(mp, mntflags, p) /* * Finally, throw away the umap_mount structure */ - free(mp->mnt_data, M_UFSMNT); /* XXX */ + free(mp->mnt_data, M_UMAPFSMNT); /* XXX */ mp->mnt_data = 0; return (0); } diff --git a/sys/miscfs/union/union_vfsops.c b/sys/miscfs/union/union_vfsops.c index 8478a1c..5ace7ce 100644 --- a/sys/miscfs/union/union_vfsops.c +++ b/sys/miscfs/union/union_vfsops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 - * $Id: union_vfsops.c,v 1.19 1997/08/16 19:15:22 wollman Exp $ + * $Id: union_vfsops.c,v 1.20 1997/09/27 13:39:29 kato Exp $ */ /* @@ -53,6 +53,8 @@ #include <sys/filedesc.h> #include <miscfs/union/union.h> +static MALLOC_DEFINE(M_UNIONFSMNT, "UNION mount", "UNION mount structure"); + extern int union_init __P((struct vfsconf *)); extern int union_fhtovp __P((struct mount *mp, struct fid *fidp, @@ -176,7 +178,7 @@ union_mount(mp, path, data, ndp, p) } um = (struct union_mount *) malloc(sizeof(struct union_mount), - M_UFSMNT, M_WAITOK); /* XXX */ + M_UNIONFSMNT, M_WAITOK); /* XXX */ /* * Keep a held reference to the target vnodes. @@ -286,7 +288,7 @@ union_mount(mp, path, data, ndp, p) bad: if (um) - free(um, M_UFSMNT); + free(um, M_UNIONFSMNT); if (cred) crfree(cred); if (upperrootvp) @@ -390,7 +392,7 @@ union_unmount(mp, mntflags, p) /* * Finally, throw away the union_mount structure */ - free(mp->mnt_data, M_UFSMNT); /* XXX */ + free(mp->mnt_data, M_UNIONFSMNT); /* XXX */ mp->mnt_data = 0; return (0); } |