Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-12-04 Thread Jens Axboe
On 12/4/18 7:55 AM, Christoph Hellwig wrote: > On Fri, Nov 30, 2018 at 07:21:02PM +, Al Viro wrote: >> On Fri, Nov 30, 2018 at 09:56:43AM -0700, Jens Axboe wrote: >>> For an ITER_KVEC, we can just iterate the iov and add the pages >>> to the bio directly. >> >>> + page =

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-12-04 Thread Christoph Hellwig
On Fri, Nov 30, 2018 at 07:21:02PM +, Al Viro wrote: > On Fri, Nov 30, 2018 at 09:56:43AM -0700, Jens Axboe wrote: > > For an ITER_KVEC, we can just iterate the iov and add the pages > > to the bio directly. > > > + page = virt_to_page(kv->iov_base); > > + size =

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Jens Axboe
On 11/30/18 2:34 PM, Jens Axboe wrote: > On 11/30/18 2:25 PM, Al Viro wrote: >> On Fri, Nov 30, 2018 at 02:16:38PM -0700, Jens Axboe wrote: > Would this make you happy: > > if (!is_vmalloc_addr(kv->iov_base)) > page = virt_to_page(kv->iov_base); > else >

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Jens Axboe
On 11/30/18 2:25 PM, Al Viro wrote: > On Fri, Nov 30, 2018 at 02:16:38PM -0700, Jens Axboe wrote: Would this make you happy: if (!is_vmalloc_addr(kv->iov_base)) page = virt_to_page(kv->iov_base); else page = vmalloc_to_page(kv->iov_base); >>> >>> Free

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Al Viro
On Fri, Nov 30, 2018 at 02:16:38PM -0700, Jens Axboe wrote: > >> Would this make you happy: > >> > >> if (!is_vmalloc_addr(kv->iov_base)) > >> page = virt_to_page(kv->iov_base); > >> else > >> page = vmalloc_to_page(kv->iov_base); > > > > Free advice: don't ever let Linus see

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Jens Axboe
On 11/30/18 2:11 PM, Al Viro wrote: > On Fri, Nov 30, 2018 at 01:32:21PM -0700, Jens Axboe wrote: >> On 11/30/18 1:15 PM, Jens Axboe wrote: >>> On 11/30/18 12:21 PM, Al Viro wrote: On Fri, Nov 30, 2018 at 09:56:43AM -0700, Jens Axboe wrote: > For an ITER_KVEC, we can just iterate the iov

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Al Viro
On Fri, Nov 30, 2018 at 01:32:21PM -0700, Jens Axboe wrote: > On 11/30/18 1:15 PM, Jens Axboe wrote: > > On 11/30/18 12:21 PM, Al Viro wrote: > >> On Fri, Nov 30, 2018 at 09:56:43AM -0700, Jens Axboe wrote: > >>> For an ITER_KVEC, we can just iterate the iov and add the pages > >>> to the bio

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Jens Axboe
On 11/30/18 1:15 PM, Jens Axboe wrote: > On 11/30/18 12:21 PM, Al Viro wrote: >> On Fri, Nov 30, 2018 at 09:56:43AM -0700, Jens Axboe wrote: >>> For an ITER_KVEC, we can just iterate the iov and add the pages >>> to the bio directly. >> >>> + page = virt_to_page(kv->iov_base); >>> +

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Jens Axboe
On 11/30/18 12:21 PM, Al Viro wrote: > On Fri, Nov 30, 2018 at 09:56:43AM -0700, Jens Axboe wrote: >> For an ITER_KVEC, we can just iterate the iov and add the pages >> to the bio directly. > >> +page = virt_to_page(kv->iov_base); >> +size = bio_add_page(bio, page,

Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Al Viro
On Fri, Nov 30, 2018 at 09:56:43AM -0700, Jens Axboe wrote: > For an ITER_KVEC, we can just iterate the iov and add the pages > to the bio directly. > + page = virt_to_page(kv->iov_base); > + size = bio_add_page(bio, page, kv->iov_len, > +

[PATCH 24/27] block: implement bio helper to add iter kvec pages to bio

2018-11-30 Thread Jens Axboe
For an ITER_KVEC, we can just iterate the iov and add the pages to the bio directly. Signed-off-by: Jens Axboe --- block/bio.c | 30 ++ include/linux/bio.h | 1 + 2 files changed, 31 insertions(+) diff --git a/block/bio.c b/block/bio.c index