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 19E5CC63797 for ; Tue, 17 Jan 2023 08:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235878AbjAQICK (ORCPT ); Tue, 17 Jan 2023 03:02:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235771AbjAQICH (ORCPT ); Tue, 17 Jan 2023 03:02:07 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B16636E95; Tue, 17 Jan 2023 00:02:06 -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=cmVV6xRQmaK0l4HRL/lhH4XySz+BO5RzfEmX6d+cJZM=; b=KLeqLLx0NC+cXLbPhHSUJXvm/7 R/nl/8FixpSCZgHfNJHIPElbnFHiIR85J0mANjkPduyvsnh1TOci2q3m71cXS3BTbn0rB7Cz89ZKR QJAkNO6pNAybiWH/mXlGOEdMFq76IoX3V3FwiGVTg4NHWsFd/mnXxJ25MuAMbuJ7LQ+p227fBxOR3 Un7EcKwFO+MI7nMp+e4NwGZ0ykdgaaqkKmYEVm7lp8JJsaj7uZsVdxh3ZYbuzZKlGAOlGi3wAv6H9 sZsf0ybxabL89GqyzG8JI9EW8On10C7w0tMsJWtBI0gBakel51gCmn+QjxRoDvc2+FTWOhTth9ZBN b7LOBerA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHgut-00DGYh-Be; Tue, 17 Jan 2023 08:01:59 +0000 Date: Tue, 17 Jan 2023 00:01:59 -0800 From: Christoph Hellwig To: David Howells Cc: Al Viro , Christoph Hellwig , John Hubbard , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 07/34] iov_iter: Add a function to extract a page list from an iterator Message-ID: References: <167391047703.2311931.8115712773222260073.stgit@warthog.procyon.org.uk> <167391053207.2311931.16398133457201442907.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <167391053207.2311931.16398133457201442907.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-block@vger.kernel.org > Changes: > ======== > ver #6) > - Add back the function to indicate the cleanup mode. > - Drop the cleanup_mode return arg to iov_iter_extract_pages(). > - Pass FOLL_SOURCE/DEST_BUF in gup_flags. Check this against the iter > data_source. FYI, the changelog goes after the --- so that it doesn't get added to the git history. > Link: https://lore.kernel.org/r/166732025748.3186319.8314014902727092626.stgit@warthog.procyon.org.uk/ # rfc > Link: https://lore.kernel.org/r/166869689451.3723671.18242195992447653092.stgit@warthog.procyon.org.uk/ # rfc > Link: https://lore.kernel.org/r/166920903885.1461876.692029808682876184.stgit@warthog.procyon.org.uk/ # v2 > Link: https://lore.kernel.org/r/166997421646.9475.14837976344157464997.stgit@warthog.procyon.org.uk/ # v3 > Link: https://lore.kernel.org/r/167305163883.1521586.10777155475378874823.stgit@warthog.procyon.org.uk/ # v4 > Link: https://lore.kernel.org/r/167344728530.2425628.9613910866466387722.stgit@warthog.procyon.org.uk/ # v5 And all these links aren't exactly useful. This fairly trivial commit is going to look like a hot mess in git. > +ssize_t iov_iter_extract_pages(struct iov_iter *i, struct page ***pages, > + size_t maxsize, unsigned int maxpages, > + unsigned int gup_flags, size_t *offset0); This function isn't actually added in the current patch. > +#define iov_iter_extract_mode(iter, gup_flags) \ > + (user_backed_iter(iter) ? \ > + (gup_flags & FOLL_BUF_MASK) == FOLL_SOURCE_BUF ? \ > + FOLL_GET : FOLL_PIN : 0) And inline function would be nice here. I guess that would require moving the FULL flags into mm_types.h, though.