summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_cow.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-03-16 07:19:12 +0000
committeralc <alc@FreeBSD.org>2003-03-16 07:19:12 +0000
commit4641d3d127dcdaae61daa54f6eee3d51be117e44 (patch)
treeb0b84c7d63f3af90789b77ca4c9413356ecd7a01 /sys/kern/uipc_cow.c
parentc1838df6038e28d81384d7cf1c41a66c07de573c (diff)
downloadFreeBSD-src-4641d3d127dcdaae61daa54f6eee3d51be117e44.zip
FreeBSD-src-4641d3d127dcdaae61daa54f6eee3d51be117e44.tar.gz
Pass the sf buf to MEXTADD() as the optional argument. This permits
the simplification of socow_iodone() and sf_buf_free(); they don't have to reverse engineer the sf buf from the data's address.
Diffstat (limited to 'sys/kern/uipc_cow.c')
-rw-r--r--sys/kern/uipc_cow.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/uipc_cow.c b/sys/kern/uipc_cow.c
index dfe2c86..2258aca 100644
--- a/sys/kern/uipc_cow.c
+++ b/sys/kern/uipc_cow.c
@@ -77,9 +77,6 @@ struct netsend_cow_stats {
static struct netsend_cow_stats socow_stats = {0,0,0,0,0,0,0,0,0,0,0};
-extern struct sf_buf *sf_bufs;
-extern vm_offset_t sf_base;
-#define dtosf(x) (&sf_bufs[((uintptr_t)(x) - (uintptr_t)sf_base) >> PAGE_SHIFT])
static void socow_iodone(void *addr, void *args);
static void
@@ -89,7 +86,7 @@ socow_iodone(void *addr, void *args)
struct sf_buf *sf;
vm_page_t pp;
- sf = dtosf(addr);
+ sf = args;
pp = sf->m;
s = splvm();
/* remove COW mapping */
@@ -98,7 +95,7 @@ socow_iodone(void *addr, void *args)
vm_page_unlock_queues();
splx(s);
/* note that sf_buf_free() unwires the page for us*/
- sf_buf_free(addr, NULL);
+ sf_buf_free(addr, args);
socow_stats.iodone++;
}
@@ -153,7 +150,7 @@ socow_setup(struct mbuf *m0, struct uio *uio)
*/
m0->m_data = (caddr_t)sf->kva;
m0->m_len = PAGE_SIZE;
- MEXTADD(m0, sf->kva, PAGE_SIZE, socow_iodone, NULL, 0, EXT_SFBUF);
+ MEXTADD(m0, sf->kva, PAGE_SIZE, socow_iodone, sf, 0, EXT_SFBUF);
socow_stats.success++;
iov = uio->uio_iov;
OpenPOWER on IntegriCloud