Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-05 Thread Baolin Wang
On 3 June 2016 at 22:35, Jens Axboe wrote: > On 05/27/2016 05:11 AM, Baolin Wang wrote: >> >> In dm-crypt, it need to map one bio to scatterlist for improving the >> hardware engine encryption efficiency. Thus this patch introduces the >> blk_bio_map_sg() function to map one bio

Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-05 Thread Baolin Wang
On 3 June 2016 at 22:35, Jens Axboe wrote: > On 05/27/2016 05:11 AM, Baolin Wang wrote: >> >> In dm-crypt, it need to map one bio to scatterlist for improving the >> hardware engine encryption efficiency. Thus this patch introduces the >> blk_bio_map_sg() function to map one bio with

Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-05 Thread Baolin Wang
On 3 June 2016 at 22:38, Jens Axboe wrote: > On 05/27/2016 05:11 AM, Baolin Wang wrote: >> >> +/* >> + * Map a bio to scatterlist, return number of sg entries setup. Caller >> must >> + * make sure sg can hold bio segments entries. >> + */ >> +int blk_bio_map_sg(struct

Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-05 Thread Baolin Wang
On 3 June 2016 at 22:38, Jens Axboe wrote: > On 05/27/2016 05:11 AM, Baolin Wang wrote: >> >> +/* >> + * Map a bio to scatterlist, return number of sg entries setup. Caller >> must >> + * make sure sg can hold bio segments entries. >> + */ >> +int blk_bio_map_sg(struct request_queue *q, struct

Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-03 Thread Jens Axboe
On 05/27/2016 05:11 AM, Baolin Wang wrote: In dm-crypt, it need to map one bio to scatterlist for improving the hardware engine encryption efficiency. Thus this patch introduces the blk_bio_map_sg() function to map one bio with scatterlists. For avoiding the duplicated code in

Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-03 Thread Jens Axboe
On 05/27/2016 05:11 AM, Baolin Wang wrote: In dm-crypt, it need to map one bio to scatterlist for improving the hardware engine encryption efficiency. Thus this patch introduces the blk_bio_map_sg() function to map one bio with scatterlists. For avoiding the duplicated code in

Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-03 Thread Jens Axboe
On 05/27/2016 05:11 AM, Baolin Wang wrote: +/* + * Map a bio to scatterlist, return number of sg entries setup. Caller must + * make sure sg can hold bio segments entries. + */ +int blk_bio_map_sg(struct request_queue *q, struct bio *bio, + struct scatterlist *sglist) +{ +

Re: [RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-06-03 Thread Jens Axboe
On 05/27/2016 05:11 AM, Baolin Wang wrote: +/* + * Map a bio to scatterlist, return number of sg entries setup. Caller must + * make sure sg can hold bio segments entries. + */ +int blk_bio_map_sg(struct request_queue *q, struct bio *bio, + struct scatterlist *sglist) +{ +

[RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-05-27 Thread Baolin Wang
In dm-crypt, it need to map one bio to scatterlist for improving the hardware engine encryption efficiency. Thus this patch introduces the blk_bio_map_sg() function to map one bio with scatterlists. For avoiding the duplicated code in __blk_bios_map_sg() function, add one parameter to distinguish

[RFC v2 1/3] block: Introduce blk_bio_map_sg() to map one bio

2016-05-27 Thread Baolin Wang
In dm-crypt, it need to map one bio to scatterlist for improving the hardware engine encryption efficiency. Thus this patch introduces the blk_bio_map_sg() function to map one bio with scatterlists. For avoiding the duplicated code in __blk_bios_map_sg() function, add one parameter to distinguish