[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHqX9vbuq=N0LwH25x6fHajy8Q65dyKyKJhJOksKYW1U3YGHZw@mail.gmail.com>
Date: Mon, 4 Jan 2021 18:12:39 +0530
From: Selva Jove <selvajove@...il.com>
To: Damien Le Moal <Damien.LeMoal@....com>
Cc: SelvaKumar S <selvakuma.s1@...sung.com>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"kbusch@...nel.org" <kbusch@...nel.org>,
"axboe@...nel.dk" <axboe@...nel.dk>,
Johannes Thumshirn <Johannes.Thumshirn@....com>,
"hch@....de" <hch@....de>, "sagi@...mberg.me" <sagi@...mberg.me>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"bvanassche@....org" <bvanassche@....org>,
"mpatocka@...hat.com" <mpatocka@...hat.com>,
"hare@...e.de" <hare@...e.de>,
"dm-devel@...hat.com" <dm-devel@...hat.com>,
"snitzer@...hat.com" <snitzer@...hat.com>,
"nj.shetty@...sung.com" <nj.shetty@...sung.com>,
"joshi.k@...sung.com" <joshi.k@...sung.com>,
"javier.gonz@...sung.com" <javier.gonz@...sung.com>
Subject: Re: [RFC PATCH v4 1/3] block: export bio_map_kern()
Thanks Damien, Will update that.
On Mon, Jan 4, 2021 at 5:45 PM Damien Le Moal <Damien.LeMoal@....com> wrote:
>
> On 2021/01/04 19:48, SelvaKumar S wrote:
> > Export bio_map_kern() so that copy offload emulation can use
> > it to add vmalloced memory to bio.
> >
> > Signed-off-by: SelvaKumar S <selvakuma.s1@...sung.com>
> > ---
> > block/blk-map.c | 3 ++-
> > include/linux/blkdev.h | 2 ++
> > 2 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/block/blk-map.c b/block/blk-map.c
> > index 21630dccac62..50d61475bb68 100644
> > --- a/block/blk-map.c
> > +++ b/block/blk-map.c
> > @@ -378,7 +378,7 @@ static void bio_map_kern_endio(struct bio *bio)
> > * Map the kernel address into a bio suitable for io to a block
> > * device. Returns an error pointer in case of error.
> > */
> > -static struct bio *bio_map_kern(struct request_queue *q, void *data,
> > +struct bio *bio_map_kern(struct request_queue *q, void *data,
> > unsigned int len, gfp_t gfp_mask)
> > {
> > unsigned long kaddr = (unsigned long)data;
> > @@ -428,6 +428,7 @@ static struct bio *bio_map_kern(struct request_queue *q, void *data,
> > bio->bi_end_io = bio_map_kern_endio;
> > return bio;
> > }
> > +EXPORT_SYMBOL(bio_map_kern);
>
> Simple copy support is a block layer code, so you I do not think you need this.
> You only need to remove the static declaration of the function.
>
> >
> > static void bio_copy_kern_endio(struct bio *bio)
> > {
> > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> > index 070de09425ad..81f9e7bec16c 100644
> > --- a/include/linux/blkdev.h
> > +++ b/include/linux/blkdev.h
> > @@ -936,6 +936,8 @@ extern int blk_rq_map_user(struct request_queue *, struct request *,
> > struct rq_map_data *, void __user *, unsigned long,
> > gfp_t);
> > extern int blk_rq_unmap_user(struct bio *);
> > +extern struct bio *bio_map_kern(struct request_queue *q, void *data,
> > + unsigned int len, gfp_t gfp_mask);
> > extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
> > extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
> > struct rq_map_data *, const struct iov_iter *,
> >
>
>
> --
> Damien Le Moal
> Western Digital Research
Powered by blists - more mailing lists