Record the file, line, and pid of the last successful shared lock holder. This

is useful as a last effort in debugging file system deadlocks.  This is enabled
via 'options DEBUG_LOCKS'
This commit is contained in:
Jeff Roberson 2002-05-30 05:55:22 +00:00
parent 12b32eafa8
commit 7181624aaa
2 changed files with 11 additions and 0 deletions

View File

@ -259,6 +259,12 @@ debuglockmgr(lkp, flags, interlkp, td, name, file, line)
if (error)
break;
sharelock(lkp, 1);
#if defined(DEBUG_LOCKS)
lkp->lk_slockholder = pid;
lkp->lk_sfilename = file;
lkp->lk_slineno = line;
lkp->lk_slockername = name;
#endif
break;
}
/*

View File

@ -62,6 +62,11 @@ struct lock {
const char *lk_filename;
const char *lk_lockername;
int lk_lineno;
pid_t lk_slockholder;
const char *lk_sfilename;
const char *lk_slockername;
int lk_slineno;
#endif
};
/*