+int kblock_swLoad(struct KBlock *b, block_idx_t index)
+{
+ /*
+ * Since this is a low level API, the index here is a fisical index.
+ * If we call another low level API, logical to fisical translation
+ * would be applied twice.
+ * In order to avoid this we subtract the start block index.
+ */
+ ASSERT(index >= b->priv.blk_start);
+ return (kblock_readDirect(b, index - b->priv.blk_start, b->priv.buf, 0, b->blk_size) == b->blk_size) ? 0 : EOF;
+}
+
+int kblock_swStore(struct KBlock *b, block_idx_t index)
+{
+ /*
+ * Since this is a low level API, the index here is a fisical index.
+ * If we call another low level API, logical to fisical translation
+ * would be applied twice.
+ * In order to avoid this we subtract the start block index.
+ */
+ ASSERT(index >= b->priv.blk_start);
+ return (kblock_writeDirect(b, index - b->priv.blk_start, b->priv.buf, 0, b->blk_size) == b->blk_size) ? 0 : EOF;
+}
+
+size_t kblock_swReadBuf(struct KBlock *b, void *buf, size_t offset, size_t size)
+{
+ ASSERT(buf);
+ ASSERT(offset + size <= b->blk_size);
+
+ memcpy(buf, (uint8_t *)b->priv.buf + offset, size);
+ return size;
+}
+
+size_t kblock_swWriteBuf(struct KBlock *b, const void *buf, size_t offset, size_t size)
+{
+ ASSERT(buf);
+ ASSERT(offset + size <= b->blk_size);
+ memcpy((uint8_t *)b->priv.buf + offset, buf, size);
+ return size;