include/ccKVS/inline_util.h
static inline void run_through_rest_of_ops_LIN(struct extended_cache_op *ops, struct extended_cache_op *next_ops,
											   struct mica_resp *resp,
											   struct mica_resp *next_resp, struct key_home *key_homes,
											   struct key_home *next_key_homes,
											   uint16_t *op_i, uint16_t *next_op_i, uint16_t *stalled_ops_i,
											   uint16_t local_client_id,
											   struct latency_flags *latency_info, uint16_t *hottest_keys_pointers)
{
	while (*op_i < CACHE_BATCH_SIZE) {
		if (resp[(*op_i)].type == CACHE_MISS) resp[(*op_i)].type = UNSERVED_CACHE_MISS;
		if (STALLING_DEBUG_LIN) {
			if (resp[(*op_i)].type == CACHE_GET_STALL || resp[(*op_i)].type == CACHE_PUT_STALL) (*stalled_ops_i)++;
		}
		if (resp[(*op_i)].type == CACHE_GET_SUCCESS || ops[(*op_i)].opcode == CACHE_OP_INV ||
			resp[(*op_i)].type == CACHE_PUT_FAIL) {
			if ((ENABLE_HOT_KEY_TRACKING == 1) && (resp[(*op_i)].type == CACHE_GET_SUCCESS)) {
				c_stats[local_client_id].cache_hits_per_client += (ops[(*op_i)].val_len + 1);
				if ((ops[(*op_i)].value[0]) < HOTTEST_KEYS_TO_TRACK) {
					if (hottest_keys_pointers[ops[(*op_i)].value[0]] == ((*op_i) + 1)) {
						hottest_keys_pointers[ops[(*op_i)].value[0]] = 0;
					}
				}
			}
			else c_stats[local_client_id].cache_hits_per_client++;
			resp[(*op_i)].type = EMPTY;
		}
		else copy_op_to_next_op(ops, next_ops, resp, next_resp, key_homes, next_key_homes, (*op_i), next_op_i, latency_info, hottest_keys_pointers);
		(*op_i)++;
	}
}
// After creating the remote batch, iterate through the rest of the ops for bookkeeping
After creating the remote batch, iterate through the rest of the ops for bookkeeping
After creating the remote batch iterate through the rest of the ops for bookkeeping
static inline void run_through_rest_of_ops_LIN(struct extended_cache_op *ops, struct extended_cache_op *next_ops,
											   struct mica_resp *resp,
											   struct mica_resp *next_resp, struct key_home *key_homes,
											   struct key_home *next_key_homes,
											   uint16_t *op_i, uint16_t *next_op_i, uint16_t *stalled_ops_i,
											   uint16_t local_client_id,
											   struct latency_flags *latency_info, uint16_t *hottest_keys_pointers)
{
	while (*op_i < CACHE_BATCH_SIZE) {
		if (resp[(*op_i)].type == CACHE_MISS) resp[(*op_i)].type = UNSERVED_CACHE_MISS;
		if (STALLING_DEBUG_LIN) {
			if (resp[(*op_i)].type == CACHE_GET_STALL || resp[(*op_i)].type == CACHE_PUT_STALL) (*stalled_ops_i)++;
		}
		if (resp[(*op_i)].type == CACHE_GET_SUCCESS || ops[(*op_i)].opcode == CACHE_OP_INV ||
			resp[(*op_i)].type == CACHE_PUT_FAIL) {
			if ((ENABLE_HOT_KEY_TRACKING == 1) && (resp[(*op_i)].type == CACHE_GET_SUCCESS)) {
				c_stats[local_client_id].cache_hits_per_client += (ops[(*op_i)].val_len + 1);
				if ((ops[(*op_i)].value[0]) < HOTTEST_KEYS_TO_TRACK) {
					if (hottest_keys_pointers[ops[(*op_i)].value[0]] == ((*op_i) + 1)) {
						hottest_keys_pointers[ops[(*op_i)].value[0]] = 0;
					}
				}
			}
			else c_stats[local_client_id].cache_hits_per_client++;
			resp[(*op_i)].type = EMPTY;
		}
		else copy_op_to_next_op(ops, next_ops, resp, next_resp, key_homes, next_key_homes, (*op_i), next_op_i, latency_info, hottest_keys_pointers);
		(*op_i)++;
	}
}
static inline void run_through_rest_of_ops_LIN ( struct extended_cache_op * ops , struct extended_cache_op * next_ops , struct mica_resp * resp , struct mica_resp * next_resp , struct key_home * key_homes , struct key_home * next_key_homes , uint16_t * op_i , uint16_t * next_op_i , uint16_t * stalled_ops_i , uint16_t local_client_id , struct latency_flags * latency_info , uint16_t * hottest_keys_pointers ) { while ( * op_i < CACHE_BATCH_SIZE ) { if ( resp [ ( * op_i ) ] . type == CACHE_MISS ) resp [ ( * op_i ) ] . type = UNSERVED_CACHE_MISS ; if ( STALLING_DEBUG_LIN ) { if ( resp [ ( * op_i ) ] . type == CACHE_GET_STALL || resp [ ( * op_i ) ] . type == CACHE_PUT_STALL ) ( * stalled_ops_i ) ++ ; } if ( resp [ ( * op_i ) ] . type == CACHE_GET_SUCCESS || ops [ ( * op_i ) ] . opcode == CACHE_OP_INV || resp [ ( * op_i ) ] . type == CACHE_PUT_FAIL ) { if ( ( ENABLE_HOT_KEY_TRACKING == 1 ) && ( resp [ ( * op_i ) ] . type == CACHE_GET_SUCCESS ) ) { c_stats [ local_client_id ] . cache_hits_per_client += ( ops [ ( * op_i ) ] . val_len + 1 ) ; if ( ( ops [ ( * op_i ) ] . value [ 0 ] ) < HOTTEST_KEYS_TO_TRACK ) { if ( hottest_keys_pointers [ ops [ ( * op_i ) ] . value [ 0 ] ] == ( ( * op_i ) + 1 ) ) { hottest_keys_pointers [ ops [ ( * op_i ) ] . value [ 0 ] ] = 0 ; } } } else c_stats [ local_client_id ] . cache_hits_per_client ++ ; resp [ ( * op_i ) ] . type = EMPTY ; } else copy_op_to_next_op ( ops , next_ops , resp , next_resp , key_homes , next_key_homes , ( * op_i ) , next_op_i , latency_info , hottest_keys_pointers ) ; ( * op_i ) ++ ; } }
After creating the remote batch, iterate through the rest of the ops for bookkeeping
After creating the remote batch iterate through the rest of the ops for bookkeeping