示例#1
0
UNIV_INLINE
void
mtr_memo_note_modification_all(
/*===========================*/
	mtr_t*	mtr)	/* in: mtr */
{
	mtr_memo_slot_t* slot;
	dyn_array_t*	memo;
	ulint		offset;

	ut_ad(mtr);
	ut_ad(mtr->magic_n == MTR_MAGIC_N);
	ut_ad(mtr->state == MTR_COMMITTING); /* Currently only used in
					     commit */
	ut_ad(mtr->modifications);

	memo = &(mtr->memo);

	offset = dyn_array_get_data_size(memo);

	while (offset > 0) {
		offset -= sizeof(mtr_memo_slot_t);
		slot = dyn_array_get_element(memo, offset);

		if (UNIV_LIKELY(slot->object != NULL) &&
		    slot->type == MTR_MEMO_PAGE_X_FIX) {
			buf_flush_note_modification(
				(buf_block_t*)slot->object, mtr);
		}
	}
}
示例#2
0
/*****************************************************************//**
Releases the item in the slot given. */
static
void
mtr_memo_slot_note_modification(
/*============================*/
	mtr_t*			mtr,	/*!< in: mtr */
	mtr_memo_slot_t*	slot)	/*!< in: memo slot */
{
	ut_ad(mtr);
	ut_ad(mtr->magic_n == MTR_MAGIC_N);
	ut_ad(mtr->modifications);

	if (slot->object != NULL && slot->type == MTR_MEMO_PAGE_X_FIX) {
		buf_block_t*	block = (buf_block_t*) slot->object;

#ifdef UNIV_DEBUG
		ut_ad(log_flush_order_mutex_own());
#endif /* UNIV_DEBUG */
		buf_flush_note_modification(block, mtr);
	}
}
示例#3
0
/***************************************************//**
Releases an object in the memo stack. */
UNIV_INTERN
void
mtr_memo_release(
/*=============*/
	mtr_t*	mtr,	/*!< in: mtr */
	void*	object,	/*!< in: object */
	ulint	type)	/*!< in: object type: MTR_MEMO_S_LOCK, ... */
{
	mtr_memo_slot_t* slot;
	dyn_array_t*	memo;
	ulint		offset;

	ut_ad(mtr);
	ut_ad(mtr->magic_n == MTR_MAGIC_N);
	ut_ad(mtr->state == MTR_ACTIVE);

	memo = &(mtr->memo);

	offset = dyn_array_get_data_size(memo);

	while (offset > 0) {
		offset -= sizeof(mtr_memo_slot_t);

		slot = dyn_array_get_element(memo, offset);

		if ((object == slot->object) && (type == slot->type)) {
			if (mtr->modifications &&
			    UNIV_LIKELY(slot->object != NULL) &&
			    slot->type == MTR_MEMO_PAGE_X_FIX) {
				buf_flush_note_modification(
					(buf_block_t*)slot->object, mtr);
			}

			mtr_memo_slot_release(mtr, slot);

			break;
		}
	}
}