Reduce vertical whitespace and other minor style tweaks.
Remove unused rm_initialized() macro.
This commit is contained in:
parent
e31d083357
commit
ba693877af
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=193026
@ -33,26 +33,22 @@
|
||||
#define _SYS_RMLOCK_H_
|
||||
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#include <sys/_lock.h>
|
||||
#include <sys/_rmlock.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
|
||||
void rm_init(struct rmlock *rm, const char *name, int opts);
|
||||
void rm_destroy(struct rmlock *rm);
|
||||
int rm_wowned(struct rmlock *rm);
|
||||
void rm_sysinit(void *arg);
|
||||
|
||||
|
||||
void _rm_wlock_debug(struct rmlock *rm, const char *file, int line);
|
||||
void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line);
|
||||
void _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker,
|
||||
const char *file, int line);
|
||||
const char *file, int line);
|
||||
void _rm_runlock_debug(struct rmlock *rm, struct rm_priotracker *tracker,
|
||||
const char *file, int line);
|
||||
|
||||
const char *file, int line);
|
||||
|
||||
void _rm_wlock(struct rmlock *rm);
|
||||
void _rm_wunlock(struct rmlock *rm);
|
||||
@ -61,33 +57,25 @@ void _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker);
|
||||
|
||||
/*
|
||||
* Public interface for lock operations.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOCK_DEBUG
|
||||
#error LOCK_DEBUG not defined, include <sys/lock.h> before <sys/rmlock.h>
|
||||
#endif
|
||||
|
||||
#if LOCK_DEBUG > 0
|
||||
|
||||
#define rm_wlock(rm) _rm_wlock_debug((rm), LOCK_FILE, LOCK_LINE)
|
||||
#define rm_wunlock(rm) _rm_wunlock_debug((rm), LOCK_FILE, LOCK_LINE)
|
||||
#define rm_rlock(rm,tracker) \
|
||||
_rm_rlock_debug((rm),(tracker), LOCK_FILE, LOCK_LINE )
|
||||
#define rm_runlock(rm,tracker) \
|
||||
_rm_runlock_debug((rm), (tracker), LOCK_FILE, LOCK_LINE )
|
||||
|
||||
#else
|
||||
|
||||
#define rm_wlock(rm) _rm_wlock((rm))
|
||||
#define rm_wunlock(rm) _rm_wunlock((rm))
|
||||
#define rm_rlock(rm,tracker) _rm_rlock((rm),(tracker))
|
||||
#define rm_runlock(rm,tracker) _rm_runlock((rm), (tracker))
|
||||
|
||||
#endif
|
||||
|
||||
#define rm_initialized(rm) lock_initalized(&(rm)->lock_object)
|
||||
|
||||
struct rm_args {
|
||||
struct rmlock *ra_rm;
|
||||
const char *ra_desc;
|
||||
@ -105,6 +93,5 @@ struct rm_args {
|
||||
SYSUNINIT(name##_rm_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \
|
||||
rm_destroy, (rm))
|
||||
|
||||
|
||||
#endif /* _KERNEL */
|
||||
#endif /* !_SYS_RMLOCK_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user