summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_mbuf.c
diff options
context:
space:
mode:
authorbmilekic <bmilekic@FreeBSD.org>2002-03-03 22:10:04 +0000
committerbmilekic <bmilekic@FreeBSD.org>2002-03-03 22:10:04 +0000
commit4d41cd259b7c4066cf1cb5a0486fd79a75c5c726 (patch)
tree74d3cc379fedcaccb7bcffc437149e5d4ba5cb31 /sys/kern/subr_mbuf.c
parent7b0ce36f943ee834a4976161135b0e49814b3a77 (diff)
downloadFreeBSD-src-4d41cd259b7c4066cf1cb5a0486fd79a75c5c726.zip
FreeBSD-src-4d41cd259b7c4066cf1cb5a0486fd79a75c5c726.tar.gz
Fix bug in mb_alloc that made systems configured with
PAGE_SIZE / MCLBYTES == 1 crash. Fix them by changing the appropriate "allocate new page and bucket" code in mb_alloc to use the macro for properly grabbing an allocated object from a bucket, the one that checks whether the bucket is empty. This should allow ken to continue testing zero-copy stuff on -CURRENT. Noticed and provided debug info: ken
Diffstat (limited to 'sys/kern/subr_mbuf.c')
-rw-r--r--sys/kern/subr_mbuf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c
index ebd06d4..da86199 100644
--- a/sys/kern/subr_mbuf.c
+++ b/sys/kern/subr_mbuf.c
@@ -611,9 +611,7 @@ mb_alloc(struct mb_lstmngr *mb_list, int how, short type)
MB_UNLOCK_CONT(gen_list);
bucket = mb_pop_cont(mb_list, how, cnt_lst);
if (bucket != NULL) {
- bucket->mb_numfree--;
- m = bucket->mb_free[(bucket->mb_numfree)];
- (*(cnt_lst->mb_cont.mc_objcount))--;
+ MB_GET_OBJECT(m, bucket, cnt_lst);
MB_MBTYPES_INC(cnt_lst, type, 1);
MB_UNLOCK_CONT(cnt_lst);
} else {
OpenPOWER on IntegriCloud