int lf_advlock __P((struct lockf **,
off_t, caddr_t, int, struct flock *, int));
to
int lf_advlock __P((struct vop_advlock_args *, struct lockf **, off_t));
This matches common usage and is also compatible with similar change
in FreeBSD (though they use u_quad_t as last arg).
- document a data structure invariant in lockf.h
- add KASSERT() to check the invariant.
- be more consistent about dequeuing ourselves from the blocked list
after a tsleep().
- Fix two places where the invariant is violated.
- correct a few comments here and there
- If we're still following a lock dependancy chain after maxlockdepth
processes and haven't gotten back to the start, assume that we're in a
cycle anyway and return EDEADLK.
Fix is a superset of an existing fix in FreeBSD, but independantly
derived.
Fixes kern/3860.