Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/rangelock.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | void *rangelock_rlock(struct rangelock *lock, off_t start, off_t end, | ||||
struct mtx *ilk); | struct mtx *ilk); | ||||
void *rangelock_tryrlock(struct rangelock *lock, off_t start, off_t end, | void *rangelock_tryrlock(struct rangelock *lock, off_t start, off_t end, | ||||
struct mtx *ilk); | struct mtx *ilk); | ||||
void *rangelock_wlock(struct rangelock *lock, off_t start, off_t end, | void *rangelock_wlock(struct rangelock *lock, off_t start, off_t end, | ||||
struct mtx *ilk); | struct mtx *ilk); | ||||
void *rangelock_trywlock(struct rangelock *lock, off_t start, off_t end, | void *rangelock_trywlock(struct rangelock *lock, off_t start, off_t end, | ||||
struct mtx *ilk); | struct mtx *ilk); | ||||
void rlqentry_free(struct rl_q_entry *rlqe); | void rlqentry_free(struct rl_q_entry *rlqe); | ||||
#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) | |||||
void _rangelock_cookie_assert(void *cookie, int what, const char *file, | |||||
int line); | |||||
#endif | |||||
#ifdef INVARIANTS | |||||
#define rangelock_cookie_assert_(cookie, what, file, line) \ | |||||
_rangelock_cookie_assert((cookie), (what), (file), (line)) | |||||
#else | |||||
#define rangelock_cookie_assert_(cookie, what, file, line) (void)0 | |||||
#endif | |||||
#define rangelock_cookie_assert(cookie, what) \ | |||||
rangelock_cookie_assert_((cookie), (what), __FILE__, __LINE__) | |||||
#ifndef LA_LOCKED | |||||
#error LA_LOCKED not defined, include <sys/lock.h> before <sys/rangelock.h> | |||||
kib: I suspect it is too far in cargo cult. It is fine to define RCA_XXX as plain constants, I do… | |||||
#endif | |||||
/* | |||||
* Assertion flags. | |||||
*/ | |||||
#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) | |||||
#define RCA_LOCKED LA_LOCKED | |||||
#define RCA_RLOCKED LA_SLOCKED | |||||
#define RCA_WLOCKED LA_XLOCKED | |||||
#define RCA_UNLOCKED LA_UNLOCKED | |||||
#endif | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* _SYS_RANGELOCK_H */ | #endif /* _SYS_RANGELOCK_H */ |
I suspect it is too far in cargo cult. It is fine to define RCA_XXX as plain constants, I do not see a need in any services from sys/lock.h.