aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_cow.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2003-11-16 06:11:26 +0000
committerAlan Cox <alc@FreeBSD.org>2003-11-16 06:11:26 +0000
commite45db9b837dc530b86149374e2baeaa775061107 (patch)
treeb69ee615792b94ee1abcb1231c0534c04003fef9 /sys/kern/uipc_cow.c
parent78a53859a043223696370900fe4fba3d0408435e (diff)
downloadsrc-e45db9b837dc530b86149374e2baeaa775061107.tar.gz
src-e45db9b837dc530b86149374e2baeaa775061107.zip
- Modify alpha's sf_buf implementation to use the direct virtual-to-
physical mapping. - Move the sf_buf API to its own header file; make struct sf_buf's definition machine dependent. In this commit, we remove an unnecessary field from struct sf_buf on the alpha, amd64, and ia64. Ultimately, we may eliminate struct sf_buf on those architecures except as an opaque pointer that references a vm page.
Notes
Notes: svn path=/head/; revision=122780
Diffstat (limited to 'sys/kern/uipc_cow.c')
-rw-r--r--sys/kern/uipc_cow.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/uipc_cow.c b/sys/kern/uipc_cow.c
index 88d0f9f80cd9..b475efff591e 100644
--- a/sys/kern/uipc_cow.c
+++ b/sys/kern/uipc_cow.c
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/mbuf.h>
+#include <sys/sf_buf.h>
#include <sys/socketvar.h>
#include <sys/uio.h>
@@ -82,7 +83,7 @@ socow_iodone(void *addr, void *args)
vm_page_t pp;
sf = args;
- pp = sf->m;
+ pp = sf_buf_page(sf);
s = splvm();
/* remove COW mapping */
vm_page_lock_queues();
@@ -144,9 +145,10 @@ socow_setup(struct mbuf *m0, struct uio *uio)
/*
* attach to mbuf
*/
- m0->m_data = (caddr_t)sf->kva;
+ m0->m_data = (caddr_t)sf_buf_kva(sf);
m0->m_len = PAGE_SIZE;
- MEXTADD(m0, sf->kva, PAGE_SIZE, socow_iodone, sf, M_RDONLY, EXT_SFBUF);
+ MEXTADD(m0, sf_buf_kva(sf), PAGE_SIZE, socow_iodone, sf, M_RDONLY,
+ EXT_SFBUF);
socow_stats.success++;
iov = uio->uio_iov;