kern_rwlock.c (196226) | kern_rwlock.c (196334) |
---|---|
1/*- 2 * Copyright (c) 2006 John Baldwin <jhb@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * SUCH DAMAGE. 28 */ 29 30/* 31 * Machine independent bits of reader/writer lock implementation. 32 */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 John Baldwin <jhb@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * SUCH DAMAGE. 28 */ 29 30/* 31 * Machine independent bits of reader/writer lock implementation. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/kern/kern_rwlock.c 196226 2009-08-14 21:46:54Z bz $"); | 35__FBSDID("$FreeBSD: head/sys/kern/kern_rwlock.c 196334 2009-08-17 16:17:21Z attilio $"); |
36 37#include "opt_ddb.h" 38#include "opt_kdtrace.h" 39#include "opt_no_adaptive_rwlocks.h" 40 41#include <sys/param.h> 42#include <sys/ktr.h> 43#include <sys/kernel.h> --- 125 unchanged lines hidden (view full) --- 169 170void 171rw_init_flags(struct rwlock *rw, const char *name, int opts) 172{ 173 int flags; 174 175 MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | 176 RW_RECURSE)) == 0); | 36 37#include "opt_ddb.h" 38#include "opt_kdtrace.h" 39#include "opt_no_adaptive_rwlocks.h" 40 41#include <sys/param.h> 42#include <sys/ktr.h> 43#include <sys/kernel.h> --- 125 unchanged lines hidden (view full) --- 169 170void 171rw_init_flags(struct rwlock *rw, const char *name, int opts) 172{ 173 int flags; 174 175 MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | 176 RW_RECURSE)) == 0); |
177 ASSERT_ATOMIC_LOAD(rw->rw_lock, ("%s: rw_lock not aligned for %s: %p", 178 __func__, name, &rw->rw_lock)); | 177 ASSERT_ATOMIC_LOAD_PTR(rw->rw_lock, 178 ("%s: rw_lock not aligned for %s: %p", __func__, name, 179 &rw->rw_lock)); |
179 180 flags = LO_UPGRADABLE; 181 if (opts & RW_DUPOK) 182 flags |= LO_DUPOK; 183 if (opts & RW_NOPROFILE) 184 flags |= LO_NOPROFILE; 185 if (!(opts & RW_NOWITNESS)) 186 flags |= LO_WITNESS; --- 938 unchanged lines hidden --- | 180 181 flags = LO_UPGRADABLE; 182 if (opts & RW_DUPOK) 183 flags |= LO_DUPOK; 184 if (opts & RW_NOPROFILE) 185 flags |= LO_NOPROFILE; 186 if (!(opts & RW_NOWITNESS)) 187 flags |= LO_WITNESS; --- 938 unchanged lines hidden --- |