]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use getsock() and fput() instead of fgetsock() and fputsock() in
authorRobert Watson <rwatson@FreeBSD.org>
Thu, 25 May 2006 15:10:13 +0000 (15:10 +0000)
committerRobert Watson <rwatson@FreeBSD.org>
Thu, 25 May 2006 15:10:13 +0000 (15:10 +0000)
commit20bdac8a4fb4dcff121f014ce879612a272020ab
tree40b298de8236a40b3c96893e7e6d8617031dbd7d
parent8a3dce3376e4112ce02fd1506b955cee47f49a55
Use getsock() and fput() instead of fgetsock() and fputsock() in
sendfile().  This causes sendfile() to use the file descriptor
reference to the socket instead of bumping the socket reference
count, which avoids an additional refcount operation, as well as a
potential expensive socket refcount drop, which can lead to
contention on the accept mutex.  This change also has the side
effect of further reducing the number of cases where an in-progress
I/O operation can occur on a socket after close, as using the file
descriptor refcount prevents the socket from closing while in use.

MFC after: 3 months
sys/kern/uipc_syscalls.c