diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2003-01-30 16:38:40 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2003-01-30 16:38:40 +0000 |
commit | 8cd7b8389cd3d6d42d230c30048e1735d86bba53 (patch) | |
tree | 80cf3c41b4a240cf06175b413a9a728cb42f7c9f /sys | |
parent | d21915b2833b1d60110e4cdb81788860c1c0b43e (diff) |
Stop using an LFS type for cluster mallocs, use an own type and
GC the LFS malloc types until LFS is resurrected.
from tedu@stanford.edu
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_cluster.c | 18 | ||||
-rw-r--r-- | sys/sys/malloc.h | 11 |
2 files changed, 14 insertions, 15 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index fe397b43ed3..1e2dc10d9a6 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_cluster.c,v 1.29 2002/06/14 21:34:59 todd Exp $ */ +/* $OpenBSD: vfs_cluster.c,v 1.30 2003/01/30 16:38:39 art Exp $ */ /* $NetBSD: vfs_cluster.c,v 1.12 1996/04/22 01:39:05 christos Exp $ */ /*- @@ -308,7 +308,7 @@ cluster_rbuild(vp, filesize, bp, lbn, blkno, size, run, flags) return (bp); b_save = malloc(sizeof(struct buf *) * run + - sizeof(struct cluster_save), M_SEGMENT, M_WAITOK); + sizeof(struct cluster_save), M_VCLUSTER, M_WAITOK); b_save->bs_bufsize = b_save->bs_bcount = size; b_save->bs_nchildren = 0; b_save->bs_children = (struct buf **)(b_save + 1); @@ -367,7 +367,7 @@ cluster_rbuild(vp, filesize, bp, lbn, blkno, size, run, flags) bp->b_saveaddr = b_save->bs_saveaddr; bp->b_flags &= ~B_CALL; bp->b_iodone = NULL; - free(b_save, M_SEGMENT); + free(b_save, M_VCLUSTER); } allocbuf(bp, size * i); } @@ -464,7 +464,7 @@ cluster_callback(bp) } bp->b_bcount = bsize; bp->b_iodone = NULL; - free(b_save, M_SEGMENT); + free(b_save, M_VCLUSTER); if (bp->b_flags & B_ASYNC) brelse(bp); else { @@ -532,7 +532,7 @@ cluster_write(bp, ci, filesize) for (bpp = buflist->bs_children; bpp < endbp; bpp++) brelse(*bpp); - free(buflist, M_SEGMENT); + free(buflist, M_VCLUSTER); cluster_wbuild(vp, NULL, bp->b_bcount, ci->ci_cstart, cursize, lbn); } else { @@ -542,7 +542,7 @@ cluster_write(bp, ci, filesize) for (bpp = buflist->bs_children; bpp <= endbp; bpp++) bdwrite(*bpp); - free(buflist, M_SEGMENT); + free(buflist, M_VCLUSTER); ci->ci_lastw = lbn; ci->ci_lasta = bp->b_blkno; return; @@ -665,7 +665,7 @@ redo: --len; b_save = malloc(sizeof(struct buf *) * len + - sizeof(struct cluster_save), M_SEGMENT, M_WAITOK); + sizeof(struct cluster_save), M_VCLUSTER, M_WAITOK); b_save->bs_bcount = bp->b_bcount; b_save->bs_bufsize = bp->b_bufsize; b_save->bs_nchildren = 0; @@ -740,7 +740,7 @@ redo: bp->b_saveaddr = b_save->bs_saveaddr; bp->b_flags &= ~B_CALL; bp->b_iodone = NULL; - free(b_save, M_SEGMENT); + free(b_save, M_VCLUSTER); } bawrite(bp); if (i < len) { @@ -766,7 +766,7 @@ cluster_collectbufs(vp, ci, last_bp) len = ci->ci_lastw - ci->ci_cstart + 1; buflist = malloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist), - M_SEGMENT, M_WAITOK); + M_VCLUSTER, M_WAITOK); buflist->bs_nchildren = 0; buflist->bs_children = (struct buf **)(buflist + 1); for (lbn = ci->ci_cstart, i = 0; i < len; lbn++, i++) diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index b6c5970d5d4..8cceda0d894 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.h,v 1.64 2003/01/27 22:23:45 miod Exp $ */ +/* $OpenBSD: malloc.h,v 1.65 2003/01/30 16:38:39 art Exp $ */ /* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */ /* @@ -99,9 +99,8 @@ #define M_LOCKF 40 /* Byte-range locking structures */ #define M_PROC 41 /* Proc structures */ #define M_SUBPROC 42 /* Proc sub-structures */ -#define M_SEGMENT 43 /* Segment for LFS */ -#define M_LFSNODE 44 /* LFS vnode private part */ -/* 45 - free */ +#define M_VCLUSTER 43 /* Cluster for VFS */ +/* 45-46 - free */ #define M_MFSNODE 46 /* MFS vnode private part */ /* 47-48 - free */ #define M_NETADDR 49 /* Export host address structure */ @@ -212,8 +211,8 @@ "lockf", /* 40 M_LOCKF */ \ "proc", /* 41 M_PROC */ \ "subproc", /* 42 M_SUBPROC */ \ - "LFS segment", /* 43 M_SEGMENT */ \ - "LFS node", /* 44 M_LFSNODE */ \ + "VFS cluster", /* 43 M_VCLUSTER */ \ + NULL, \ NULL, \ "MFS node", /* 46 M_MFSNODE */ \ NULL, \ |