From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D940FC32793 for ; Wed, 18 Jan 2023 23:04:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229469AbjARXEJ (ORCPT ); Wed, 18 Jan 2023 18:04:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjARXEH (ORCPT ); Wed, 18 Jan 2023 18:04:07 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2853A305FB; Wed, 18 Jan 2023 15:04:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6dWUI5icFFmxxhB3zoj79O8xUzc1bN/i/tm3I5lQXJU=; b=WNX9/lZWP0n5ceC+COxrRxCY4i LIqiQjw7YxNsyy1dUOy+TIz40RbUuU8Qpm7ExiMRbW9kMprvytFCmxy1qCSdRVQiEbZe/JQulm4Mx Fndvm/lYebesmLUJQyC3icibaC2llpY1Eclokrn2LYyw8X7P6jVqnZNdYchgJSDPVvtBVfEKyfSJA Z6IKyctzuqiXpiJ1JrKvG3ZYmxxxdlPNdCNGm+oku9+2OKQ9TiA6kgQv5zVnqR1H5o0yFce5bx9On jbiD7OjO6mehbLyuuNYzA8V9nQlLJLAmAPD6YehSe6lYAvUlK3BBS0ptGZDE2vMhulB7C2K+Zkr5P kA6Qw52Q==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pIHTE-002dMI-1h; Wed, 18 Jan 2023 23:03:52 +0000 Date: Wed, 18 Jan 2023 23:03:52 +0000 From: Al Viro To: Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , David Hildenbrand Subject: Re: [PATCH v6 03/34] iov_iter: Pass I/O direction into iov_iter_get_pages*() Message-ID: References: <167391047703.2311931.8115712773222260073.stgit@warthog.procyon.org.uk> <167391050409.2311931.7103784292954267373.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Jan 16, 2023 at 11:57:08PM -0800, Christoph Hellwig wrote: > On Mon, Jan 16, 2023 at 11:08:24PM +0000, David Howells wrote: > > Define FOLL_SOURCE_BUF and FOLL_DEST_BUF to indicate to get_user_pages*() > > and iov_iter_get_pages*() how the buffer is intended to be used in an I/O > > operation. Don't use READ and WRITE as a read I/O writes to memory and > > vice versa - which causes confusion. > > > > The direction is checked against the iterator's data_source. > > Why can't we use the existing FOLL_WRITE? I'm really not fond of passing FOLL_... stuff into iov_iter primitives. That space contains things like FOLL_PIN, which makes no sense whatsoever for non-user-backed iterators; having the callers pass it in makes them automatically dependent upon the iov_iter flavour.