Add HAVE_ZVOL wrappers

This commit is contained in:
Brian Behlendorf 2009-01-09 11:16:01 -08:00
parent 8bb10f0528
commit 7902b5fdf1
1 changed files with 8 additions and 0 deletions

View File

@ -1495,21 +1495,29 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, cred_t *cr, int *rvalp)
int int
zvol_busy(void) zvol_busy(void)
{ {
#ifdef HAVE_ZVOL
return (zvol_minors != 0); return (zvol_minors != 0);
#else
return 0;
#endif /* HAVE_ZVOL */
} }
void void
zvol_init(void) zvol_init(void)
{ {
#ifdef HAVE_ZVOL
VERIFY(ddi_soft_state_init(&zvol_state, sizeof (zvol_state_t), 1) == 0); VERIFY(ddi_soft_state_init(&zvol_state, sizeof (zvol_state_t), 1) == 0);
mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
#endif /* HAVE_ZVOL */
} }
void void
zvol_fini(void) zvol_fini(void)
{ {
#ifdef HAVE_ZVOL
mutex_destroy(&zvol_state_lock); mutex_destroy(&zvol_state_lock);
ddi_soft_state_fini(&zvol_state); ddi_soft_state_fini(&zvol_state);
#endif /* HAVE_ZVOL */
} }
static boolean_t static boolean_t