Add a couple of asserts to make some mistakes very obvious, such as
passing in an invalid 'locktype' or unlocking more times than locking.
Change-Id: Ie6e707ea515d5a6527dedc8875f0a4694b7b93c9
Reviewed-on: http://gerrit.openafs.org/1357
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
{
int code;
+ assert(locktype == READ_LOCK || locktype == WRITE_LOCK);
+
AFS_LF_LOCK(lf);
if (lf->fd == INVALID_FD) {
{
AFS_LF_LOCK(lf);
+ assert(lf->fd != INVALID_FD);
+
if (--lf->refcount < 1) {
_VCloseFd(lf->fd);
lf->fd = INVALID_FD;