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/fs | |
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/fs')
-rw-r--r-- | sys/fs/cd9660/cd9660_node.h | 7 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vfsops.c | 8 | ||||
-rw-r--r-- | sys/fs/fifofs/fifo_vnops.c | 4 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_denode.c | 4 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 5 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfsmount.h | 6 | ||||
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 12 | ||||
-rw-r--r-- | sys/fs/portalfs/portal_vfsops.c | 10 | ||||
-rw-r--r-- | sys/fs/umapfs/umap_vfsops.c | 10 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vfsops.c | 10 |
11 files changed, 51 insertions, 29 deletions
diff --git a/sys/fs/cd9660/cd9660_node.h b/sys/fs/cd9660/cd9660_node.h index a1ab0b1..92e214f 100644 --- a/sys/fs/cd9660/cd9660_node.h +++ b/sys/fs/cd9660/cd9660_node.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_node.h 8.6 (Berkeley) 5/14/95 - * $Id: cd9660_node.h,v 1.11 1997/04/14 18:15:45 phk Exp $ + * $Id: cd9660_node.h,v 1.12 1997/08/26 07:32:31 phk Exp $ */ /* @@ -92,6 +92,11 @@ struct iso_node { #define VTOI(vp) ((struct iso_node *)(vp)->v_data) #define ITOV(ip) ((ip)->i_vnode) +#ifdef MALLOC_DECLARE +MALLOC_DECLARE(M_ISOFSMNT); +MALLOC_DECLARE(M_ISOFSNODE); +#endif + /* * Prototypes for ISOFS vnode operations */ diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index b29a042..3d23f09 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $Id: cd9660_vfsops.c,v 1.28 1997/09/07 16:20:42 bde Exp $ + * $Id: cd9660_vfsops.c,v 1.29 1997/09/27 13:38:48 kato Exp $ */ #include <sys/param.h> @@ -59,6 +59,8 @@ #include <isofs/cd9660/cd9660_node.h> #include <isofs/cd9660/cd9660_mount.h> +MALLOC_DEFINE(M_ISOFSMNT, "ISOFS mount", "ISOFS mount structure"); +MALLOC_DEFINE(M_ISOFSNODE, "ISOFS node", "ISOFS vnode private part"); static int cd9660_mount __P((struct mount *, char *, caddr_t, struct nameidata *, struct proc *)); diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index e80c69d..b57b236 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/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/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index bab3f53..27553a9 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/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/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 2c3876b..fc2d3db 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_denode.c,v 1.26 1997/09/02 20:06:15 bde Exp $ */ +/* $Id: msdosfs_denode.c,v 1.27 1997/10/11 18:31:30 phk Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.9 1994/08/21 18:44:00 ws Exp $ */ /*- @@ -66,7 +66,7 @@ #include <msdosfs/denode.h> #include <msdosfs/fat.h> -MALLOC_DEFINE(M_MSDOSFSNODE, "MSDOSFS node", "MSDOSFS vnode private part"); +static MALLOC_DEFINE(M_MSDOSFSNODE, "MSDOSFS node", "MSDOSFS vnode private part"); struct denode **dehashtbl; u_long dehash; /* size of hash table - 1 */ diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index c0d287c..9cebfb2 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.20 1997/08/16 19:15:24 wollman Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.21 1997/10/11 18:31:30 phk Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */ /*- @@ -67,7 +67,8 @@ #include <msdosfs/msdosfsmount.h> #include <msdosfs/fat.h> -MALLOC_DEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOSFS file allocation table"); +MALLOC_DEFINE(M_MSDOSFSMNT, "MSDOSFS mount", "MSDOSFS mount structure"); +static MALLOC_DEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOSFS file allocation table"); static int mountmsdosfs __P((struct vnode *devvp, struct mount *mp, struct proc *p)); diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index 0ab41b4..49a9327 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -1,4 +1,4 @@ -/* $Id: msdosfsmount.h,v 1.10 1997/02/22 09:40:49 peter Exp $ */ +/* $Id: msdosfsmount.h,v 1.11 1997/03/03 17:36:11 bde Exp $ */ /* $NetBSD: msdosfsmount.h,v 1.7 1994/08/21 18:44:17 ws Exp $ */ /*- @@ -53,6 +53,10 @@ #ifdef KERNEL +#ifdef MALLOC_DECLARE +MALLOC_DECLARE(M_MSDOSFSMNT); +#endif + /* * Layout of the mount control block for a msdos file system. */ diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index ea5711f..29be50a 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/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/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c index c70e73e..15e81b6 100644 --- a/sys/fs/portalfs/portal_vfsops.c +++ b/sys/fs/portalfs/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/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index 20c0c4c..0281678 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/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/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 8478a1c..5ace7ce 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/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); } |