diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-09-27 16:13:47 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-09-27 16:13:47 +0000 |
commit | 65b1f06cea909e6a64a8e8d4ae880e0e2c4b3283 (patch) | |
tree | bf632c8f3751a732375b958a12de937f6df03ce0 /sys/kern/sys_generic.c | |
parent | f01126fae0382ad656a4cdc3a0ff931e61ee6856 (diff) |
replace MALLOC/FREE w/ malloc/free for non-constant-sized memory allocations; art@ ok
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 3c53a9b7a85..593bd2e42b4 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.26 2000/07/07 14:33:20 art Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.27 2000/09/27 16:13:46 mickey Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -225,8 +225,7 @@ dofilereadv(p, fd, fp, iovp, iovcnt, offset, retval) error = EINVAL; goto out; } - MALLOC(iov, struct iovec *, iovlen, M_IOV, M_WAITOK); - needfree = iov; + iov = needfree = malloc(iovlen, M_IOV, M_WAITOK); } else if ((u_int)iovcnt > 0) { iov = aiov; needfree = NULL; @@ -262,7 +261,7 @@ dofilereadv(p, fd, fp, iovp, iovcnt, offset, retval) * if tracing, save a copy of iovec */ if (KTRPOINT(p, KTR_GENIO)) { - MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); + ktriov = malloc(iovlen, M_TEMP, M_WAITOK); bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen); } #endif @@ -278,13 +277,13 @@ dofilereadv(p, fd, fp, iovp, iovcnt, offset, retval) if (error == 0) ktrgenio(p->p_tracep, fd, UIO_READ, ktriov, cnt, error); - FREE(ktriov, M_TEMP); + free(ktriov, M_TEMP); } #endif *retval = cnt; done: if (needfree) - FREE(needfree, M_IOV); + free(needfree, M_IOV); out: #if notyet FILE_UNUSE(fp, p); @@ -450,8 +449,7 @@ dofilewritev(p, fd, fp, iovp, iovcnt, offset, retval) if ((u_int)iovcnt > UIO_SMALLIOV) { if ((u_int)iovcnt > IOV_MAX) return (EINVAL); - MALLOC(iov, struct iovec *, iovlen, M_IOV, M_WAITOK); - needfree = iov; + iov = needfree = malloc(iovlen, M_IOV, M_WAITOK); } else if ((u_int)iovcnt > 0) { iov = aiov; needfree = NULL; @@ -487,7 +485,7 @@ dofilewritev(p, fd, fp, iovp, iovcnt, offset, retval) * if tracing, save a copy of iovec */ if (KTRPOINT(p, KTR_GENIO)) { - MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); + ktriov = malloc(iovlen, M_TEMP, M_WAITOK); bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen); } #endif @@ -506,13 +504,13 @@ dofilewritev(p, fd, fp, iovp, iovcnt, offset, retval) if (error == 0) ktrgenio(p->p_tracep, fd, UIO_WRITE, ktriov, cnt, error); - FREE(ktriov, M_TEMP); + free(ktriov, M_TEMP); } #endif *retval = cnt; done: if (needfree) - FREE(needfree, M_IOV); + free(needfree, M_IOV); out: #if notyet FILE_UNUSE(fp, p); |