From: François Tigeot Date: Fri, 3 Aug 2012 09:23:11 +0000 (+0200) Subject: kernel: add a flags argument to LOCK_SYSINIT X-Git-Tag: v3.2.0~469 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/124eeca9117b2e1d5ebd9ef692b7066092a65a43 kernel: add a flags argument to LOCK_SYSINIT We may not want to use LK_CAN_RECURSE in all situations --- diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 0b700037f4..9453c0c02a 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -710,5 +710,5 @@ lockmgr_printinfo(struct lock *lkp) void lock_sysinit(struct lock_args *arg) { - lockinit(arg->la_lock, arg->la_desc, 0, LK_CANRECURSE); + lockinit(arg->la_lock, arg->la_desc, 0, arg->la_flags); } diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 8e4174edc4..913441138a 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -191,6 +191,7 @@ struct proc; struct lock_args { struct lock *la_lock; const char *la_desc; + int la_flags; }; void lockinit (struct lock *, const char *wmesg, int timo, int flags); @@ -216,10 +217,11 @@ int lockowned (struct lock *); int lockcount (struct lock *); int lockcountnb (struct lock *); -#define LOCK_SYSINIT(name, lock, desc) \ +#define LOCK_SYSINIT(name, lock, desc, flags) \ static struct lock_args name##_args = { \ (lock), \ - (desc) \ + (desc), \ + (flags) \ }; \ SYSINIT(name##_lock_sysinit, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, \ lock_sysinit, &name##_args); \