path: root/sys/sys/lock.h
diff options
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2011-11-16 21:51:17 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2011-11-16 21:51:17 +0000
commitd576deedb549253edd7dab4f594a77d52a98dc5f (patch)
tree0f843eda4349e58b83edfddade168cfeeb527616 /sys/sys/lock.h
parenta9e3362a07d62fa626b1b4104fc70aee742e5421 (diff)
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
Notes: svn path=/head/; revision=227588
Diffstat (limited to 'sys/sys/lock.h')
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 7ad9c58c15d5..303717fe6eec 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -58,10 +58,10 @@ struct thread;
struct lock_class {
const char *lc_name;
u_int lc_flags;
- void (*lc_assert)(struct lock_object *lock, int what);
- void (*lc_ddb_show)(struct lock_object *lock);
+ void (*lc_assert)(const struct lock_object *lock, int what);
+ void (*lc_ddb_show)(const struct lock_object *lock);
void (*lc_lock)(struct lock_object *lock, int how);
- int (*lc_owner)(struct lock_object *lock, struct thread **owner);
+ int (*lc_owner)(const struct lock_object *lock, struct thread **owner);
int (*lc_unlock)(struct lock_object *lock);
@@ -215,7 +215,7 @@ void witness_restore(struct lock_object *, const char *, int);
int witness_list_locks(struct lock_list_entry **,
int (*)(const char *, ...));
int witness_warn(int, struct lock_object *, const char *, ...);
-void witness_assert(struct lock_object *, int, const char *, int);
+void witness_assert(const struct lock_object *, int, const char *, int);
void witness_display_spinlock(struct lock_object *, struct thread *,
int (*)(const char *, ...));
int witness_line(struct lock_object *);