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 2DB10C32793 for ; Wed, 18 Jan 2023 22:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjARWTS (ORCPT ); Wed, 18 Jan 2023 17:19:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbjARWTH (ORCPT ); Wed, 18 Jan 2023 17:19: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 71BBA65EE0; Wed, 18 Jan 2023 14:19:02 -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=afuJng7oPx7uuacLqACHC95XAapdL6M+Vp9I11Mjg/c=; b=P94xXEwVLF+0g3HlNxc3bGIzfh z2kHnyswepqw17ESp0zp12Fr/epS2ALte+qk7FXKrlOnaUK4+NItHlBs/RvoU7jWpjnUYwkIPk+Hw 3/DM1+54lHP82PB85J+GdtJ8pQQyMBnsV8dYnwbw2RRtDbyHoBVt93UPeuyXG+6cvH2JEeKttZYdL oLIIi4jQBdYrqjHm/0F2ykrks+lDZr5grzRFv8+rTt2qxD/XORjJz++MmWGTgFIjpSehhojHTA+82 GQBd02LTe7Dg1qLRuhKd+0/Y5P5RdWgCxCQEVUUlh4Eip5lEq0L+vFQdxZQGpP8k8SvCMRpPyctPJ uncilvcQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pIGlh-002d3w-11; Wed, 18 Jan 2023 22:18:53 +0000 Date: Wed, 18 Jan 2023 22:18:53 +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 Subject: Re: [PATCH v6 02/34] iov_iter: Use IOCB/IOMAP_WRITE/op_is_write rather than iterator direction Message-ID: References: <167391047703.2311931.8115712773222260073.stgit@warthog.procyon.org.uk> <167391049698.2311931.13641162904441620555.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:55:08PM -0800, Christoph Hellwig wrote: > On Mon, Jan 16, 2023 at 11:08:17PM +0000, David Howells wrote: > > Use information other than the iterator direction to determine the > > direction of the I/O: > > > > (*) If a kiocb is available, use the IOCB_WRITE flag. > > > > (*) If an iomap_iter is available, use the IOMAP_WRITE flag. > > > > (*) If a request is available, use op_is_write(). > > The really should be three independent patches. Plus another one > to drop the debug checks in cifs. > > The changes themselves look good to me. > > > > > +static unsigned char iov_iter_rw(const struct iov_iter *i) > > +{ > > + return i->data_source ? WRITE : READ; > > +} > > It might as well make sense to just open code this in the only > caller as well (yet another patch). Especially since /* if it's a destination, tell g-u-p we want them writable */ if (!i->data_source) gup_flags |= FOLL_WRITE; is less confusing than the current if (iov_iter_rw(i) != WRITE) gup_flags |= FOLL_WRITE;