diff options
author | Alan Cox <alc@FreeBSD.org> | 2003-03-16 07:19:12 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2003-03-16 07:19:12 +0000 |
commit | 42de97a50adceeeed09e8e804adb09e9b61ebc0b (patch) | |
tree | b0b84c7d63f3af90789b77ca4c9413356ecd7a01 /sys/kern/uipc_cow.c | |
parent | 5501d40bb905f88fa25e4d3666eec4ec6df7c3ea (diff) | |
download | src-42de97a50adceeeed09e8e804adb09e9b61ebc0b.tar.gz src-42de97a50adceeeed09e8e804adb09e9b61ebc0b.zip |
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.
Notes
Notes:
svn path=/head/; revision=112316
Diffstat (limited to 'sys/kern/uipc_cow.c')
-rw-r--r-- | sys/kern/uipc_cow.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/uipc_cow.c b/sys/kern/uipc_cow.c index dfe2c8690ce3..2258aca7ee56 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; |