/* * apply a msg to leaf msgbuf * neither the leaf type is LE_CLEAN or LE_MVCC * msgbuf will always keep multi-snapshot * the difference between LE_CLEAN and LE_MVCC is gc affects. * */ int leaf_put(struct node *leaf, struct bt_cmd *cmd) { int ret = NESS_ERR; struct lmb *buffer = (struct lmb*)leaf->parts[0].msgbuf; switch (cmd->type & 0xff) { case MSG_INSERT: lmb_put(buffer, cmd->msn, cmd->type, cmd->key, cmd->val, &cmd->xidpair); return NESS_OK; break; case MSG_DELETE: break; case MSG_UPDATE: break; case MSG_COMMIT: break; case MSG_ABORT: break; default: break; } leaf->msn = cmd->msn > leaf->msn ? cmd->msn : leaf->msn; node_set_dirty(leaf); return ret; }
int _le_apply_insert(struct lmb *mb, struct bt_cmd *cmd) { lmb_put(mb, cmd->msn, cmd->type, cmd->key, cmd->val, &cmd->xidpair); return NESS_OK; }