diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2000-12-08 21:51:06 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2000-12-08 21:51:06 +0000 |
commit | dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1 (patch) | |
tree | 197ae73617ae75afe008897f6906b84835589ea2 /sys/fs/devfs | |
parent | ed5dbfbd3cd619638a7baac288f548aa1398edac (diff) | |
download | FreeBSD-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/devfs')
-rw-r--r-- | sys/fs/devfs/devfs_devs.c | 12 | ||||
-rw-r--r-- | sys/fs/devfs/devfs_vfsops.c | 3 |
2 files changed, 5 insertions, 10 deletions
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; |