Lines Matching refs:req
60 struct request *req;
483 if ((io_req->error == BLK_STS_NOTSUPP) && (req_op(io_req->req) == REQ_OP_DISCARD)) {
484 blk_queue_max_discard_sectors(io_req->req->q, 0);
485 blk_queue_max_write_zeroes_sectors(io_req->req->q, 0);
487 blk_mq_end_request(io_req->req, io_req->error);
1227 static void cowify_req(struct io_thread_req *req, struct io_desc *segment,
1237 if (req_op(req->req) == REQ_OP_READ) {
1251 struct request *req)
1257 enum req_op op = req_op(req);
1261 io_req->io_desc[0].length = blk_rq_bytes(req);
1263 rq_for_each_segment(bvec, req, iter) {
1283 static struct io_thread_req *ubd_alloc_req(struct ubd *dev, struct request *req,
1295 io_req->req = req;
1303 io_req->offset = (u64) blk_rq_pos(req) << SECTOR_SHIFT;
1315 static int ubd_submit_request(struct ubd *dev, struct request *req)
1320 enum req_op op = req_op(req);
1327 segs = blk_rq_nr_phys_segments(req);
1329 io_req = ubd_alloc_req(dev, req, segs);
1335 ubd_map_req(dev, io_req, req);
1350 struct request *req = bd->rq;
1353 blk_mq_start_request(req);
1357 switch (req_op(req)) {
1363 ret = ubd_submit_request(ubd_dev, req);
1451 static int update_bitmap(struct io_thread_req *req, struct io_desc *segment)
1458 n = os_pwrite_file(req->fds[1], &segment->bitmap_words,
1466 static void do_io(struct io_thread_req *req, struct io_desc *desc)
1475 if (req_op(req->req) == REQ_OP_FLUSH) {
1477 req->error = map_error(-os_sync_file(req->fds[0]));
1481 nsectors = desc->length / req->sectorsize;
1490 off = req->offset + req->offsets[bit] +
1491 start * req->sectorsize;
1492 len = (end - start) * req->sectorsize;
1494 buf = &desc->buffer[start * req->sectorsize];
1496 switch (req_op(req->req)) {
1502 n = os_pread_file(req->fds[bit], buf, len, off);
1504 req->error = map_error(-n);
1511 n = os_pwrite_file(req->fds[bit], buf, len, off);
1513 req->error = map_error(-n);
1518 n = os_falloc_punch(req->fds[bit], off, len);
1520 req->error = map_error(-n);
1525 n = os_falloc_zeroes(req->fds[bit], off, len);
1527 req->error = map_error(-n);
1533 req->error = BLK_STS_NOTSUPP;
1540 req->offset += len;
1541 req->error = update_bitmap(req, desc);
1574 struct io_thread_req *req = (*io_req_buffer)[count];
1578 for (i = 0; !req->error && i < req->desc_cnt; i++)
1579 do_io(req, &(req->io_desc[i]));