From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-f67.google.com ([209.85.166.67]:41448 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725749AbeLAHZm (ORCPT ); Sat, 1 Dec 2018 02:25:42 -0500 Received: by mail-io1-f67.google.com with SMTP id s22so5548029ioc.8 for ; Fri, 30 Nov 2018 12:15:16 -0800 (PST) Subject: Re: [PATCH 26/27] iov_iter: add import_kvec() To: Al Viro Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, hch@lst.de References: <20181130165646.27341-1-axboe@kernel.dk> <20181130165646.27341-27-axboe@kernel.dk> <20181130191747.GO2217@ZenIV.linux.org.uk> From: Jens Axboe Message-ID: Date: Fri, 30 Nov 2018 13:15:13 -0700 MIME-Version: 1.0 In-Reply-To: <20181130191747.GO2217@ZenIV.linux.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 11/30/18 12:17 PM, Al Viro wrote: > On Fri, Nov 30, 2018 at 09:56:45AM -0700, Jens Axboe wrote: >> This explicitly sets up an ITER_KVEC from an iovec with kernel ranges >> mapped. > >> +int import_kvec(int type, const struct kvec *kvecs, unsigned nr_segs, >> + size_t bytes, struct iov_iter *iter) >> +{ >> + const struct iovec *p = (const struct iovec *) kvecs; >> + >> + iov_iter_init_type(iter, ITER_KVEC, type, p, nr_segs, bytes); >> + return 0; >> +} > > What the hell is wrong with existing iov_iter_kvec()? Hah, looks like I overlooked that. Not sure how anyone could look at lib/iov_iter.c and not get lost in the beauty of it. -- Jens Axboe