svn commit: r211263 - in projects/ofed/head/sys: kern sys
Jeff Roberson
jeff at FreeBSD.org
Fri Aug 13 03:13:35 UTC 2010
Author: jeff
Date: Fri Aug 13 03:13:34 2010
New Revision: 211263
URL: http://svn.freebsd.org/changeset/base/211263
Log:
- Add a sx_init_flags similar to mtx_init flags as well as SX_SYSINIT_FLAGS
Sponsored by: Isilon Systems, iX Systems, and Panasas.
Modified:
projects/ofed/head/sys/kern/kern_sx.c
projects/ofed/head/sys/sys/sx.h
Modified: projects/ofed/head/sys/kern/kern_sx.c
==============================================================================
--- projects/ofed/head/sys/kern/kern_sx.c Fri Aug 13 03:12:42 2010 (r211262)
+++ projects/ofed/head/sys/kern/kern_sx.c Fri Aug 13 03:13:34 2010 (r211263)
@@ -195,7 +195,7 @@ sx_sysinit(void *arg)
{
struct sx_args *sargs = arg;
- sx_init(sargs->sa_sx, sargs->sa_desc);
+ sx_init_flags(sargs->sa_sx, sargs->sa_desc, sargs->sa_flags);
}
void
Modified: projects/ofed/head/sys/sys/sx.h
==============================================================================
--- projects/ofed/head/sys/sys/sx.h Fri Aug 13 03:12:42 2010 (r211262)
+++ projects/ofed/head/sys/sys/sx.h Fri Aug 13 03:13:34 2010 (r211263)
@@ -118,18 +118,22 @@ int sx_chain(struct thread *td, struct t
struct sx_args {
struct sx *sa_sx;
const char *sa_desc;
+ int sa_flags;
};
-#define SX_SYSINIT(name, sxa, desc) \
+#define SX_SYSINIT_FLAGS(name, sxa, desc, flags) \
static struct sx_args name##_args = { \
(sxa), \
- (desc) \
+ (desc), \
+ (flags) \
}; \
SYSINIT(name##_sx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \
sx_sysinit, &name##_args); \
SYSUNINIT(name##_sx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \
sx_destroy, (sxa))
+#define SX_SYSINIT(name, sxa, desc) SX_SYSINIT_FLAGS(name, sxa, desc, 0)
+
/*
* Full lock operations that are suitable to be inlined in non-debug kernels.
* If the lock can't be acquired or released trivially then the work is
More information about the svn-src-projects
mailing list