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
7f03a257ac
commit
167b972088
@ -87,19 +87,15 @@ socow_iodone(void *addr, void *args)
|
||||
{
|
||||
int s;
|
||||
struct sf_buf *sf;
|
||||
|
||||
vm_offset_t paddr;
|
||||
vm_page_t pp;
|
||||
|
||||
sf = dtosf(addr);
|
||||
paddr = vtophys((vm_offset_t)addr);
|
||||
pp = PHYS_TO_VM_PAGE(paddr);
|
||||
pp = sf->m;
|
||||
s = splvm();
|
||||
/* remove COW mapping */
|
||||
vm_page_lock_queues();
|
||||
vm_page_cowclear(pp);
|
||||
vm_page_unlock_queues();
|
||||
vm_object_deallocate(pp->object);
|
||||
splx(s);
|
||||
/* note that sf_buf_free() unwires the page for us*/
|
||||
sf_buf_free(addr, NULL);
|
||||
@ -152,11 +148,6 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
||||
vm_page_wire(pp);
|
||||
vm_page_unlock_queues();
|
||||
|
||||
/*
|
||||
* prevent the process from exiting on us.
|
||||
*/
|
||||
vm_object_reference(pp->object);
|
||||
|
||||
/*
|
||||
* attach to mbuf
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user