freebsd-src/sys
John Baldwin f82c6950be - Split the itismychild() function into two functions: insertchild()
adds a witness to the child list of a parent witness.  rebalancetree()
  runs through the entire tree removing direct descendants of witnesses
  who already have said child witness as an indirect descendant through
  another direct descendant.  itismychild() now calls insertchild()
  followed by rebalancetree() and no longer needs the evil hack of
  having static recursed variable.
- Add a function reparentchildren() that adds all the direct descendants
  of one witness as direct descendants of another witness.
- Change the return value of itismychild() and similar functions so that
  they return 0 in the case of failure due to lack of resources instead
  of 1.  This makes the return value more intuitive.
- Check the return value of itismychild() when defining the static lock
  order in witness_initialize().
- Don't try to setup a lock instance in witness_lock() if itismychild()
  fails.  Witness is hosed anyways so no need to do any more witness
  related activity at that point.  It also makes the code flow easier to
  understand.
- Add a new depart() function as the opposite of enroll().  When the
  reference count of a witness drops to 0 in witness_destroy(), this
  function is called on that witness.  First, it runs through the
  lock order tree using reparentchildren() to reparent direct descendants
  of the departing witness to each of the witness' parents in the tree.
  Next, it releases it's own child list and other associated resources.
  Finally it calls rebalanacetree() to rebalance the lock order tree.
- Sort function prototypes into something closer to alphabetical order.

As a result of these changes, there should no longer be 'dead' witnesses
in the order tree, and repeatedly loading and unloading a module should no
longer exhaust witness of its internal resources.

Inspired by:	gallatin
2003-03-11 22:07:35 +00:00
..
alpha Centralize the devstat handling for all GEOM disk device drivers 2003-03-08 08:01:31 +00:00
amd64 Use bus_space_handle_t to represent host port and virtual addresses; 2003-03-11 19:43:38 +00:00
arm MB_LEN_MAX is not MD, move it to the MI limits.h. 2002-12-22 06:38:45 +00:00
boot FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch 2003-03-11 12:09:25 +00:00
cam Quirk for SanDisk ImageMate II compact flash reader 2003-03-11 02:07:17 +00:00
coda Set f_fstypename in coda_nb_statfs(). 2003-03-07 09:18:15 +00:00
compat Clean up whitespace and remove register keyword. 2003-03-03 09:17:12 +00:00
conf FIPS 140-2 rng data tester for h/w crypto devices. This driver periodically 2003-03-11 19:26:16 +00:00
contrib Centralize the devstat handling for all GEOM disk device drivers 2003-03-08 08:01:31 +00:00
crypto Remove some unnecessary casts. 2003-01-25 22:41:22 +00:00
ddb Change the process flags P_KSES to be P_THREADED. 2003-02-27 02:05:19 +00:00
dev correct output byte count statistic collection 2003-03-11 18:43:24 +00:00
fs Set f_fstypename in coda_nb_statfs(). 2003-03-07 09:18:15 +00:00
geom If we run out of consumers while orphaning them, and the provider's geom 2003-03-10 23:41:41 +00:00
gnu - Add a new 'flags' parameter to getblk(). 2003-03-04 00:04:44 +00:00
i4b Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
i386 Use bus_space_handle_t to represent host port and virtual addresses; 2003-03-11 19:43:38 +00:00
ia64 Fix two rounds of breakages and cleanup. Remove the sccdebug sysctl 2003-03-10 01:58:31 +00:00
isa Allocate the devstat structure with devstat_new_entry(). 2003-03-08 21:32:59 +00:00
isofs/cd9660 Finish cleanup of vprint() which was begun with changing v_tag to a string. 2003-03-03 19:15:40 +00:00
kern - Split the itismychild() function into two functions: insertchild() 2003-03-11 22:07:35 +00:00
libkern Further GC of M_STRING, missed previously. 2003-02-26 01:00:29 +00:00
modules FIPS 140-2 rng data tester for h/w crypto devices. This driver periodically 2003-03-11 19:26:16 +00:00
net Note that MAJOR_AUTO is now the default if d_maj is not initialized. This 2003-03-09 11:03:45 +00:00
netatalk Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
netatm Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
netgraph Include correct opt_* headers for supported address families. Dike out 2003-03-08 16:25:27 +00:00
netinet Remove check for t_state == TCPS_TIME_WAIT and introduce the tw structure. 2003-03-08 22:07:52 +00:00
netinet6 Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
netipsec Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
netipx Remove unimplemented IP-in-IPX encapsulation support (options IPTUNNEL). 2003-03-08 06:58:22 +00:00
netkey Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
netnatm Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
netncp Note that MAJOR_AUTO is now the default if d_maj is not initialized. This 2003-03-09 11:03:45 +00:00
netsmb Remove fragments of support for the FreeBSD 3.x and 4.x branches. 2003-03-06 10:38:18 +00:00
nfs Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
nfsclient - Add a new 'flags' parameter to getblk(). 2003-03-04 00:04:44 +00:00
nfsserver More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
opencrypto Gigacommit to improve device-driver source compatibility between 2003-03-03 12:15:54 +00:00
pc98 MFi386: revision 1.1079 2003-03-09 10:20:16 +00:00
pccard Gigacommit to improve device-driver source compatibility between 2003-03-03 12:15:54 +00:00
pci Fix bug introduced in 1.130. For the < MHLEN case, we should 2003-03-04 20:19:26 +00:00
posix4 Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
powerpc Replace calls to WITNESS_SLEEP() and witness_list() with equivalent calls 2003-03-04 21:03:05 +00:00
rpc
security Instrument sysarch() MD privileged I/O access interfaces with a MAC 2003-03-06 04:47:47 +00:00
sparc64 Replace calls to WITNESS_SLEEP() and witness_list() with equivalent calls 2003-03-04 21:03:05 +00:00
sys Rework the eventhandler locking for hopefully the last time. The scheme 2003-03-11 20:17:00 +00:00
tools Remove miidevs.h and generate it from miidevs at compile time. 2003-01-19 02:59:34 +00:00
ufs Use the appropriate size when zeroing out the unused portion 2003-03-07 23:49:16 +00:00
vm Zero copy send and receive fixes: 2003-03-08 06:58:18 +00:00
Makefile