Rewrite the POSIX locking code. It was becomming impossible to track
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 8 May 2006 00:38:59 +0000 (00:38 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 8 May 2006 00:38:59 +0000 (00:38 +0000)
commita319046653ca23fd289fab5b7a2900803bee62fd
tree1d7487c4a773361df7f855ff28d3469a9d8e39a3
parent58149fc5531139a27be870ff28f06b68c3d18fee
Rewrite the POSIX locking code.  It was becomming impossible to track
down bugs in the previous version due to code complexity (in particular
a large number of undocumented short cuts and gotos), and general lack of
documentation.

The new code uses a more straightforward method for managing the lock list
and is far better documented.  Basically the conflict space is ranged,
if no conflict occurs the new lock is inserted, overlaps are clipped or
removed, and finally a quick optimization to check for and collapse
compatible adjacent locks.
sys/kern/kern_lockf.c
sys/sys/lockf.h