search for: rq_data_dir

Displaying 20 results from an estimated 124 matches for "rq_data_dir".

2018 May 31
2
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
...wei.w.wang at intel.com> > Subject: Re: [PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands > support > > On Tue, May 29, 2018 at 09:42:24AM +0800, Changpeng Liu wrote: > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > if (num) { > > - if (rq_data_dir(req) == WRITE) > > + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD > || > > + type == VIRTIO_BLK_T_WRITE_ZEROES) > > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > VIRTIO_BLK_T_OUT); > > The VIRTIO specification says: > > T...
2018 May 31
2
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
...wei.w.wang at intel.com> > Subject: Re: [PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands > support > > On Tue, May 29, 2018 at 09:42:24AM +0800, Changpeng Liu wrote: > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > if (num) { > > - if (rq_data_dir(req) == WRITE) > > + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD > || > > + type == VIRTIO_BLK_T_WRITE_ZEROES) > > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > VIRTIO_BLK_T_OUT); > > The VIRTIO specification says: > > T...
2018 May 29
2
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
..._ctx *hctx, blk_mq_start_request(req); + if (type == VIRTIO_BLK_T_DISCARD || type == VIRTIO_BLK_T_WRITE_ZEROES) { + err = virtblk_setup_discard_write_zeroes(req, unmap); + if (err) + return BLK_STS_RESOURCE; + } + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); if (num) { - if (rq_data_dir(req) == WRITE) + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD || + type == VIRTIO_BLK_T_WRITE_ZEROES) vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); else vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); @@ -777,6 +...
2018 May 29
2
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
..._ctx *hctx, blk_mq_start_request(req); + if (type == VIRTIO_BLK_T_DISCARD || type == VIRTIO_BLK_T_WRITE_ZEROES) { + err = virtblk_setup_discard_write_zeroes(req, unmap); + if (err) + return BLK_STS_RESOURCE; + } + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); if (num) { - if (rq_data_dir(req) == WRITE) + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD || + type == VIRTIO_BLK_T_WRITE_ZEROES) vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); else vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); @@ -777,6 +...
2018 Jun 01
0
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
...t; Subject: Re: [PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands > > support > > > > On Tue, May 29, 2018 at 09:42:24AM +0800, Changpeng Liu wrote: > > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > > if (num) { > > > - if (rq_data_dir(req) == WRITE) > > > + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD > > || > > > + type == VIRTIO_BLK_T_WRITE_ZEROES) > > > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > > VIRTIO_BLK_T_OUT); > > > > The VIRTIO...
2018 Jun 07
2
[PATCH v6] virtio_blk: add DISCARD and WRIET ZEROES commands support
...pe == > VIRTIO_BLK_T_WRITE_ZEROES) { > > + err = virtblk_setup_discard_write_zeroes(req, unmap); > > + if (err) > > + return BLK_STS_RESOURCE; > > + } > > + > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > if (num) { > > if (rq_data_dir(req) == WRITE) > > ...since we still do blk_rq_map_sg() here and num should be != 0. No, while here, we should keep the original logic for READ/WRITE commands.
2018 Jun 07
2
[PATCH v6] virtio_blk: add DISCARD and WRIET ZEROES commands support
...pe == > VIRTIO_BLK_T_WRITE_ZEROES) { > > + err = virtblk_setup_discard_write_zeroes(req, unmap); > > + if (err) > > + return BLK_STS_RESOURCE; > > + } > > + > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > if (num) { > > if (rq_data_dir(req) == WRITE) > > ...since we still do blk_rq_map_sg() here and num should be != 0. No, while here, we should keep the original logic for READ/WRITE commands.
2017 Jul 05
3
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...1,15 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx, blk_mq_start_request(req); + if (type == VIRTIO_BLK_T_DISCARD) { + err = virtblk_setup_discard(req); + if (err) + return BLK_STS_IOERR; + } + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); if (num) { - if (rq_data_dir(req) == WRITE) + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD) vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); else vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); @@ -767,6 +818,25 @@ static int virtblk_probe(struct vi...
2017 Jul 05
3
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...1,15 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx, blk_mq_start_request(req); + if (type == VIRTIO_BLK_T_DISCARD) { + err = virtblk_setup_discard(req); + if (err) + return BLK_STS_IOERR; + } + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); if (num) { - if (rq_data_dir(req) == WRITE) + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD) vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); else vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); @@ -767,6 +818,25 @@ static int virtblk_probe(struct vi...
2018 Jun 04
2
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
...rtio_blk: add DISCARD and WRIET ZEROES commands > > > support > > > > > > On Tue, May 29, 2018 at 09:42:24AM +0800, Changpeng Liu wrote: > > > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > > > if (num) { > > > > - if (rq_data_dir(req) == WRITE) > > > > + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD > > > || > > > > + type == VIRTIO_BLK_T_WRITE_ZEROES) > > > > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > > > VIRTIO_BLK_T_OUT); > &...
2018 Jun 04
2
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
...rtio_blk: add DISCARD and WRIET ZEROES commands > > > support > > > > > > On Tue, May 29, 2018 at 09:42:24AM +0800, Changpeng Liu wrote: > > > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > > > if (num) { > > > > - if (rq_data_dir(req) == WRITE) > > > > + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD > > > || > > > > + type == VIRTIO_BLK_T_WRITE_ZEROES) > > > > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > > > VIRTIO_BLK_T_OUT); > &...
2017 Mar 28
6
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...->vdev, blk_rq_pos(req)); - vbr->out_hdr.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); + vbr->out_hdr.u.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); blk_mq_start_request(req); - num = blk_rq_map_sg(hctx->queue, req, vbr->sg); - if (num) { - if (rq_data_dir(req) == WRITE) - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); - else - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); + if (type == VIRTIO_BLK_T_DISCARD) { + vbr->out_hdr.u.discard_nr_sectors = cpu_to_virtio32(vblk->vdev, +...
2017 Mar 28
6
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...->vdev, blk_rq_pos(req)); - vbr->out_hdr.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); + vbr->out_hdr.u.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); blk_mq_start_request(req); - num = blk_rq_map_sg(hctx->queue, req, vbr->sg); - if (num) { - if (rq_data_dir(req) == WRITE) - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); - else - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); + if (type == VIRTIO_BLK_T_DISCARD) { + vbr->out_hdr.u.discard_nr_sectors = cpu_to_virtio32(vblk->vdev, +...
2017 Mar 28
1
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...tio32(vblk->vdev, req_get_ioprio(req)); > > + vbr->out_hdr.u.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); > > > > blk_mq_start_request(req); > > > > - num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > - if (num) { > > - if (rq_data_dir(req) == WRITE) > > - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > VIRTIO_BLK_T_OUT); > > - else > > - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > VIRTIO_BLK_T_IN); > > + if (type == VIRTIO_BLK_T_DISCARD) { > > + vbr->out_hdr.u.di...
2017 Mar 28
1
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...tio32(vblk->vdev, req_get_ioprio(req)); > > + vbr->out_hdr.u.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); > > > > blk_mq_start_request(req); > > > > - num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > - if (num) { > > - if (rq_data_dir(req) == WRITE) > > - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > VIRTIO_BLK_T_OUT); > > - else > > - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, > VIRTIO_BLK_T_IN); > > + if (type == VIRTIO_BLK_T_DISCARD) { > > + vbr->out_hdr.u.di...
2018 Jun 11
1
[PATCH v6] virtio_blk: add DISCARD and WRIET ZEROES commands support
...up_discard_write_zeroes(req, unmap); > > > > + if (err) > > > > + return BLK_STS_RESOURCE; > > > > + } > > > > + > > > > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > > > if (num) { > > > > if (rq_data_dir(req) == WRITE) > > > > > > ...since we still do blk_rq_map_sg() here and num should be != 0. > > No, while here, we should keep the original logic for READ/WRITE commands. > > My question is: why does the changelog say "don't set T_OUT" but the > code...
2018 May 31
0
[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support
On Tue, May 29, 2018 at 09:42:24AM +0800, Changpeng Liu wrote: > num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > if (num) { > - if (rq_data_dir(req) == WRITE) > + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD || > + type == VIRTIO_BLK_T_WRITE_ZEROES) > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); The VIRTIO specification says: The type of the request is either a read (VIRT...
2018 Mar 30
2
[PATCH v3] virtio_blk: add DISCARD and WRIET ZEROES command support
..._hw_ctx *hctx, blk_mq_start_request(req); + if (type == VIRTIO_BLK_T_DISCARD || type == VIRTIO_BLK_T_WRITE_ZEROES) { + err = virtblk_setup_discard_write_zeroes(req, unmap); + if (err) + return BLK_STS_IOERR; + } + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); if (num) { - if (rq_data_dir(req) == WRITE) + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD || + type == VIRTIO_BLK_T_WRITE_ZEROES) vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); else vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); @@ -777,6 +...
2018 Mar 30
2
[PATCH v3] virtio_blk: add DISCARD and WRIET ZEROES command support
..._hw_ctx *hctx, blk_mq_start_request(req); + if (type == VIRTIO_BLK_T_DISCARD || type == VIRTIO_BLK_T_WRITE_ZEROES) { + err = virtblk_setup_discard_write_zeroes(req, unmap); + if (err) + return BLK_STS_IOERR; + } + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); if (num) { - if (rq_data_dir(req) == WRITE) + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD || + type == VIRTIO_BLK_T_WRITE_ZEROES) vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); else vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); @@ -777,6 +...
2017 Mar 27
0
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...>out_hdr.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); > + vbr->out_hdr.u.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(req)); > > blk_mq_start_request(req); > > - num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > - if (num) { > - if (rq_data_dir(req) == WRITE) > - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_OUT); > - else > - vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_IN); > + if (type == VIRTIO_BLK_T_DISCARD) { > + vbr->out_hdr.u.discard_nr_sectors = cpu_to_virtio32(...