static void storeClientFileRead(store_client * sc) { MemObject *mem = sc->entry->mem_obj; assert(sc->new_callback); assert(!sc->flags.disk_io_pending); sc->flags.disk_io_pending = 1; assert(sc->node_ref.node == NULL); /* We should never, ever have a node here; or we'd leak! */ stmemNodeRefCreate(&sc->node_ref); /* Creates an entry with reference count == 1 */ if (mem->swap_hdr_sz == 0) { storeRead(sc->swapin_sio, sc->node_ref.node->data, XMIN(SM_PAGE_SIZE, sc->copy_size), 0, storeClientReadHeader, sc); } else { if (sc->entry->swap_status == SWAPOUT_WRITING) assert(storeSwapOutObjectBytesOnDisk(mem) > sc->copy_offset); /* XXX is this right? Shouldn't we incl. mem->swap_hdr_sz? */ storeRead(sc->swapin_sio, sc->node_ref.node->data, XMIN(SM_PAGE_SIZE, sc->copy_size), sc->copy_offset + mem->swap_hdr_sz, storeClientReadBody, sc); } }
static void storeClientFileRead(store_client * sc) { MemObject *mem = sc->entry->mem_obj; assert(sc->callback != NULL); assert(!sc->flags.disk_io_pending); sc->flags.disk_io_pending = 1; if (mem->swap_hdr_sz == 0) { storeRead(sc->swapin_sio, sc->copy_buf, sc->copy_size, 0, storeClientReadHeader, sc); } else { if (sc->entry->swap_status == SWAPOUT_WRITING) assert(storeSwapOutObjectBytesOnDisk(mem) > sc->copy_offset); storeRead(sc->swapin_sio, sc->copy_buf, sc->copy_size, sc->copy_offset + mem->swap_hdr_sz, storeClientReadBody, sc); } }
static void storeClientFileRead(store_client * sc) { MemObject *mem = sc->entry->mem_obj; assert(sc->callback != NULL); if (mem->swap_hdr_sz == 0) { storeRead(sc->swapin_sio, sc->copy_buf, sc->copy_size, 0, storeClientReadHeader, sc); } else { if (sc->entry->swap_status == SWAPOUT_WRITING) assert(storeOffset(mem->swapout.sio) > sc->copy_offset + mem->swap_hdr_sz); storeRead(sc->swapin_sio, sc->copy_buf, sc->copy_size, sc->copy_offset + mem->swap_hdr_sz, storeClientReadBody, sc); } }