/*
 * smb_notify_init
 *
 * This function is not multi-thread safe. The caller must make sure only one
 * thread makes the call.
 */
int
smb_notify_init(void)
{
	int	rc;

	if (smb_notify_initialized)
		return (0);

	smb_slist_constructor(&smb_ncr_list, sizeof (smb_request_t),
	    offsetof(smb_request_t, sr_ncr.nc_lnd));

	smb_slist_constructor(&smb_nce_list, sizeof (smb_request_t),
	    offsetof(smb_request_t, sr_ncr.nc_lnd));

	smb_thread_init(&smb_thread_notify_daemon,
	    "smb_notify_change_daemon", smb_notify_change_daemon, NULL);

	rc = smb_thread_start(&smb_thread_notify_daemon);
	if (rc) {
		smb_thread_destroy(&smb_thread_notify_daemon);
		smb_slist_destructor(&smb_ncr_list);
		smb_slist_destructor(&smb_nce_list);
		return (rc);
	}

	smb_notify_initialized = B_TRUE;

	return (0);
}
Beispiel #2
0
void
smb_kshare_init(smb_server_t *sv)
{

	smb_llist_constructor(&sv->sv_export.e_vfs_list, sizeof (smb_vfs_t),
	    offsetof(smb_vfs_t, sv_lnd));

	smb_slist_constructor(&sv->sv_export.e_unexport_list,
	    sizeof (smb_unshare_t), offsetof(smb_unshare_t, us_lnd));
}