Standalone SX shims
Create a do-nothing version of SX locks. OpenZFS needs them. However, since the boot loader is single threaded, they can be nops.
This commit is contained in:
parent
cf0fd1f84a
commit
dc761d84e2
22
sys/sys/sx.h
22
sys/sys/sx.h
@ -300,4 +300,26 @@ __sx_xunlock(struct sx *sx, struct thread *td, const char *file, int line)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#ifdef _STANDALONE
|
||||
/* since we have no threads in the boot loader, trivially implement no-op version */
|
||||
#define sx_xlock(s) (1)
|
||||
#define sx_try_xlock(s) (1)
|
||||
#define sx_xunlock(s) (1)
|
||||
#define SX_DUPOK 0
|
||||
#define SX_NEW 0
|
||||
#define SX_NOWITNESS 0
|
||||
|
||||
static __inline void
|
||||
sx_init_flags(struct sx *sx, const char *description, int opts)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static __inline void
|
||||
sx_destroy(struct sx *sx)
|
||||
{
|
||||
|
||||
}
|
||||
#endif /* _STANDALONE */
|
||||
|
||||
#endif /* !_SYS_SX_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user