diff options
author | alc <alc@FreeBSD.org> | 2004-03-17 23:25:04 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-03-17 23:25:04 +0000 |
commit | d48f3c1617a812174563441a29dba92ae9f3d9dc (patch) | |
tree | aaa646ea533098fb81f5fc584e59206ec26037f3 /sys/kern/uipc_cow.c | |
parent | 5091cee4e6b00274b99c80c60ca89b1bd7f41e08 (diff) | |
download | FreeBSD-src-d48f3c1617a812174563441a29dba92ae9f3d9dc.zip FreeBSD-src-d48f3c1617a812174563441a29dba92ae9f3d9dc.tar.gz |
Revise socow_iodone() in light of recent sf_buf changes. Specifically,
use sf_buf_free() instead of sf_buf_mext() to consolidate all actions
that require the page queues lock in one critical section. While I'm
here remove unnecessary splvm() and splx() calls.
Diffstat (limited to 'sys/kern/uipc_cow.c')
-rw-r--r-- | sys/kern/uipc_cow.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/kern/uipc_cow.c b/sys/kern/uipc_cow.c index 8c00ffe..4a5ccd0 100644 --- a/sys/kern/uipc_cow.c +++ b/sys/kern/uipc_cow.c @@ -72,20 +72,24 @@ static void socow_iodone(void *addr, void *args); static void socow_iodone(void *addr, void *args) { - int s; struct sf_buf *sf; vm_page_t pp; sf = args; pp = sf_buf_page(sf); - s = splvm(); + sf_buf_free(sf); /* remove COW mapping */ vm_page_lock_queues(); vm_page_cowclear(pp); + vm_page_unwire(pp, 0); + /* + * Check for the object going away on us. This can + * happen since we don't hold a reference to it. + * If so, we're responsible for freeing the page. + */ + if (pp->wire_count == 0 && pp->object == NULL) + vm_page_free(pp); vm_page_unlock_queues(); - splx(s); - /* note that sf_buf_free() unwires the page for us*/ - sf_buf_mext(addr, args); socow_stats.iodone++; } |