/* Description: Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask contains __GFP_WAIT, the allocation is guaranteed to succeed.  */
struct bio* bio_kmalloc(gfp_t gfp_mask, int nr_iovecs)
/* Description: Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask contains __GFP_WAIT, the allocation is guaranteed to succeed.  */
struct bio* bio_kmalloc(gfp_t gfp_mask, int nr_iovecs)
{
	struct bio *bio;
	bio = kmalloc(sizeof(struct bio) + nr_iovecs * sizeof(struct bio_vec),
		      gfp_mask);
	if (unlikely(!bio))
		return NULL;
	bio_init(bio);
	bio->bi_flags |= BIO_POOL_NONE << BIO_POOL_OFFSET;
	bio->bi_max_vecs = nr_iovecs;
	bio->bi_io_vec = bio->bi_inline_vecs;
	bio->bi_destructor = bio_kmalloc_destructor;
	return bio;
}