Exemplo n.º 1
0
/*
 * -----------------------------------------------------------------
 *			cfsd_fscache_destroy
 *
 * Description:
 * Arguments:
 * Returns:
 * Preconditions:
 */
void
cfsd_fscache_destroy(cfsd_fscache_object_t *fscache_object_p)
{
	int xx;

	dbug_enter("cfsd_fscache_destroy");

	dbug_precond(fscache_object_p);
	/* dbug_assert(fscache_object_p->i_refcnt == 0); */

	/* close down the message file descriptor */
	if (fscache_object_p->i_ofd >= 0) {
		if (close(fscache_object_p->i_ofd))
			dbug_print(("error", "cannot close fscache fd error %d",
			    errno));
		fscache_object_p->i_ofd = -1;
	}

	/* destroy the locking mutex */
	xx = mutex_destroy(&fscache_object_p->i_lock);
	dbug_assert(xx == 0);

	/* destroy the conditional variable */
	xx = cond_destroy(&fscache_object_p->i_cvwait);
	dbug_assert(xx == 0);

	cfsd_free(fscache_object_p);

	dbug_leave("cfsd_fscache_destroy");
}
Exemplo n.º 2
0
/*
 * ------------------------------------------------------------
 *			cfsd_all_destroy
 *
 * Description:
 * Arguments:
 * Returns:
 * Preconditions:
 */
void
cfsd_all_destroy(cfsd_all_object_t *all_object_p)
{
	cfsd_cache_object_t *cache_object_p;
	cfsd_cache_object_t *tmp_cache_object_p;
	int xx;

	dbug_enter("cfsd_all_destroy");

	/* dbug_assert(all_object_p->i_hoardp == NULL); */

	/* get rid of any cache objects */
	cache_object_p = all_object_p->i_cachelist;

	while (cache_object_p != NULL) {
		tmp_cache_object_p = cache_object_p->i_next;
		cfsd_cache_destroy(cache_object_p);
		cache_object_p = tmp_cache_object_p;
	}

	/* destroy the locking mutex */
	xx = mutex_destroy(&all_object_p->i_lock);
	dbug_assert(xx == 0);
	cfsd_free(all_object_p);
	dbug_leave("cfsd_all_destroy");
}
Exemplo n.º 3
0
/*
 *			cfsd_logfile_destroy
 *
 * Description:
 * Arguments:
 * Returns:
 * Preconditions:
 */
void
cfsd_logfile_destroy(cfsd_logfile_object_t *logfile_object_p)
{
	dbug_enter("cfsd_logfile_destroy");
	logfile_sync(logfile_object_p);
	logfile_teardown(logfile_object_p);
	cfsd_free(logfile_object_p);
	dbug_leave("cfsd_logfile_destroy");
}