Mercurial > libjeffpc
changeset 767:597466aacd4c
synch: convert dependency tracking code to use info structs
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Thu, 25 Jul 2019 14:06:23 -0400 |
parents | 041bab629917 |
children | 39f93d3a8108 |
files | synch.c |
diffstat | 1 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/synch.c Thu Jul 25 13:40:00 2019 -0400 +++ b/synch.c Thu Jul 25 14:06:23 2019 -0400 @@ -386,7 +386,7 @@ return 1; } -static bool __find_path(struct lock *lock, +static bool __find_path(struct lock_info *info, const struct lock_context *where, struct lock_class *from, struct lock_class *to) @@ -394,13 +394,13 @@ size_t i; if (from == to) { - error_lock_circular(&lock->info, where); + error_lock_circular(info, where); print_lock_class(from); return true; } for (i = 0; i < from->ndeps; i++) { - if (__find_path(lock, where, from->deps[i], to)) { + if (__find_path(info, where, from->deps[i], to)) { print_lock_class(from); return true; } @@ -409,19 +409,19 @@ return false; } -static void find_path(struct lock *lock, +static void find_path(struct lock_info *info, const struct lock_context *where, struct lock_class *from, struct lock_class *to, struct held_lock *held) { - if (__find_path(lock, where, from, to)) { + if (__find_path(info, where, from, to)) { cmn_err(CE_CRIT, "lockdep: currently held locks:"); print_held_locks(held); } } -static bool check_circular_deps(struct lock *lock, +static bool check_circular_deps(struct lock_info *info, const struct lock_context *where) { struct held_lock *last = last_acquired_lock(); @@ -432,11 +432,11 @@ LOCK_DEP_GRAPH(); - ret = add_dependency(lock->info.lc, last->info->lc); + ret = add_dependency(info->lc, last->info->lc); if (ret < 0) - error_alloc(&lock->info, where, "lock dependency count limit reached"); + error_alloc(info, where, "lock dependency count limit reached"); else if (ret > 0) - find_path(lock, where, last->info->lc, lock->info.lc, last); + find_path(info, where, last->info->lc, info->lc, last); UNLOCK_DEP_GRAPH(); @@ -558,7 +558,7 @@ } /* check for circular dependencies */ - if (check_circular_deps(l, where)) + if (check_circular_deps(&l->info, where)) return; held = held_stack_alloc();