summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_witness.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-11-16 21:51:17 +0000
committerpjd <pjd@FreeBSD.org>2011-11-16 21:51:17 +0000
commita3e664d830a8cf18b39de7e24de3b6945e09d802 (patch)
tree0f843eda4349e58b83edfddade168cfeeb527616 /sys/kern/subr_witness.c
parent8f7796960e5324d9006d05ab644c421a3428a863 (diff)
downloadFreeBSD-src-a3e664d830a8cf18b39de7e24de3b6945e09d802.zip
FreeBSD-src-a3e664d830a8cf18b39de7e24de3b6945e09d802.tar.gz
Constify arguments for locking KPIs where possible.
This enables locking consumers to pass their own structures around as const and be able to assert locks embedded into those structures. Reviewed by: ed, kib, jhb
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r--sys/kern/subr_witness.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 130c7b3..bbf9a97 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -332,7 +332,7 @@ static void depart(struct witness *w);
static struct witness *enroll(const char *description,
struct lock_class *lock_class);
static struct lock_instance *find_instance(struct lock_list_entry *list,
- struct lock_object *lock);
+ const struct lock_object *lock);
static int isitmychild(struct witness *parent, struct witness *child);
static int isitmydescendant(struct witness *parent, struct witness *child);
static void itismychild(struct witness *parent, struct witness *child);
@@ -2063,7 +2063,7 @@ witness_lock_list_free(struct lock_list_entry *lle)
}
static struct lock_instance *
-find_instance(struct lock_list_entry *list, struct lock_object *lock)
+find_instance(struct lock_list_entry *list, const struct lock_object *lock)
{
struct lock_list_entry *lle;
struct lock_instance *instance;
@@ -2210,7 +2210,8 @@ witness_restore(struct lock_object *lock, const char *file, int line)
}
void
-witness_assert(struct lock_object *lock, int flags, const char *file, int line)
+witness_assert(const struct lock_object *lock, int flags, const char *file,
+ int line)
{
#ifdef INVARIANT_SUPPORT
struct lock_instance *instance;
OpenPOWER on IntegriCloud