Mark fgetsock() and fputsock() as depcrecated: callers should rely on

the file descriptor reference, rather than paying additional lock
operations to acquire a socket reference from the file descriptor.
This will also help to ensure that file descriptor based socket
requests are not delivered to a socket after close.  Most consumers
have already been converted to this model.

MFC after:	3 months
This commit is contained in:
Robert Watson 2006-04-01 11:09:54 +00:00
parent 449e2f5c77
commit 197b35d717

View File

@ -2090,6 +2090,10 @@ fgetvp_write(struct thread *td, int fd, struct vnode **vpp)
*
* We bump the ref count on the returned socket. XXX Also obtain the SX
* lock in the future.
*
* XXXRW: fgetsock() and fputsock() are deprecated, as consumers should rely
* on their file descriptor reference to prevent the socket from being
* freed during use.
*/
int
fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp)
@ -2119,8 +2123,10 @@ fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp)
}
/*
* Drop the reference count on the socket and XXX release the SX lock in
* the future. The last reference closes the socket.
* Drop the reference count on the socket and XXX release the SX lock in the
* future. The last reference closes the socket.
*
* XXXRW: fputsock() is deprecated, see comment for fgetsock().
*/
void
fputsock(struct socket *so)