From owner-freebsd-hackers Sun Oct 15 08:16:30 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA27462 for hackers-outgoing; Sun, 15 Oct 1995 08:16:30 -0700 Received: from mail2.digital.com (mail2.digital.com [204.123.2.56]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id IAA27454 ; Sun, 15 Oct 1995 08:16:26 -0700 Received: from muggsy.lkg.dec.com by mail2.digital.com; (5.65 EXP 4/12/95 for V3.2/1.0/WV) id AA30930; Sun, 15 Oct 1995 08:14:04 -0700 Received: from whydos.lkg.dec.com by muggsy.lkg.dec.com (5.65/DEC-Ultrix/4.3) with SMTP id AA08214; Sun, 15 Oct 1995 11:14:03 -0400 Received: from localhost (localhost [127.0.0.1]) by whydos.lkg.dec.com (8.6.11/8.6.9) with SMTP id LAA01923; Sun, 15 Oct 1995 11:23:30 GMT Message-Id: <199510151123.LAA01923@whydos.lkg.dec.com> X-Authentication-Warning: whydos.lkg.dec.com: Host localhost didn't use HELO protocol To: Julian Elischer Cc: hackers@freefall.freebsd.org Subject: Re: suggested changes to mbuf routines In-Reply-To: Your message of "Sat, 14 Oct 1995 04:19:35 MST." <199510141119.EAA05158@freefall.freebsd.org> X-Mailer: exmh version 1.5omega 10/6/94 Date: Sun, 15 Oct 1995 11:21:25 +0000 From: Matt Thomas Sender: owner-hackers@FreeBSD.org Precedence: bulk In <199510141119.EAA05158@freefall.freebsd.org> , you wrote: I find the method of doing the references as done in Digital UNIX (aka DEC OSF/1) quite clean. Basically the m_ext struct gets an queue entry added. When the extended mbuf is first allocated, the link queue entry merely points to itself (an empty queue). As more references are made, their queues get linked together. As references are removed, their queues get unlinked. To see if there is a non-zero reference count, imply see if the queue entry points to itself. /* description of external storage mapped into mbuf, valid if M_EXT set */ struct m_ext { caddr_t ext_buf; /* start of buffer */ #if __STDC__ void (*ext_free)(caddr_t, u_long, caddr_t); #else void (*ext_free)(); /* free routine if not the usual */ #endif u_int ext_size; /* size of buffer, for ext_free */ caddr_t ext_arg; /* additional ext_free argument */ struct ext_refq { /* reference list */ struct ext_refq *forw, *back; } ext_ref; }; #define MCLREFERENCED(m) \ ((m)->m_ext.ext_ref.forw != &((m)->m_ext.ext_ref)) Matt Thomas Internet: matt@lkg.dec.com 3am Software Foundry WWW URL: Westford, MA Disclaimer: Digital disavows all knowledge of this message