Lines Matching refs:request
100 struct nbd_request request;
103 request.type = NBD_CMD_READ;
104 request.handle = (uint64_t)(intptr_t)bs;
105 request.from = sector_num * 512;;
106 request.len = nb_sectors * 512;
108 if (nbd_send_request(s->sock, &request) == -1)
117 if (reply.handle != request.handle)
120 if (nbd_wr_sync(s->sock, buf, request.len, 1) != request.len)
130 struct nbd_request request;
133 request.type = NBD_CMD_WRITE;
134 request.handle = (uint64_t)(intptr_t)bs;
135 request.from = sector_num * 512;;
136 request.len = nb_sectors * 512;
138 if (nbd_send_request(s->sock, &request) == -1)
141 if (nbd_wr_sync(s->sock, (uint8_t*)buf, request.len, 0) != request.len)
150 if (reply.handle != request.handle)
159 struct nbd_request request;
161 request.type = NBD_CMD_DISC;
162 request.handle = (uint64_t)(intptr_t)bs;
163 request.from = 0;
164 request.len = 0;
165 nbd_send_request(s->sock, &request);