summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_default.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-03-11 22:07:35 +0000
committerjhb <jhb@FreeBSD.org>2003-03-11 22:07:35 +0000
commit736396fc05cd36377f15dab4007d33d067689c92 (patch)
tree9986645c15a421fc019221d298c1a68826f7da8d /sys/kern/vfs_default.c
parent5aeddebb51369a44e66e68ccc4d8e20ea17bca2b (diff)
downloadFreeBSD-src-736396fc05cd36377f15dab4007d33d067689c92.zip
FreeBSD-src-736396fc05cd36377f15dab4007d33d067689c92.tar.gz
- 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
Diffstat (limited to 'sys/kern/vfs_default.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud