- b->priv.curr_blk = dest;
- kblock_setDirty(b, true);
- return 0;
+ b->priv.curr_blk = dest;
+ kblock_setDirty(b, true);
+ return 0;
+ }
+ else if (kblock_partialWrite(b))
+ {
+ uint8_t buf[16];
+ size_t blk_size = b->blk_size;
+ size_t offset = 0;
+
+ while (blk_size)
+ {
+ size_t size = MIN(sizeof(buf), blk_size);
+ if (kblock_readDirect(b, src, buf, offset, size) != size)
+ return EOF;
+ if (kblock_writeDirect(b, dest, buf, offset, size) != size)
+ return EOF;
+
+ blk_size -= size;
+ offset += size;
+ }
+ return 0;
+ }
+ else
+ {
+ ASSERT(0);
+ return EOF;
+ }