summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
committerdwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
commitdd75d1d73b4f3034c1d9f621a49fff58b1d71eb1 (patch)
tree197ae73617ae75afe008897f6906b84835589ea2 /sys/fs
parented5dbfbd3cd619638a7baac288f548aa1398edac (diff)
downloadFreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.zip
FreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.tar.gz
Convert more malloc+bzero to malloc+M_ZERO.
Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c6
-rw-r--r--sys/fs/devfs/devfs_devs.c12
-rw-r--r--sys/fs/devfs/devfs_vfsops.c3
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c3
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c6
-rw-r--r--sys/fs/ntfs/ntfs_subr.c12
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c3
-rw-r--r--sys/fs/unionfs/union_vfsops.c4
8 files changed, 17 insertions, 32 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 49e6169..aaefb78 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -401,8 +401,7 @@ iso_mountfs(devvp, mp, p, argp)
pri_sierra->root_directory_record:
pri->root_directory_record);
- isomp = malloc(sizeof *isomp, M_ISOFSMNT, M_WAITOK);
- bzero((caddr_t)isomp, sizeof *isomp);
+ isomp = malloc(sizeof *isomp, M_ISOFSMNT, M_WAITOK | M_ZERO);
isomp->logical_block_size = logical_block_size;
isomp->volume_space_size =
isonum_733 (high_sierra?
@@ -723,8 +722,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
return (error);
}
MALLOC(ip, struct iso_node *, sizeof(struct iso_node), M_ISOFSNODE,
- M_WAITOK);
- bzero((caddr_t)ip, sizeof(struct iso_node));
+ M_WAITOK | M_ZERO);
lockinit(&vp->v_lock, PINOD, "isonode", 0, 0);
/*
* ISOFS uses stdlock and can share lock structure
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c
index ee4697d..bb6b316 100644
--- a/sys/fs/devfs/devfs_devs.c
+++ b/sys/fs/devfs/devfs_devs.c
@@ -149,15 +149,13 @@ devfs_attemptoverflow(int insist)
or = NULL;
n = devfs_noverflowwant;
nb = sizeof (struct dev_t *) * n;
- MALLOC(ot, dev_t **, nb, M_DEVFS, insist ? M_WAITOK : M_NOWAIT);
+ MALLOC(ot, dev_t **, nb, M_DEVFS, (insist ? M_WAITOK : M_NOWAIT) | M_ZERO);
if (ot == NULL)
goto bail;
- bzero(ot, nb);
nb = sizeof (int) * n;
- MALLOC(or, int *, nb, M_DEVFS, insist ? M_WAITOK : M_NOWAIT);
+ MALLOC(or, int *, nb, M_DEVFS, (insist ? M_WAITOK : M_NOWAIT) | M_ZERO);
if (or == NULL)
goto bail;
- bzero(or, nb);
if (!atomic_cmpset_ptr(&devfs_overflow, NULL, ot))
goto bail;
devfs_refoverflow = or;
@@ -198,8 +196,7 @@ devfs_newdirent(char *name, int namelen)
d.d_namlen = namelen;
i = sizeof (*de) + GENERIC_DIRSIZ(&d);
- MALLOC(de, struct devfs_dirent *, i, M_DEVFS, M_WAITOK);
- bzero(de, i);
+ MALLOC(de, struct devfs_dirent *, i, M_DEVFS, M_WAITOK | M_ZERO);
de->de_dirent = (struct dirent *)(de + 1);
de->de_dirent->d_namlen = namelen;
de->de_dirent->d_reclen = GENERIC_DIRSIZ(&d);
@@ -287,8 +284,7 @@ devfs_populate(struct devfs_mount *dm)
if (devfs_noverflow && dm->dm_overflow == NULL) {
i = devfs_noverflow * sizeof (struct devfs_dirent *);
MALLOC(dm->dm_overflow, struct devfs_dirent **, i,
- M_DEVFS, M_WAITOK);
- bzero(dm->dm_overflow, i);
+ M_DEVFS, M_WAITOK | M_ZERO);
}
while (dm->dm_generation != devfs_generation) {
dm->dm_generation = devfs_generation;
diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c
index 1ff3955..eb13d8f 100644
--- a/sys/fs/devfs/devfs_vfsops.c
+++ b/sys/fs/devfs/devfs_vfsops.c
@@ -79,8 +79,7 @@ devfs_mount(mp, path, data, ndp, p)
return (EOPNOTSUPP);
MALLOC(fmp, struct devfs_mount *, sizeof(struct devfs_mount),
- M_DEVFS, M_WAITOK);
- bzero(fmp, sizeof(*fmp));
+ M_DEVFS, M_WAITOK | M_ZERO);
lockinit(&fmp->dm_lock, PVFS, "devfs", 0, LK_NOPAUSE);
mp->mnt_flag |= MNT_LOCAL;
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index a5be4d8..628ec25 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -371,8 +371,7 @@ hpfs_mountfs(devvp, mp, argsp, p)
/*
* Do actual mount
*/
- hpmp = malloc(sizeof(struct hpfsmount), M_HPFSMNT, M_WAITOK);
- bzero(hpmp, sizeof(struct hpfsmount));
+ hpmp = malloc(sizeof(struct hpfsmount), M_HPFSMNT, M_WAITOK | M_ZERO);
/* Read in SuperBlock */
error = bread(devvp, SUBLOCK, SUSIZE, NOCRED, &bp);
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index 823eb36..30b5522 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -176,8 +176,7 @@ msdosfs_mountroot()
if (bdevvp(rootdev, &rootvp))
panic("msdosfs_mountroot: can't setup rootvp");
- mp = malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK);
- bzero((char *)mp, (u_long)sizeof(struct mount));
+ mp = malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK | M_ZERO);
mp->mnt_op = &msdosfs_vfsops;
mp->mnt_flag = 0;
LIST_INIT(&mp->mnt_vnodelist);
@@ -464,8 +463,7 @@ mountmsdosfs(devvp, mp, p, argp)
}
#endif
- pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK);
- bzero((caddr_t)pmp, sizeof *pmp);
+ pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK | M_ZERO);
pmp->pm_mountp = mp;
/*
diff --git a/sys/fs/ntfs/ntfs_subr.c b/sys/fs/ntfs/ntfs_subr.c
index 839f752..d9b38d4 100644
--- a/sys/fs/ntfs/ntfs_subr.c
+++ b/sys/fs/ntfs/ntfs_subr.c
@@ -394,10 +394,9 @@ ntfs_ntlookup(
}
} while (LOCKMGR(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL));
- MALLOC(ip, struct ntnode *, sizeof(struct ntnode),
- M_NTFSNTNODE, M_WAITOK);
+ MALLOC(ip, struct ntnode *, sizeof(struct ntnode), M_NTFSNTNODE,
+ M_WAITOK | M_ZERO);
ddprintf(("ntfs_ntlookup: allocating ntnode: %d: %p\n", ino, ip));
- bzero((caddr_t) ip, sizeof(struct ntnode));
/* Generic initialization */
ip->i_devvp = ntmp->ntm_devvp;
@@ -544,8 +543,7 @@ ntfs_attrtontvattr(
*rvapp = NULL;
MALLOC(vap, struct ntvattr *, sizeof(struct ntvattr),
- M_NTFSNTVATTR, M_WAITOK);
- bzero(vap, sizeof(struct ntvattr));
+ M_NTFSNTVATTR, M_WAITOK | M_ZERO);
vap->va_ip = NULL;
vap->va_flag = rap->a_hdr.a_flag;
vap->va_type = rap->a_hdr.a_type;
@@ -737,8 +735,8 @@ ntfs_fget(
if (*fpp)
return (0);
- MALLOC(fp, struct fnode *, sizeof(struct fnode), M_NTFSFNODE, M_WAITOK);
- bzero(fp, sizeof(struct fnode));
+ MALLOC(fp, struct fnode *, sizeof(struct fnode), M_NTFSFNODE,
+ M_WAITOK | M_ZERO);
dprintf(("ntfs_fget: allocating fnode: %p\n",fp));
fp->f_ip = ip;
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index e5a0216..7c6b2c0 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -478,8 +478,7 @@ ntfs_mountfs(devvp, mp, argsp, p)
error = bread(devvp, BBLOCK, BBSIZE, NOCRED, &bp);
if (error)
goto out;
- ntmp = malloc( sizeof *ntmp, M_NTFSMNT, M_WAITOK );
- bzero( ntmp, sizeof *ntmp );
+ ntmp = malloc( sizeof *ntmp, M_NTFSMNT, M_WAITOK | M_ZERO);
bcopy( bp->b_data, &ntmp->ntm_bootfile, sizeof(struct bootfile) );
brelse( bp );
bp = NULL;
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index 57a4e98..94cba85 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -179,9 +179,7 @@ union_mount(mp, path, data, ndp, p)
*/
um = (struct union_mount *) malloc(sizeof(struct union_mount),
- M_UNIONFSMNT, M_WAITOK);
-
- bzero(um, sizeof(struct union_mount));
+ M_UNIONFSMNT, M_WAITOK | M_ZERO);
um->um_op = args.mntflags & UNMNT_OPMASK;
OpenPOWER on IntegriCloud