freebsd-skq/sys/nfsclient
zec d78a1b1a82 Change the curvnet variable from a global const struct vnet *,
previously always pointing to the default vnet context, to a
dynamically changing thread-local one.  The currvnet context
should be set on entry to networking code via CURVNET_SET() macros,
and reverted to previous state via CURVNET_RESTORE().  Recursions
on curvnet are permitted, though strongly discuouraged.

This change should have no functional impact on nooptions VIMAGE
kernel builds, where CURVNET_* macros expand to whitespace.

The curthread->td_vnet (aka curvnet) variable's purpose is to be an
indicator of the vnet context in which the current network-related
operation takes place, in case we cannot deduce the current vnet
context from any other source, such as by looking at mbuf's
m->m_pkthdr.rcvif->if_vnet, sockets's so->so_vnet etc.  Moreover, so
far curvnet has turned out to be an invaluable consistency checking
aid: it helps to catch cases when sockets, ifnets or any other
vnet-aware structures may have leaked from one vnet to another.

The exact placement of the CURVNET_SET() / CURVNET_RESTORE() macros
was a result of an empirical iterative process, whith an aim to
reduce recursions on CURVNET_SET() to a minimum, while still reducing
the scope of CURVNET_SET() to networking only operations - the
alternative would be calling CURVNET_SET() on each system call entry.
In general, curvnet has to be set in three typicall cases: when
processing socket-related requests from userspace or from within the
kernel; when processing inbound traffic flowing from device drivers
to upper layers of the networking stack, and when executing
timer-driven networking functions.

This change also introduces a DDB subcommand to show the list of all
vnet instances.

Approved by:	julian (mentor)
2009-05-05 10:56:12 +00:00
..
bootp_subr.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
krpc_subr.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
krpc.h
nfs_bio.c Add DTrace probes to the NFS access and attribute caches. Access cache 2009-03-24 17:14:34 +00:00
nfs_diskless.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
nfs_kdtrace.c Fix typo in comment. 2009-05-04 02:06:39 +00:00
nfs_kdtrace.h Fix two bugs in DTrace tracing of accesscache and attrcache load events: 2009-03-24 23:16:48 +00:00
nfs_krpc.c Remove redundant NFSMNT_NFSV3 check in DTrace hooks for NFS RPC. 2009-05-04 02:19:52 +00:00
nfs_lock.c Fix a number of style issues in the MALLOC / FREE commit. I've tried to 2008-10-23 20:26:15 +00:00
nfs_lock.h
nfs_nfsiod.c Document a few sysctls in the NFS client and server code. 2008-11-02 17:00:23 +00:00
nfs_node.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
nfs_socket.c Remove trailing spaces 2009-04-13 19:54:33 +00:00
nfs_subs.c When a stale file handle is encountered, purge all cached information about 2009-04-06 21:11:08 +00:00
nfs_vfsops.c Fix parsing of acregmin, acregmax, acdirmin and acdirmax NFS mount options 2009-01-28 07:46:35 +00:00
nfs_vnops.c Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
nfs.h When a stale file handle is encountered, purge all cached information about 2009-04-06 21:11:08 +00:00
nfsargs.h
nfsdiskless.h consolidate parsing of nfs root mount options in one place 2006-12-06 02:15:25 +00:00
nfsm_subs.h Consolidate the code to generate a new XID for a NFS request into a 2008-02-13 00:04:58 +00:00
nfsmount.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
nfsnode.h Expand the per-node access cache to cache permissions for multiple users. 2009-03-20 21:12:38 +00:00
nfsstats.h
nlminfo.h - Fix leak of struct nlminfo on process exit. 2005-10-26 07:18:37 +00:00