Remove some unnecessary actions by the zero-copy setup and teardown code.
Remove an incorrect comment. (Incrementing an object's reference count does not prevent a process from exiting. The real concern here is that the physical page must not be deleted until transmission is complete. That is already handled by the VM system and sf_buf_free().) Tested by: ken
This commit is contained in:
parent
e70feef239
commit
3a50d97c5c
@ -87,19 +87,15 @@ socow_iodone(void *addr, void *args)
|
|||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
struct sf_buf *sf;
|
struct sf_buf *sf;
|
||||||
|
|
||||||
vm_offset_t paddr;
|
|
||||||
vm_page_t pp;
|
vm_page_t pp;
|
||||||
|
|
||||||
sf = dtosf(addr);
|
sf = dtosf(addr);
|
||||||
paddr = vtophys((vm_offset_t)addr);
|
pp = sf->m;
|
||||||
pp = PHYS_TO_VM_PAGE(paddr);
|
|
||||||
s = splvm();
|
s = splvm();
|
||||||
/* remove COW mapping */
|
/* remove COW mapping */
|
||||||
vm_page_lock_queues();
|
vm_page_lock_queues();
|
||||||
vm_page_cowclear(pp);
|
vm_page_cowclear(pp);
|
||||||
vm_page_unlock_queues();
|
vm_page_unlock_queues();
|
||||||
vm_object_deallocate(pp->object);
|
|
||||||
splx(s);
|
splx(s);
|
||||||
/* note that sf_buf_free() unwires the page for us*/
|
/* note that sf_buf_free() unwires the page for us*/
|
||||||
sf_buf_free(addr, NULL);
|
sf_buf_free(addr, NULL);
|
||||||
@ -152,11 +148,6 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
|||||||
vm_page_wire(pp);
|
vm_page_wire(pp);
|
||||||
vm_page_unlock_queues();
|
vm_page_unlock_queues();
|
||||||
|
|
||||||
/*
|
|
||||||
* prevent the process from exiting on us.
|
|
||||||
*/
|
|
||||||
vm_object_reference(pp->object);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* attach to mbuf
|
* attach to mbuf
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user