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 32A3FC6379F for ; Tue, 17 Jan 2023 07:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235620AbjAQHzQ (ORCPT ); Tue, 17 Jan 2023 02:55:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235457AbjAQHzP (ORCPT ); Tue, 17 Jan 2023 02:55:15 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CE9F12F10; Mon, 16 Jan 2023 23:55:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tgCjPXZFRRY4U5M39+VA82RbzFcfXvKIe9LgETkZp/M=; b=daFNcSbOIYK0jdtwJF4dvqi+Cz sq9lGDnRVCMCvOT3snc5ultyZrXmRkgdSjpdIj0V+kMSUYaWkrYS3cb9cnAbi9sYygG9tBS2Hqeoc PWDEvYLF0sFdxN+9hB0Ujnk4jrZOYPA2V5QhZSg8D00FOiDlKdqr5lXo75Qs4m7hW1Gh1Eeku44KZ zsB0RQ3ahRJq7JAEIeMb06dppOTAziVrldpKAALG8/7R+0z4anqO1z/0jlU7PFIpqiIbDRY5yjxY7 doEQeKgw/QMF8lU8yHyEEWiXzVHYKcbAgKIjbY9GxorO8Qg6VNwZotrPgkzIEkARRB50nzhDS8Z3M Qca2vnYg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHgoG-00DFpG-R7; Tue, 17 Jan 2023 07:55:08 +0000 Date: Mon, 16 Jan 2023 23:55:08 -0800 From: Christoph Hellwig To: David Howells Cc: Al Viro , Christoph Hellwig , 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: <167391049698.2311931.13641162904441620555.stgit@warthog.procyon.org.uk> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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).