diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2008-02-01 19:36:27 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2008-02-01 19:36:27 +0000 |
commit | cf827063a9684f2300b3496f588aaf3e69c45067 (patch) | |
tree | b6b52f57b7886a5c374749c60734afe1b730790f /sys/sys/mbuf.h | |
parent | 942fe01f6169e0d7da79f6b35f96ed07c571f121 (diff) | |
download | src-cf827063a9684f2300b3496f588aaf3e69c45067.tar.gz src-cf827063a9684f2300b3496f588aaf3e69c45067.zip |
Give MEXTADD() another argument to make both void pointers to the
free function controlable, instead of passing the KVA of the buffer
storage as the first argument.
Fix all conventional users of the API to pass the KVA of the buffer
as the first argument, to make this a no-op commit.
Likely break the only non-convetional user of the API, after informing
the relevant committer.
Update the mbuf(9) manual page, which was already out of sync on
this point.
Bump __FreeBSD_version to 800016 as there is no way to tell how
many arguments a CPP macro needs any other way.
This paves the way for giving sendfile(9) a way to wait for the
passed storage to have been accessed before returning.
This does not affect the memory layout or size of mbufs.
Parental oversight by: sam and rwatson.
No MFC is anticipated.
Notes
Notes:
svn path=/head/; revision=175872
Diffstat (limited to 'sys/sys/mbuf.h')
-rw-r--r-- | sys/sys/mbuf.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 5a499e5c0ee0..7096e89c2e0b 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -131,7 +131,8 @@ struct m_ext { caddr_t ext_buf; /* start of buffer */ void (*ext_free) /* free routine if not the usual */ (void *, void *); - void *ext_args; /* optional argument pointer */ + void *ext_arg1; /* optional argument pointer */ + void *ext_arg2; /* optional argument pointer */ u_int ext_size; /* size of buffer, for ext_free */ volatile u_int *ref_cnt; /* pointer to ref count info */ int ext_type; /* type of external storage */ @@ -586,7 +587,7 @@ m_cljset(struct mbuf *m, void *cl, int type) } m->m_data = m->m_ext.ext_buf = cl; - m->m_ext.ext_free = m->m_ext.ext_args = NULL; + m->m_ext.ext_free = m->m_ext.ext_arg1 = m->m_ext.ext_arg2 = NULL; m->m_ext.ext_size = size; m->m_ext.ext_type = type; m->m_ext.ref_cnt = uma_find_refcnt(zone, cl); @@ -618,8 +619,8 @@ m_last(struct mbuf *m) #define MGET(m, how, type) ((m) = m_get((how), (type))) #define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type))) #define MCLGET(m, how) m_clget((m), (how)) -#define MEXTADD(m, buf, size, free, args, flags, type) \ - m_extadd((m), (caddr_t)(buf), (size), (free), (args), (flags), (type)) +#define MEXTADD(m, buf, size, free, arg1, arg2, flags, type) \ + m_extadd((m), (caddr_t)(buf), (size), (free),(arg1),(arg2),(flags), (type)) #define m_getm(m, len, how, type) \ m_getm2((m), (len), (how), (type), M_PKTHDR) @@ -745,7 +746,7 @@ int m_apply(struct mbuf *, int, int, int m_append(struct mbuf *, int, c_caddr_t); void m_cat(struct mbuf *, struct mbuf *); void m_extadd(struct mbuf *, caddr_t, u_int, - void (*)(void *, void *), void *, int, int); + void (*)(void *, void *), void *, void *, int, int); struct mbuf *m_collapse(struct mbuf *, int, int); void m_copyback(struct mbuf *, int, int, c_caddr_t); void m_copydata(const struct mbuf *, int, int, caddr_t); |