diff options
author | pjd <pjd@FreeBSD.org> | 2011-11-16 21:51:17 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-11-16 21:51:17 +0000 |
commit | a3e664d830a8cf18b39de7e24de3b6945e09d802 (patch) | |
tree | 0f843eda4349e58b83edfddade168cfeeb527616 /sys/kern/kern_rmlock.c | |
parent | 8f7796960e5324d9006d05ab644c421a3428a863 (diff) | |
download | FreeBSD-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/kern_rmlock.c')
-rw-r--r-- | sys/kern/kern_rmlock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 1c7337d..181825a 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -69,10 +69,10 @@ static __inline void compiler_memory_barrier(void) { __asm __volatile("":::"memory"); } -static void assert_rm(struct lock_object *lock, int what); +static void assert_rm(const struct lock_object *lock, int what); static void lock_rm(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS -static int owner_rm(struct lock_object *lock, struct thread **owner); +static int owner_rm(const struct lock_object *lock, struct thread **owner); #endif static int unlock_rm(struct lock_object *lock); @@ -93,7 +93,7 @@ struct lock_class lock_class_rm = { }; static void -assert_rm(struct lock_object *lock, int what) +assert_rm(const struct lock_object *lock, int what) { panic("assert_rm called"); @@ -115,7 +115,7 @@ unlock_rm(struct lock_object *lock) #ifdef KDTRACE_HOOKS static int -owner_rm(struct lock_object *lock, struct thread **owner) +owner_rm(const struct lock_object *lock, struct thread **owner) { panic("owner_rm called"); @@ -227,7 +227,7 @@ rm_destroy(struct rmlock *rm) } int -rm_wowned(struct rmlock *rm) +rm_wowned(const struct rmlock *rm) { if (rm->lock_object.lo_flags & RM_SLEEPABLE) |