From 55a2ee335829b8229c8b36f5985cac052a84e2a8 Mon Sep 17 00:00:00 2001 From: Markus Pfeiffer Date: Tue, 24 Apr 2012 13:18:41 +0000 Subject: [PATCH] kernel: Change wmesg type for lockinit, lockreinit * change type of parameter wmesg to const char * for lockinit and lockreinit. * change type of member wmesg of struct lock to const char * * adapt manpage lock(9) --- share/man/man9/lock.9 | 2 +- sys/kern/kern_lock.c | 4 ++-- sys/sys/lock.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/share/man/man9/lock.9 b/share/man/man9/lock.9 index 1e9806318b..823e074cab 100644 --- a/share/man/man9/lock.9 +++ b/share/man/man9/lock.9 @@ -40,7 +40,7 @@ .In sys/types.h .In sys/lock.h .Ft void -.Fn lockinit "struct lock *lkp" "char *wmesg" "int timo" "int flags" +.Fn lockinit "struct lock *lkp" "const char *wmesg" "int timo" "int flags" .Ft void .Fn lockuninit "struct lock *lkp" .Ft int diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 100a4d0368..290b9227fb 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -581,7 +581,7 @@ lockmgr_clrexclusive_interlocked(struct lock *lkp) * Initialize a lock; required before use. */ void -lockinit(struct lock *lkp, char *wmesg, int timo, int flags) +lockinit(struct lock *lkp, const char *wmesg, int timo, int flags) { spin_init(&lkp->lk_spinlock); lkp->lk_flags = (flags & LK_EXTFLG_MASK); @@ -599,7 +599,7 @@ lockinit(struct lock *lkp, char *wmesg, int timo, int flags) * must already hold the interlock. */ void -lockreinit(struct lock *lkp, char *wmesg, int timo, int flags) +lockreinit(struct lock *lkp, const char *wmesg, int timo, int flags) { spin_lock(&lkp->lk_spinlock); lkp->lk_flags = (lkp->lk_flags & ~LK_EXTFLG_MASK) | diff --git a/sys/sys/lock.h b/sys/sys/lock.h index fa50cf2585..f90f49b1c0 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -70,7 +70,7 @@ struct lock { int lk_waitcount; /* # of processes sleeping for lock */ short lk_exclusivecount; /* # of recursive exclusive locks */ short lk_unused1; - char *lk_wmesg; /* resource sleeping (for tsleep) */ + const char *lk_wmesg; /* resource sleeping (for tsleep) */ int lk_timo; /* maximum sleep time (for tsleep) */ struct thread *lk_lockholder; /* thread of excl lock holder */ #ifdef DEBUG_LOCKS @@ -188,8 +188,8 @@ struct lock { void dumplockinfo(struct lock *lkp); struct proc; -void lockinit (struct lock *, char *wmesg, int timo, int flags); -void lockreinit (struct lock *, char *wmesg, int timo, int flags); +void lockinit (struct lock *, const char *wmesg, int timo, int flags); +void lockreinit (struct lock *, const char *wmesg, int timo, int flags); void lockuninit(struct lock *); #ifdef DEBUG_LOCKS int debuglockmgr (struct lock *, u_int flags, -- 2.41.0