Date: Mon, 16 Oct 1995 18:21:08 -0700 (PDT) From: Julian Elischer <julian@ref.tfs.com> To: terry@lambert.org (Terry Lambert) Cc: matt@lkg.dec.com, julian@freefall.freebsd.org, hackers@freefall.freebsd.orgrgrimes@freebsd.org Subject: Re: suggested changes to mbuf routines Message-ID: <199510170121.SAA16783@ref.tfs.com> In-Reply-To: <199510162001.NAA25213@phaeton.artisoft.com> from "Terry Lambert" at Oct 16, 95 01:01:07 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
ah I was wondering what that was...
I was looking at that in OSF1/i386 and scratching my head about it..
I guess that means that whatever is externally allocated need not have it's own
reference counts..
(unless they are also used elsewhere than for mbufs)
not sure which I prefer..
rod, is this given in the device driver's book?
>
>
> /* description of external storage mapped into mbuf, valid if M_EXT set */
> struct m_ext {
> caddr_t ext_buf; /* start of buffer */
> void (*ext_free)(caddr_t, u_long, caddr_t);
> 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))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510170121.SAA16783>
