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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E7BDC433B4 for ; Fri, 9 Apr 2021 09:09:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3078A611BE for ; Fri, 9 Apr 2021 09:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232674AbhDIJJa (ORCPT ); Fri, 9 Apr 2021 05:09:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41459 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232470AbhDIJJa (ORCPT ); Fri, 9 Apr 2021 05:09:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617959357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=t4HrPUNe1C2/eoGUl35UTxwdBVeab2D940Ztg0ThcXw=; b=jVA6JXZoEM9wkcd0KGGOA2q8+u3ycuhjyKPPI83v5T4gw2E90JgWNAk0B8KWrlLfkpzGEV 2BhI9Us1zj1aE/WIdhMJ8BFJSmYU6QHWzB6j0Dbux8BKQFgOJTogITZXVYnDeg7Lzo4+Yi 8jp89GJQ1EQrRKdl+w16BFzlN9Yt0TA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-DWcyR59bPNm8maj44EYDXw-1; Fri, 09 Apr 2021 05:09:15 -0400 X-MC-Unique: DWcyR59bPNm8maj44EYDXw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 455B9107ACC7; Fri, 9 Apr 2021 09:09:13 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-119-35.rdu2.redhat.com [10.10.119.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 529765D9E3; Fri, 9 Apr 2021 09:09:06 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <161789062190.6155.12711584466338493050.stgit@warthog.procyon.org.uk> <161789064740.6155.11932541175173658065.stgit@warthog.procyon.org.uk> To: Al Viro Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, "Matthew Wilcox (Oracle)" , Christoph Hellwig , linux-mm@kvack.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Jeff Layton , David Wysochanski , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 01/30] iov_iter: Add ITER_XARRAY MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <289824.1617959345.1@warthog.procyon.org.uk> Date: Fri, 09 Apr 2021 10:09:05 +0100 Message-ID: <289825.1617959345@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Al Viro wrote: > > +#define iterate_all_kinds(i, n, v, I, B, K, X) { \ > > Do you have any users that would pass different B and X? > > > @@ -1440,7 +1665,7 @@ ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, > > return v.bv_len; > > }),({ > > return -EFAULT; > > - }) > > + }), 0 > > Correction - users that might get that flavour. This one explicitly checks > for xarray and doesn't get to iterate_... in that case. This is the case for iterate_all_kinds(), but not for iterate_and_advance(). See _copy_mc_to_iter() for example: that can return directly out of the middle of the loop, so the X variant must drop the rcu_read_lock(), but the B variant doesn't need to. You also can't just use break to get out as the X variant has a loop within a loop to handle iteration over the subelements of a THP. But with iterate_all_kinds(), I could just drop the X parameter and use the B parameter for both, I think. David