summaryrefslogtreecommitdiff
path: root/sys/fs/devfs
diff options
context:
space:
mode:
authorDavid Malone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
committerDavid Malone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
commit7cc0979fd64b721c92c3dd4a8688b56e15c9a5f9 (patch)
treec383ffd6da8fbab2789828310191f8717f675124 /sys/fs/devfs
parentb1f3daafde37fa36b819c0649c121d98175a6a2d (diff)
Notes
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r--sys/fs/devfs/devfs_devs.c12
-rw-r--r--sys/fs/devfs/devfs_vfsops.c3
2 files changed, 5 insertions, 10 deletions
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c
index ee4697d19e19..bb6b3164b12a 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 1ff395523059..eb13d8f719cb 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;