Date: Sun, 21 Oct 2012 13:42:39 +0000 (UTC) From: Andre Oppermann <andre@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r241815 - in user/andre/tcp_workqueue/sys: kern net netatalk netinet netinet6 vm Message-ID: <201210211342.q9LDgdoj087084@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andre Date: Sun Oct 21 13:42:38 2012 New Revision: 241815 URL: http://svn.freebsd.org/changeset/base/241815 Log: First pass at making global mutexes use MTX_DEF_SYSINIT(). Modified: user/andre/tcp_workqueue/sys/kern/kern_et.c user/andre/tcp_workqueue/sys/kern/kern_event.c user/andre/tcp_workqueue/sys/kern/kern_fail.c user/andre/tcp_workqueue/sys/kern/kern_hhook.c user/andre/tcp_workqueue/sys/kern/kern_intr.c user/andre/tcp_workqueue/sys/kern/kern_pmc.c user/andre/tcp_workqueue/sys/kern/kern_racct.c user/andre/tcp_workqueue/sys/kern/kern_rmlock.c user/andre/tcp_workqueue/sys/kern/kern_thread.c user/andre/tcp_workqueue/sys/kern/kern_uuid.c user/andre/tcp_workqueue/sys/kern/subr_autoconf.c user/andre/tcp_workqueue/sys/kern/subr_devstat.c user/andre/tcp_workqueue/sys/kern/subr_firmware.c user/andre/tcp_workqueue/sys/kern/subr_log.c user/andre/tcp_workqueue/sys/kern/subr_sleepqueue.c user/andre/tcp_workqueue/sys/kern/subr_unit.c user/andre/tcp_workqueue/sys/kern/uipc_accf.c user/andre/tcp_workqueue/sys/kern/uipc_domain.c user/andre/tcp_workqueue/sys/kern/uipc_socket.c user/andre/tcp_workqueue/sys/kern/vfs_mount.c user/andre/tcp_workqueue/sys/net/pfil.c user/andre/tcp_workqueue/sys/net/raw_cb.c user/andre/tcp_workqueue/sys/net/raw_usrreq.c user/andre/tcp_workqueue/sys/net/rtsock.c user/andre/tcp_workqueue/sys/netatalk/aarp.c user/andre/tcp_workqueue/sys/netinet/in_mcast.c user/andre/tcp_workqueue/sys/netinet/ip_encap.c user/andre/tcp_workqueue/sys/netinet/ip_id.c user/andre/tcp_workqueue/sys/netinet/tcp_debug.c user/andre/tcp_workqueue/sys/netinet6/in6_mcast.c user/andre/tcp_workqueue/sys/vm/vm_glue.c user/andre/tcp_workqueue/sys/vm/vm_pageout.c Modified: user/andre/tcp_workqueue/sys/kern/kern_et.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_et.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_et.c Sun Oct 21 13:42:38 2012 (r241815) @@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$"); SLIST_HEAD(et_eventtimers_list, eventtimer); static struct et_eventtimers_list eventtimers = SLIST_HEAD_INITIALIZER(et_eventtimers); -struct mtx et_eventtimers_mtx; -MTX_SYSINIT(et_eventtimers_init, &et_eventtimers_mtx, "et_mtx", MTX_DEF); +MTX_DEF_SYSINIT(et_eventtimers_mtx, "et_mtx", MTX_DEF); SYSCTL_NODE(_kern, OID_AUTO, eventtimer, CTLFLAG_RW, 0, "Event timers"); static SYSCTL_NODE(_kern_eventtimer, OID_AUTO, et, CTLFLAG_RW, 0, ""); Modified: user/andre/tcp_workqueue/sys/kern/kern_event.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_event.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_event.c Sun Oct 21 13:42:38 2012 (r241815) @@ -74,8 +74,7 @@ static MALLOC_DEFINE(M_KQUEUE, "kqueue", * This lock is used if multiple kq locks are required. This possibly * should be made into a per proc lock. */ -static struct mtx kq_global; -MTX_SYSINIT(kq_global, &kq_global, "kqueue order", MTX_DEF); +static MTX_DEF_SYSINIT(kq_global, "kqueue order", MTX_DEF); #define KQ_GLOBAL_LOCK(lck, haslck) do { \ if (!haslck) \ mtx_lock(lck); \ @@ -269,9 +268,7 @@ extern struct filterops fs_filtops; /* * Table for for all system-defined filters. */ -static struct mtx filterops_lock; -MTX_SYSINIT(kqueue_filterops, &filterops_lock, "protect sysfilt_ops", - MTX_DEF); +static MTX_DEF_SYSINIT(filterops_lock, "protect sysfilt_ops", MTX_DEF); static struct { struct filterops *for_fop; int for_refcnt; @@ -1882,9 +1879,8 @@ knlist_empty(struct knlist *knl) return SLIST_EMPTY(&knl->kl_list); } -static struct mtx knlist_lock; -MTX_SYSINIT(knlist_lock, &knlist_lock, "knlist lock for lockless objects", - MTX_DEF); +static MTX_DEF_SYSINIT(knlist_lock, "knlist lock for lockless objects", + MTX_DEF); static void knlist_mtx_lock(void *arg); static void knlist_mtx_unlock(void *arg); Modified: user/andre/tcp_workqueue/sys/kern/kern_fail.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_fail.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_fail.c Sun Oct 21 13:42:38 2012 (r241815) @@ -73,8 +73,7 @@ static MALLOC_DEFINE(M_FAIL_POINT, "Fail #define fp_free(ptr) free(ptr, M_FAIL_POINT) #define fp_malloc(size, flags) malloc((size), M_FAIL_POINT, (flags)) -static struct mtx g_fp_mtx; -MTX_SYSINIT(g_fp_mtx, &g_fp_mtx, "fail point mtx", MTX_DEF); +static MTX_DEF_SYSINIT(g_fp_mtx, "fail point mtx", MTX_DEF); #define FP_LOCK() mtx_lock(&g_fp_mtx) #define FP_UNLOCK() mtx_unlock(&g_fp_mtx) Modified: user/andre/tcp_workqueue/sys/kern/kern_hhook.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_hhook.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_hhook.c Sun Oct 21 13:42:38 2012 (r241815) @@ -64,9 +64,7 @@ LIST_HEAD(hhookheadhead, hhook_head); VNET_DEFINE(struct hhookheadhead, hhook_head_list); #define V_hhook_head_list VNET(hhook_head_list) -static struct mtx hhook_head_list_lock; -MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", - MTX_DEF); +static MTX_DEF_SYSINIT(hhook_head_list_lock, "hhook_head list lock", MTX_DEF); /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); Modified: user/andre/tcp_workqueue/sys/kern/kern_intr.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_intr.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_intr.c Sun Oct 21 13:42:38 2012 (r241815) @@ -95,8 +95,8 @@ SYSCTL_INT(_hw, OID_AUTO, intr_storm_thr "Number of consecutive interrupts before storm protection is enabled"); static TAILQ_HEAD(, intr_event) event_list = TAILQ_HEAD_INITIALIZER(event_list); -static struct mtx event_lock; -MTX_SYSINIT(intr_event_list, &event_lock, "intr event list", MTX_DEF); + +static MTX_DEF_SYSINIT(event_lock, "intr event list", MTX_DEF); static void intr_event_update(struct intr_event *ie); #ifdef INTR_FILTER Modified: user/andre/tcp_workqueue/sys/kern/kern_pmc.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_pmc.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_pmc.c Sun Oct 21 13:42:38 2012 (r241815) @@ -100,11 +100,10 @@ TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "soft SYSCTL_INT(_kern_hwpmc, OID_AUTO, softevents, CTLFLAG_TUN|CTLFLAG_RD, &pmc_softevents, 0, "maximum number of soft events"); -struct mtx pmc_softs_mtx; int pmc_softs_count; struct pmc_soft **pmc_softs; -MTX_SYSINIT(pmc_soft_mtx, &pmc_softs_mtx, "pmc-softs", MTX_SPIN); +MTX_DEF_SYSINIT(pmc_softs_mtx, "pmc-softs", MTX_SPIN); static void pmc_init_sx(void) Modified: user/andre/tcp_workqueue/sys/kern/kern_racct.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_racct.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_racct.c Sun Oct 21 13:42:38 2012 (r241815) @@ -63,8 +63,7 @@ __FBSDID("$FreeBSD$"); FEATURE(racct, "Resource Accounting"); -static struct mtx racct_lock; -MTX_SYSINIT(racct_lock, &racct_lock, "racct lock", MTX_DEF); +static MTX_DEF_SYSINIT(racct_lock, "racct lock", MTX_DEF); static uma_zone_t racct_zone; Modified: user/andre/tcp_workqueue/sys/kern/kern_rmlock.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_rmlock.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_rmlock.c Sun Oct 21 13:42:38 2012 (r241815) @@ -118,9 +118,7 @@ owner_rm(const struct lock_object *lock, } #endif -static struct mtx rm_spinlock; - -MTX_SYSINIT(rm_spinlock, &rm_spinlock, "rm_spinlock", MTX_SPIN); +static MTX_DEF_SYSINIT(rm_spinlock, "rm_spinlock", MTX_SPIN); /* * Add or remove tracker from per-cpu list. Modified: user/andre/tcp_workqueue/sys/kern/kern_thread.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_thread.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_thread.c Sun Oct 21 13:42:38 2012 (r241815) @@ -72,8 +72,8 @@ SDT_PROBE_DEFINE(proc, , , lwp_exit, lwp static uma_zone_t thread_zone; TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads); -static struct mtx zombie_lock; -MTX_SYSINIT(zombie_lock, &zombie_lock, "zombie lock", MTX_SPIN); + +static MTX_DEF_SYSINIT(zombie_lock, "zombie lock", MTX_SPIN); static void thread_zombie(struct thread *); Modified: user/andre/tcp_workqueue/sys/kern/kern_uuid.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_uuid.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/kern_uuid.c Sun Oct 21 13:42:38 2012 (r241815) @@ -73,8 +73,7 @@ CTASSERT(sizeof(struct uuid_private) == static struct uuid_private uuid_last; -static struct mtx uuid_mutex; -MTX_SYSINIT(uuid_lock, &uuid_mutex, "UUID generator mutex lock", MTX_DEF); +static MTX_DEF_SYSINIT(uuid_mutex, "UUID generator mutex lock", MTX_DEF); /* * Return the first MAC address we encounter or, if none was found, Modified: user/andre/tcp_workqueue/sys/kern/subr_autoconf.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/subr_autoconf.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/subr_autoconf.c Sun Oct 21 13:42:38 2012 (r241815) @@ -56,8 +56,8 @@ __FBSDID("$FreeBSD$"); static TAILQ_HEAD(, intr_config_hook) intr_config_hook_list = TAILQ_HEAD_INITIALIZER(intr_config_hook_list); static struct intr_config_hook *next_to_notify; -static struct mtx intr_config_hook_lock; -MTX_SYSINIT(intr_config_hook, &intr_config_hook_lock, "intr config", MTX_DEF); + +static MTX_DEF_SYSINIT(intr_config_hook_lock, "intr config", MTX_DEF); /* ARGSUSED */ static void run_interrupt_driven_config_hooks(void); Modified: user/andre/tcp_workqueue/sys/kern/subr_devstat.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/subr_devstat.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/subr_devstat.c Sun Oct 21 13:42:38 2012 (r241815) @@ -102,8 +102,8 @@ static int devstat_num_devs; static long devstat_generation = 1; static int devstat_version = DEVSTAT_VERSION; static int devstat_current_devnumber; -static struct mtx devstat_mutex; -MTX_SYSINIT(devstat_mutex, &devstat_mutex, "devstat", MTX_DEF); + +static MTX_DEF_SYSINIT(devstat_mutex, "devstat", MTX_DEF); static struct devstatlist device_statq = STAILQ_HEAD_INITIALIZER(device_statq); static struct devstat *devstat_alloc(void); Modified: user/andre/tcp_workqueue/sys/kern/subr_firmware.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/subr_firmware.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/subr_firmware.c Sun Oct 21 13:42:38 2012 (r241815) @@ -134,8 +134,7 @@ static struct task firmware_unload_task; /* * This mutex protects accesses to the firmware table. */ -static struct mtx firmware_mtx; -MTX_SYSINIT(firmware, &firmware_mtx, "firmware table", MTX_DEF); +static MTX_DEF_SYSINIT(firmware_mtx, "firmware table", MTX_DEF); /* * Helper function to lookup a name. Modified: user/andre/tcp_workqueue/sys/kern/subr_log.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/subr_log.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/subr_log.c Sun Oct 21 13:42:38 2012 (r241815) @@ -93,8 +93,8 @@ static struct logsoftc { int log_open; /* also used in log() */ static struct cv log_wakeup; -struct mtx msgbuf_lock; -MTX_SYSINIT(msgbuf_lock, &msgbuf_lock, "msgbuf lock", MTX_DEF); + +MTX_DEF_SYSINIT(msgbuf_lock, "msgbuf lock", MTX_DEF); /* Times per second to check for a pending syslog wakeup. */ static int log_wakeups_per_second = 5; Modified: user/andre/tcp_workqueue/sys/kern/subr_sleepqueue.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/subr_sleepqueue.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/subr_sleepqueue.c Sun Oct 21 13:42:38 2012 (r241815) @@ -1040,8 +1040,8 @@ LIST_HEAD(sqphead, sleepq_prof); struct sqphead sleepq_prof_free; struct sqphead sleepq_hash[SC_TABLESIZE]; static struct sleepq_prof sleepq_profent[SLEEPQ_PROF_LOCATIONS]; -static struct mtx sleepq_prof_lock; -MTX_SYSINIT(sleepq_prof_lock, &sleepq_prof_lock, "sleepq_prof", MTX_SPIN); + +static MTX_DEF_SYSINIT(sleepq_prof_lock, "sleepq_prof", MTX_SPIN); static void sleepq_profile(const char *wmesg) Modified: user/andre/tcp_workqueue/sys/kern/subr_unit.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/subr_unit.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/subr_unit.c Sun Oct 21 13:42:38 2012 (r241815) @@ -92,9 +92,7 @@ static MALLOC_DEFINE(M_UNIT, "Unitno", " #define Malloc(foo) malloc(foo, M_UNIT, M_WAITOK | M_ZERO) #define Free(foo) free(foo, M_UNIT) -static struct mtx unitmtx; - -MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); +static MTX_DEF_SYSINIT(unitmtx, "unit# allocation", MTX_DEF); #else /* ...USERLAND */ Modified: user/andre/tcp_workqueue/sys/kern/uipc_accf.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/uipc_accf.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/uipc_accf.c Sun Oct 21 13:42:38 2012 (r241815) @@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$"); #include <sys/socketvar.h> #include <sys/queue.h> -static struct mtx accept_filter_mtx; -MTX_SYSINIT(accept_filter, &accept_filter_mtx, "accept_filter_mtx", - MTX_DEF); +static MTX_DEF_SYSINIT(accept_filter_mtx, "accept_filter_mtx", MTX_DEF); #define ACCEPT_FILTER_LOCK() mtx_lock(&accept_filter_mtx) #define ACCEPT_FILTER_UNLOCK() mtx_unlock(&accept_filter_mtx) Modified: user/andre/tcp_workqueue/sys/kern/uipc_domain.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/uipc_domain.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/uipc_domain.c Sun Oct 21 13:42:38 2012 (r241815) @@ -75,8 +75,8 @@ static void pfslowtimo(void *); struct domain *domains; /* registered protocol domains */ int domain_init_status = 0; -static struct mtx dom_mtx; /* domain list lock */ -MTX_SYSINIT(domain, &dom_mtx, "domain list", MTX_DEF); + +static MTX_DEF_SYSINIT(dom_mtx, "domain list", MTX_DEF); /* * Dummy protocol specific user requests function pointer array. Modified: user/andre/tcp_workqueue/sys/kern/uipc_socket.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/uipc_socket.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/uipc_socket.c Sun Oct 21 13:42:38 2012 (r241815) @@ -208,13 +208,13 @@ SYSCTL_INT(_kern_ipc_zero_copy, OID_AUTO * accept_mtx locks down per-socket fields relating to accept queues. See * socketvar.h for an annotation of the protected fields of struct socket. */ -MTX_DEF_SYSINIT(accept_mtx, &accept_mtx, "accept", MTX_DEF); +MTX_DEF_SYSINIT(accept_mtx, "accept", MTX_DEF); /* * so_global_mtx protects so_gencnt, numopensockets, and the per-socket * so_gencnt field. */ -static MTX_DEF_SYSINIT(so_global_mtx, &so_global_mtx, "so_glabel", MTX_DEF); +static MTX_DEF_SYSINIT(so_global_mtx, "so_glabel", MTX_DEF); /* * General IPC sysctl name space, used by sockets and a variety of other IPC Modified: user/andre/tcp_workqueue/sys/kern/vfs_mount.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/vfs_mount.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/kern/vfs_mount.c Sun Oct 21 13:42:38 2012 (r241815) @@ -87,8 +87,7 @@ static uma_zone_t mount_zone; struct mntlist mountlist = TAILQ_HEAD_INITIALIZER(mountlist); /* For any iteration/modification of mountlist */ -struct mtx mountlist_mtx; -MTX_SYSINIT(mountlist, &mountlist_mtx, "mountlist", MTX_DEF); +MTX_DEF_SYSINIT(mountlist_mtx, "mountlist", MTX_DEF); /* * Global opts, taken by all filesystems Modified: user/andre/tcp_workqueue/sys/net/pfil.c ============================================================================== --- user/andre/tcp_workqueue/sys/net/pfil.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/net/pfil.c Sun Oct 21 13:42:38 2012 (r241815) @@ -47,10 +47,7 @@ #include <net/if.h> #include <net/pfil.h> -static struct mtx pfil_global_lock; - -MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock", - MTX_DEF); +static MTX_DEF_SYSINIT(pfil_global_lock, "pfil_head_list lock", MTX_DEF); static int pfil_list_add(pfil_list_t *, struct packet_filter_hook *, int); Modified: user/andre/tcp_workqueue/sys/net/raw_cb.c ============================================================================== --- user/andre/tcp_workqueue/sys/net/raw_cb.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/net/raw_cb.c Sun Oct 21 13:42:38 2012 (r241815) @@ -56,7 +56,7 @@ * redo address binding to allow wildcards */ -struct mtx rawcb_mtx; +MTX_DEF_SYSINIT(rawcb_mtx, "rawcb", MTX_DEF); VNET_DEFINE(struct rawcb_list_head, rawcb_list); static SYSCTL_NODE(_net, OID_AUTO, raw, CTLFLAG_RW, 0, Modified: user/andre/tcp_workqueue/sys/net/raw_usrreq.c ============================================================================== --- user/andre/tcp_workqueue/sys/net/raw_usrreq.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/net/raw_usrreq.c Sun Oct 21 13:42:38 2012 (r241815) @@ -49,8 +49,6 @@ #include <net/raw_cb.h> #include <net/vnet.h> -MTX_SYSINIT(rawcb_mtx, &rawcb_mtx, "rawcb", MTX_DEF); - /* * Initialize raw connection block q. */ Modified: user/andre/tcp_workqueue/sys/net/rtsock.c ============================================================================== --- user/andre/tcp_workqueue/sys/net/rtsock.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/net/rtsock.c Sun Oct 21 13:42:38 2012 (r241815) @@ -167,8 +167,7 @@ static struct { int any_count; /* total attached */ } route_cb; -struct mtx rtsock_mtx; -MTX_SYSINIT(rtsock, &rtsock_mtx, "rtsock route_cb lock", MTX_DEF); +MTX_DEF_SYSINIT(rtsock_mtx, "rtsock route_cb lock", MTX_DEF); #define RTSOCK_LOCK() mtx_lock(&rtsock_mtx) #define RTSOCK_UNLOCK() mtx_unlock(&rtsock_mtx) Modified: user/andre/tcp_workqueue/sys/netatalk/aarp.c ============================================================================== --- user/andre/tcp_workqueue/sys/netatalk/aarp.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/netatalk/aarp.c Sun Oct 21 13:42:38 2012 (r241815) @@ -82,8 +82,7 @@ static void at_aarpinput(struct ifnet *i #define AARPTAB_SIZE (AARPTAB_BSIZ * AARPTAB_NB) static struct aarptab aarptab[AARPTAB_SIZE]; -struct mtx aarptab_mtx; -MTX_SYSINIT(aarptab_mtx, &aarptab_mtx, "aarptab_mtx", MTX_DEF); +MTX_DEF_SYSINIT(aarptab_mtx, "aarptab_mtx", MTX_DEF); #define AARPTAB_HASH(a) ((((a).s_net << 8) + (a).s_node) % AARPTAB_NB) Modified: user/andre/tcp_workqueue/sys/netinet/in_mcast.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/in_mcast.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/netinet/in_mcast.c Sun Oct 21 13:42:38 2012 (r241815) @@ -94,8 +94,7 @@ static MALLOC_DEFINE(M_IPMSOURCE, "ip_ms * any need for in_multi itself to be virtualized -- it is bound to an ifp * anyway no matter what happens. */ -struct mtx in_multi_mtx; -MTX_SYSINIT(in_multi_mtx, &in_multi_mtx, "in_multi_mtx", MTX_DEF); +MTX_DEF_SYSINIT(in_multi_mtx, "in_multi_mtx", MTX_DEF); /* * Functions with non-static linkage defined in this file should be Modified: user/andre/tcp_workqueue/sys/netinet/ip_encap.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_encap.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/netinet/ip_encap.c Sun Oct 21 13:42:38 2012 (r241815) @@ -101,8 +101,7 @@ static void encap_fillarg(struct mbuf *, /* * All global variables in ip_encap.c are locked using encapmtx. */ -static struct mtx encapmtx; -MTX_SYSINIT(encapmtx, &encapmtx, "encapmtx", MTX_DEF); +static MTX_DEF_SYSINIT(encapmtx, "encapmtx", MTX_DEF); LIST_HEAD(, encaptab) encaptab = LIST_HEAD_INITIALIZER(encaptab); /* Modified: user/andre/tcp_workqueue/sys/netinet/ip_id.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_id.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/netinet/ip_id.c Sun Oct 21 13:42:38 2012 (r241815) @@ -97,12 +97,11 @@ static int array_ptr = 0; static int array_size = 8192; static int random_id_collisions = 0; static int random_id_total = 0; -static struct mtx ip_id_mtx; static void ip_initid(void); static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS); -MTX_SYSINIT(ip_id_mtx, &ip_id_mtx, "ip_id_mtx", MTX_DEF); +static MTX_DEF_SYSINIT(ip_id_mtx, "ip_id_mtx", MTX_DEF); SYSCTL_DECL(_net_inet_ip); SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id_period, CTLTYPE_INT|CTLFLAG_RW, Modified: user/andre/tcp_workqueue/sys/netinet/tcp_debug.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_debug.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/netinet/tcp_debug.c Sun Oct 21 13:42:38 2012 (r241815) @@ -86,8 +86,7 @@ static int tcp_debx; * two parts, one of which saves connection and other state into the global * array (locked by tcp_debug_mtx). */ -struct mtx tcp_debug_mtx; -MTX_SYSINIT(tcp_debug_mtx, &tcp_debug_mtx, "tcp_debug_mtx", MTX_DEF); +MTX_DEF_SYSINIT(tcp_debug_mtx, "tcp_debug_mtx", MTX_DEF); /* * Save TCP state at a given moment; optionally, both tcpcb and TCP packet Modified: user/andre/tcp_workqueue/sys/netinet6/in6_mcast.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet6/in6_mcast.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/netinet6/in6_mcast.c Sun Oct 21 13:42:38 2012 (r241815) @@ -103,8 +103,7 @@ RB_GENERATE(ip6_msource_tree, ip6_msourc * any need for in6_multi itself to be virtualized -- it is bound to an ifp * anyway no matter what happens. */ -struct mtx in6_multi_mtx; -MTX_SYSINIT(in6_multi_mtx, &in6_multi_mtx, "in6_multi_mtx", MTX_DEF); +MTX_DEF_SYSINIT(in6_multi_mtx, "in6_multi_mtx", MTX_DEF); static void im6f_commit(struct in6_mfilter *); static int im6f_get_source(struct in6_mfilter *imf, Modified: user/andre/tcp_workqueue/sys/vm/vm_glue.c ============================================================================== --- user/andre/tcp_workqueue/sys/vm/vm_glue.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/vm/vm_glue.c Sun Oct 21 13:42:38 2012 (r241815) @@ -306,7 +306,8 @@ vm_sync_icache(vm_map_t map, vm_offset_t struct kstack_cache_entry *kstack_cache; static int kstack_cache_size = 128; static int kstacks; -static struct mtx kstack_cache_mtx; +static MTX_DEF_SYSINIT(kstack_cache_mtx, "kstkch", MTX_DEF); + SYSCTL_INT(_vm, OID_AUTO, kstack_cache_size, CTLFLAG_RW, &kstack_cache_size, 0, ""); SYSCTL_INT(_vm, OID_AUTO, kstacks, CTLFLAG_RD, &kstacks, 0, @@ -486,7 +487,6 @@ kstack_cache_init(void *nulll) EVENTHANDLER_PRI_ANY); } -MTX_SYSINIT(kstack_cache, &kstack_cache_mtx, "kstkch", MTX_DEF); SYSINIT(vm_kstacks, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, kstack_cache_init, NULL); #ifndef NO_SWAPPING Modified: user/andre/tcp_workqueue/sys/vm/vm_pageout.c ============================================================================== --- user/andre/tcp_workqueue/sys/vm/vm_pageout.c Sun Oct 21 13:41:18 2012 (r241814) +++ user/andre/tcp_workqueue/sys/vm/vm_pageout.c Sun Oct 21 13:42:38 2012 (r241815) @@ -146,9 +146,8 @@ int vm_pageout_pages_needed; /* flag say #if !defined(NO_SWAPPING) static int vm_pageout_req_swapout; /* XXX */ static int vm_daemon_needed; -static struct mtx vm_daemon_mtx; /* Allow for use by vm_pageout before vm_daemon is initialized. */ -MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, "vm daemon", MTX_DEF); +static MTX_DEF_SYSINIT(vm_daemon_mtx, "vm daemon", MTX_DEF); #endif static int vm_max_launder = 32; static int vm_pageout_stats_max=0, vm_pageout_stats_interval = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210211342.q9LDgdoj087084>