search for: virtblk_setup_discard

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

2017 Jul 05
3
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...virtio_blk.c index 0297ad7..8f0c614 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr, return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); } +static inline int virtblk_setup_discard(struct request *req) +{ + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0; + u32 block_size = queue_logical_block_size(req->q); + struct virtio_blk_discard *range; + struct bio *bio; + + if (block_size < 512 || !block_size) + return -1; + + range = kmalloc_array(segments, si...
2017 Jul 05
3
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...virtio_blk.c index 0297ad7..8f0c614 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr, return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); } +static inline int virtblk_setup_discard(struct request *req) +{ + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0; + u32 block_size = queue_logical_block_size(req->q); + struct virtio_blk_discard *range; + struct bio *bio; + + if (block_size < 512 || !block_size) + return -1; + + range = kmalloc_array(segments, si...
2017 Jul 04
0
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...100644 > --- a/drivers/block/virtio_blk.c > +++ b/drivers/block/virtio_blk.c > @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr, > return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); > } > > +static inline int virtblk_setup_discard(struct request *req) > +{ > + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0; > + u32 block_size = queue_logical_block_size(req->q); > + struct virtio_blk_discard *range; > + struct bio *bio; > + > + if (block_size < 512 || !block_size) > + return -1...
2017 Jul 05
2
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...virtio_blk.c > > +++ b/drivers/block/virtio_blk.c > > @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct > virtblk_req *vbr, > > return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); > > } > > > > +static inline int virtblk_setup_discard(struct request *req) > > +{ > > + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0; > > + u32 block_size = queue_logical_block_size(req->q); > > + struct virtio_blk_discard *range; > > + struct bio *bio; > > + > > + if (block_size < 51...
2017 Jul 05
2
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...virtio_blk.c > > +++ b/drivers/block/virtio_blk.c > > @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct > virtblk_req *vbr, > > return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); > > } > > > > +static inline int virtblk_setup_discard(struct request *req) > > +{ > > + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0; > > + u32 block_size = queue_logical_block_size(req->q); > > + struct virtio_blk_discard *range; > > + struct bio *bio; > > + > > + if (block_size < 51...