diff options
author | alc <alc@FreeBSD.org> | 2010-05-06 15:52:08 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2010-05-06 15:52:08 +0000 |
commit | a4eb017f2a2b295af55831f9ab117c78198cdef2 (patch) | |
tree | b7b9cea6b5e782fe9c86b9b3479ad41fdff2f8e9 /sys/kern/uipc_syscalls.c | |
parent | 9ba32758003af67dc6e2b29886ef3a9bdc3ce387 (diff) | |
download | FreeBSD-src-a4eb017f2a2b295af55831f9ab117c78198cdef2.zip FreeBSD-src-a4eb017f2a2b295af55831f9ab117c78198cdef2.tar.gz |
Eliminate a small bit of unneeded code from kern_sendfile(): While
kern_sendfile() is running, the file's vm object can't be destroyed
because kern_sendfile() increments the vm object's reference count. (Once
kern_sendfile() decrements the reference count and returns, the vm object
can, however, be destroyed. So, sf_buf_mext() must handle the case where
the vm object is destroyed.)
Reviewed by: kib
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index a137875..dd504f8 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -2139,14 +2139,9 @@ retry_space: (mnw ? SFB_NOWAIT : SFB_CATCH))) == NULL) { mbstat.sf_allocfail++; vm_page_lock(pg); - vm_page_lock_queues(); vm_page_unwire(pg, 0); - /* - * XXX: Not same check as above!? - */ - if (pg->wire_count == 0 && pg->object == NULL) - vm_page_free(pg); - vm_page_unlock_queues(); + KASSERT(pg->object != NULL, + ("kern_sendfile: object disappeared")); vm_page_unlock(pg); error = (mnw ? EAGAIN : EINTR); break; |