search for: discard_nr_sectors

Displaying 5 results from an estimated 5 matches for "discard_nr_sectors".

2017 Mar 28
6
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...x->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, + blk_rq_sectors(req)); + num = 0; + } else { + 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...
2017 Mar 28
6
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...x->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, + blk_rq_sectors(req)); + num = 0; + } else { + 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...
2017 Mar 28
1
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...ir(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, > > + > blk_rq_sectors(req)); > > + num = 0; > > + } else { > > + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > + if (num) { > > + if (rq_data_dir(req) == WRITE) > > + vbr->out_hdr.type |= cpu_to_vi...
2017 Mar 28
1
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...ir(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, > > + > blk_rq_sectors(req)); > > + num = 0; > > + } else { > > + num = blk_rq_map_sg(hctx->queue, req, vbr->sg); > > + if (num) { > > + if (rq_data_dir(req) == WRITE) > > + vbr->out_hdr.type |= cpu_to_vi...
2017 Mar 27
0
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...- 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, > + blk_rq_sectors(req)); > + num = 0; > + } else { > + 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, > +...