#include #include #include #include #include #include int req_readcopy(struct vfs_request *req, const void *buf, size_t len) { if (!req->caller) return -1; assert(req->type == VFSOP_READ); fs_normslice(&req->offset, &req->output.len, len, false); virt_cpy_to( req->caller->pages, req->output.buf, buf + req->offset, req->output.len); /* read errors are ignored. TODO write a spec */ return req->output.len; }