From owner-cvs-all@FreeBSD.ORG Fri Jul 21 17:13:19 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9C8216A4DE; Fri, 21 Jul 2006 17:13:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F405B43E97; Fri, 21 Jul 2006 17:11:15 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6LHBFJA087529; Fri, 21 Jul 2006 17:11:15 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6LHBFpN087528; Fri, 21 Jul 2006 17:11:15 GMT (envelope-from rwatson) Message-Id: <200607211711.k6LHBFpN087528@repoman.freebsd.org> From: Robert Watson Date: Fri, 21 Jul 2006 17:11:15 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern uipc_socket.c uipc_usrreq.c src/sys/net raw_usrreq.c rtsock.c src/sys/netatalk ddp_usrreq.c src/sys/netatm atm_aal5.c atm_usrreq.c src/sys/netgraph ng_socket.c src/sys/netgraph/bluetooth/include ng_btsocket_hci_raw.h ng_btsocket_l2cap.h ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jul 2006 17:13:19 -0000 rwatson 2006-07-21 17:11:15 UTC FreeBSD src repository Modified files: sys/kern uipc_socket.c uipc_usrreq.c sys/net raw_usrreq.c rtsock.c sys/netatalk ddp_usrreq.c sys/netatm atm_aal5.c atm_usrreq.c sys/netgraph ng_socket.c sys/netgraph/bluetooth/include ng_btsocket_hci_raw.h ng_btsocket_l2cap.h ng_btsocket_rfcomm.h sys/netgraph/bluetooth/socket ng_btsocket.c ng_btsocket_hci_raw.c ng_btsocket_l2cap.c ng_btsocket_l2cap_raw.c ng_btsocket_rfcomm.c sys/netinet raw_ip.c tcp_subr.c tcp_usrreq.c udp_usrreq.c sys/netinet6 raw_ip6.c udp6_usrreq.c sys/netipsec keysock.c sys/netipx ipx_usrreq.c spx_usrreq.c sys/netkey keysock.c sys/netnatm natm.c Log: Change semantics of socket close and detach. Add a new protocol switch function, pru_close, to notify protocols that the file descriptor or other consumer of a socket is closing the socket. pru_abort is now a notification of close also, and no longer detaches. pru_detach is no longer used to notify of close, and will be called during socket tear-down by sofree() when all references to a socket evaporate after an earlier call to abort or close the socket. This means detach is now an unconditional teardown of a socket, whereas previously sockets could persist after detach of the protocol retained a reference. This faciliates sharing mutexes between layers of the network stack as the mutex is required during the checking and removal of references at the head of sofree(). With this change, pru_detach can now assume that the mutex will no longer be required by the socket layer after completion, whereas before this was not necessarily true. Reviewed by: gnn Revision Changes Path 1.273 +5 -6 src/sys/kern/uipc_socket.c 1.172 +17 -2 src/sys/kern/uipc_usrreq.c 1.43 +11 -1 src/sys/net/raw_usrreq.c 1.137 +8 -0 src/sys/net/rtsock.c 1.51 +20 -3 src/sys/netatalk/ddp_usrreq.c 1.25 +14 -1 src/sys/netatm/atm_aal5.c 1.27 +1 -0 src/sys/netatm/atm_usrreq.c 1.7 +1 -0 src/sys/netgraph/bluetooth/include/ng_btsocket_hci_raw.h 1.8 +2 -0 src/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h 1.8 +1 -0 src/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h 1.13 +4 -0 src/sys/netgraph/bluetooth/socket/ng_btsocket.c 1.22 +5 -1 src/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c 1.20 +8 -1 src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c 1.19 +9 -1 src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c 1.21 +9 -2 src/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c 1.77 +4 -0 src/sys/netgraph/ng_socket.c 1.164 +34 -15 src/sys/netinet/raw_ip.c 1.252 +12 -37 src/sys/netinet/tcp_subr.c 1.140 +92 -55 src/sys/netinet/tcp_usrreq.c 1.192 +28 -4 src/sys/netinet/udp_usrreq.c 1.64 +21 -3 src/sys/netinet6/raw_ip6.c 1.67 +46 -4 src/sys/netinet6/udp6_usrreq.c 1.16 +12 -0 src/sys/netipsec/keysock.c 1.57 +14 -7 src/sys/netipx/ipx_usrreq.c 1.85 +29 -8 src/sys/netipx/spx_usrreq.c 1.36 +12 -0 src/sys/netkey/keysock.c 1.48 +7 -1 src/sys/netnatm/natm.c