예제 #1
0
kek_except_t * make_exception(kek_obj_t * msg) {
	uint32_t id = gc_rootset_add((kek_obj_t **) &msg);
	class_t * expt_class = vm_find_class("Exception");
	kek_except_t * expt = (kek_except_t*) alloc_exception(expt_class);
	native_new_exception(expt, msg);

	gc_rootset_remove_id(id);
	return expt;
}
예제 #2
0
파일: dm-snap.c 프로젝트: smx-smx/dsl-n55u
static inline struct pending_exception *alloc_pending_exception(void)
{
	return mempool_alloc(pending_pool, GFP_NOIO);
}

static inline void free_pending_exception(struct pending_exception *pe)
{
	mempool_free(pe, pending_pool);
}

int dm_add_exception(struct dm_snapshot *s, chunk_t old, chunk_t new)
{
	struct exception *e;

	e = alloc_exception();
	if (!e)
		return -ENOMEM;

	e->old_chunk = old;
	e->new_chunk = new;
	insert_exception(&s->complete, e);
	return 0;
}

/*
 * Hard coded magic.
 */
static int calc_max_buckets(void)
{
	/* use a fixed size of 2MB */