X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=txn%2Ftxn.c;fp=txn%2Ftxn.c;h=b3aadfd14b38d76a9295dbc355f840b850d61e91;hp=69f3b55daa6f1d64abb9aa9e06c35bd581b2e18c;hb=7d658a03f83e64690d0c71b4733dd3f9a2c60208;hpb=6b4f3ea4891b6c0e65dfd6d41f49aee2daa9e23d diff --git a/txn/txn.c b/txn/txn.c index 69f3b55..b3aadfd 100644 --- a/txn/txn.c +++ b/txn/txn.c @@ -36,7 +36,7 @@ struct txn { write_rec_t *writes; size_t writes_size; size_t writes_count; - size_t writes_scan; + size_t validate_scan; txn_state_e state; }; @@ -46,11 +46,6 @@ static skiplist_t *active_ = NULL; static version_t version_ = 1; -static inline skiplist_t *get_active (void) { - - return active_; -} - // Validate the updates for . Validation fails if there is a write-write conflict. That is if after our // read version another transaction committed a change to an entry we are also trying to change. // @@ -119,7 +114,6 @@ static txn_state_e validate_key (txn_t *txn, map_key_t key) { static txn_state_e txn_validate (txn_t *txn) { assert(txn->state != TXN_RUNNING); - int i; switch (txn->state) { case TXN_VALIDATING: @@ -128,7 +122,7 @@ static txn_state_e txn_validate (txn_t *txn) { (void)SYNC_CAS(&txn->wv, UNDETERMINED_VERSION, wv); } - for (i = 0; i < txn->writes_count; ++i) { + for (int i = 0; i < txn->writes_count; ++i) { txn_state_e s = validate_key(txn, txn->writes[i].key); if (s == TXN_ABORTED) { txn->state = TXN_ABORTED; @@ -334,7 +328,6 @@ map_val_t txn_map_get (txn_t *txn, map_key_t key) { map_val_t value = update->value; TRACE("x1", "txn_map_get: key found returning value %p", value, 0); - return value; // collect some garbage version_t min_active_version = UNDETERMINED_VERSION; update_t *next_update = NULL;