diff --git a/src/box/vinyl.c b/src/box/vinyl.c index 478dd815926c73dd7ec52fe8655549ec3e98ab2c..87b9eefacf06db21585da58c456f6701481072d4 100644 --- a/src/box/vinyl.c +++ b/src/box/vinyl.c @@ -2409,7 +2409,7 @@ vinyl_engine_begin_statement(struct engine *engine, struct txn *txn) struct vy_tx *tx = txn->engine_tx; struct txn_stmt *stmt = txn_current_stmt(txn); assert(tx != NULL); - stmt->engine_savepoint = vy_tx_savepoint(tx); + stmt->engine_savepoint = vy_tx_begin_statement(tx); return 0; } @@ -2420,7 +2420,7 @@ vinyl_engine_rollback_statement(struct engine *engine, struct txn *txn, (void)engine; struct vy_tx *tx = txn->engine_tx; assert(tx != NULL); - vy_tx_rollback_to_savepoint(tx, stmt->engine_savepoint); + vy_tx_rollback_statement(tx, stmt->engine_savepoint); } /* }}} Public API of transaction control */ diff --git a/src/box/vy_tx.c b/src/box/vy_tx.c index ac02ee4d4af075cd732540676873de1397772d8a..53c495d4ff44628a2adad19d1ca2d075ee4119d9 100644 --- a/src/box/vy_tx.c +++ b/src/box/vy_tx.c @@ -833,8 +833,15 @@ vy_tx_rollback(struct vy_tx *tx) mempool_free(&xm->tx_mempool, tx); } +void * +vy_tx_begin_statement(struct vy_tx *tx) +{ + assert(tx->state == VINYL_TX_READY); + return stailq_last(&tx->log); +} + void -vy_tx_rollback_to_savepoint(struct vy_tx *tx, void *svp) +vy_tx_rollback_statement(struct vy_tx *tx, void *svp) { assert(tx->state == VINYL_TX_READY); struct stailq_entry *last = svp; diff --git a/src/box/vy_tx.h b/src/box/vy_tx.h index 9524936fb1c931e5fcd8c11a1f88f5f433d40b94..590538d8099fcc85d9c3862325c04d5a5369f084 100644 --- a/src/box/vy_tx.h +++ b/src/box/vy_tx.h @@ -311,20 +311,23 @@ void vy_tx_rollback(struct vy_tx *tx); /** + * Begin a statement in the vinyl transaction manager. * Return the save point corresponding to the current * transaction state. The transaction can be rolled back - * to a save point with vy_tx_rollback_to_savepoint(). + * to a save point with vy_tx_rollback_statement(). */ -static inline void * -vy_tx_savepoint(struct vy_tx *tx) -{ - assert(tx->state == VINYL_TX_READY); - return stailq_last(&tx->log); -} +void * +vy_tx_begin_statement(struct vy_tx *tx); -/** Rollback a transaction to a given save point. */ +/** + * Rollback a transaction statement. + * + * @param tx Transaction in question. + * @param svp Save point to rollback to, as returned by + * vy_tx_begin_statement(). + */ void -vy_tx_rollback_to_savepoint(struct vy_tx *tx, void *svp); +vy_tx_rollback_statement(struct vy_tx *tx, void *svp); /** * Remember a read interval in the conflict manager index.