Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4973074rwi; Mon, 17 Oct 2022 13:31:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nCH5hmV2qsktl6TmjJMrbbuHz8tDELjYHhPCPrwzkZxarT9GOlnB5HtrA6v3s4hdoO+Jm X-Received: by 2002:a05:6402:4302:b0:45d:c9b4:c007 with SMTP id m2-20020a056402430200b0045dc9b4c007mr1348773edc.328.1666038698597; Mon, 17 Oct 2022 13:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666038698; cv=none; d=google.com; s=arc-20160816; b=jm4uE7MECNvtmWBBTugW9mwev4zt84s8IhP52wOf6HWTxY7KXLtwZ/O+QF5R343VeO F1/vEidVXvHZ/dIFqBXZEpgjQLUJ+vFFBUmMmmKXk/8Z+e5D47x02E+I4pEv5986jJ33 CbRHBFMHRCV2xTHrinEzaPbYpqQ0j/HTpxlXJDbej2hTHnZcR2w9OXph8+lS6sUiOYEs 56ikzNizNBtxqIzZRqwURluMZM30nj8Or6ryt/ilNvisvjBYq3/53MSxkh+/C8X11lIv /P6QZN4KQMifiaKh4nxu5IqmHLeOAyTHj9cQAk1ACX/zRyOelIrd5qRRG5NC5oNiw4oz bVjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uFc4CQLspR/Ieyg1375xMFBigqFCNsd92Gu75fIF35o=; b=tD1lwpEIDkFc2735UuJisBAJorIe0IbAc5y1uSIMmP9y/6Vhxwbvxds7NPsCvfVmwo OUVb0P1Aqo8Nimti4vXqwL5lb6s0/AKDGmFvmy++6WgjkYt4pPoLPZ5BEPMDqohf/zhG r95EODnBAbBoa/9fN9l/dydaD759lGj2BbNpAsDlpK9GS9z/LgPJlrtuEKEOXie+Vk1u NuqyIm6M5pocF5qsDM2hOrg5ijIakcpVuaJ/Wb4FfN1+zMZ9JDdlNnAXhdJKzBLhPDnz eivIhEbFxh48CZt5bdTbzbUjmt7iHODqbxOoqPySZfZF9Lsjf9gJEqFFKux9FAUC7+ds LtYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E2HrY593; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz13-20020a0564021d4d00b00458db439f07si11429128edb.14.2022.10.17.13.31.11; Mon, 17 Oct 2022 13:31:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E2HrY593; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbiJQU3P (ORCPT + 99 others); Mon, 17 Oct 2022 16:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231277AbiJQU1I (ORCPT ); Mon, 17 Oct 2022 16:27:08 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F49E7F0A8; Mon, 17 Oct 2022 13:26:08 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id y8so12098851pfp.13; Mon, 17 Oct 2022 13:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uFc4CQLspR/Ieyg1375xMFBigqFCNsd92Gu75fIF35o=; b=E2HrY593yhwBzKPuOHKDhfi7y0nx9yb5fVLhengIBmZ32w3tOZyumhviSaH5sejg6d cXIbW2kBAlqCzMIuFNALX410/lKWAaVyF/nPC+box19yMoAf45T8bwJvOot6q/x2bZo9 BWkaNTXy4/u7sIhcqFgjXMyziDNGnBPaOAkMC+I0A3f5atFA1gL+cBgYrRLHgSu4FbXR rmn0/zR4OQ1idgzRTlVeLxmGLfK+2zxyPHFFtwszyNI0ipZywzpx/Iy1Xgs26j64wa+a oMjuQUet9ZqqLrnd5wLntdj6lh+4K4G85SYoxS+pr0LF7K0Xj8Jv+ifbo1jiVJEiEW1q TnCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uFc4CQLspR/Ieyg1375xMFBigqFCNsd92Gu75fIF35o=; b=ETRVubRFuP0H63c4A1GMY1Skx8MFHc6vVjhZ1BZRKsumHI18RZe11KL82DiGODZW4+ /rmglViiTh1Hkb+bvZgHDRi7hHVfHU9BIE4V8glfNl0S3J2N7WsM8k2tfekhIsthLMpS 4sTVYH6ho3eXjWAx52cT/rR0ggB2qsIDnztrRkRXluxBGHWDjsu9MHSfKW+d6w1KhMKq OST4CIpa45UPBnTNDE6VZFlyPxFdNjijFrDtJ7qtpygKFY6ciVwv7hTgXW8vgjOacOoI 7tzvQvjU87Ve1gKBJ816eOl7VuvlGurf1Was4wKAk4csS9+K2n05oOS3Y/SSEA/+i3kz FthQ== X-Gm-Message-State: ACrzQf0+g5FEJSjkqfEQ6KoxzeswP5ZEEenJFD0nlkDLPCNBgronQ3yO Zs/+s63bQtN6uM86w73ugIopfdATAqOcpA== X-Received: by 2002:a05:6a00:8cc:b0:52c:7ab5:2ce7 with SMTP id s12-20020a056a0008cc00b0052c7ab52ce7mr14226045pfu.28.1666038318537; Mon, 17 Oct 2022 13:25:18 -0700 (PDT) Received: from vmfolio.. (c-76-102-73-225.hsd1.ca.comcast.net. [76.102.73.225]) by smtp.googlemail.com with ESMTPSA id pj12-20020a17090b4f4c00b00200b12f2bf5sm145037pjb.1.2022.10.17.13.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 13:25:18 -0700 (PDT) From: "Vishal Moola (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nilfs@vger.kernel.org, linux-mm@kvack.org, "Vishal Moola (Oracle)" Subject: [PATCH v3 23/23] filemap: Remove find_get_pages_range_tag() Date: Mon, 17 Oct 2022 13:24:51 -0700 Message-Id: <20221017202451.4951-24-vishal.moola@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221017202451.4951-1-vishal.moola@gmail.com> References: <20221017202451.4951-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org All callers to find_get_pages_range_tag(), find_get_pages_tag(), pagevec_lookup_range_tag(), and pagevec_lookup_tag() have been removed. Signed-off-by: Vishal Moola (Oracle) --- include/linux/pagemap.h | 10 ------- include/linux/pagevec.h | 8 ------ mm/filemap.c | 60 ----------------------------------------- mm/swap.c | 10 ------- 4 files changed, 88 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 28275eecb949..c83dfcbc19b3 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -742,16 +742,6 @@ unsigned filemap_get_folios_contig(struct address_space *mapping, pgoff_t *start, pgoff_t end, struct folio_batch *fbatch); unsigned filemap_get_folios_tag(struct address_space *mapping, pgoff_t *start, pgoff_t end, xa_mark_t tag, struct folio_batch *fbatch); -unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index, - pgoff_t end, xa_mark_t tag, unsigned int nr_pages, - struct page **pages); -static inline unsigned find_get_pages_tag(struct address_space *mapping, - pgoff_t *index, xa_mark_t tag, unsigned int nr_pages, - struct page **pages) -{ - return find_get_pages_range_tag(mapping, index, (pgoff_t)-1, tag, - nr_pages, pages); -} struct page *grab_cache_page_write_begin(struct address_space *mapping, pgoff_t index); diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index 215eb6c3bdc9..a520632297ac 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h @@ -26,14 +26,6 @@ struct pagevec { }; void __pagevec_release(struct pagevec *pvec); -unsigned pagevec_lookup_range_tag(struct pagevec *pvec, - struct address_space *mapping, pgoff_t *index, pgoff_t end, - xa_mark_t tag); -static inline unsigned pagevec_lookup_tag(struct pagevec *pvec, - struct address_space *mapping, pgoff_t *index, xa_mark_t tag) -{ - return pagevec_lookup_range_tag(pvec, mapping, index, (pgoff_t)-1, tag); -} static inline void pagevec_init(struct pagevec *pvec) { diff --git a/mm/filemap.c b/mm/filemap.c index d78d62a7e44a..f303b8bd7dfa 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2317,66 +2317,6 @@ unsigned filemap_get_folios_tag(struct address_space *mapping, pgoff_t *start, } EXPORT_SYMBOL(filemap_get_folios_tag); -/** - * find_get_pages_range_tag - Find and return head pages matching @tag. - * @mapping: the address_space to search - * @index: the starting page index - * @end: The final page index (inclusive) - * @tag: the tag index - * @nr_pages: the maximum number of pages - * @pages: where the resulting pages are placed - * - * Like find_get_pages_range(), except we only return head pages which are - * tagged with @tag. @index is updated to the index immediately after the - * last page we return, ready for the next iteration. - * - * Return: the number of pages which were found. - */ -unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index, - pgoff_t end, xa_mark_t tag, unsigned int nr_pages, - struct page **pages) -{ - XA_STATE(xas, &mapping->i_pages, *index); - struct folio *folio; - unsigned ret = 0; - - if (unlikely(!nr_pages)) - return 0; - - rcu_read_lock(); - while ((folio = find_get_entry(&xas, end, tag))) { - /* - * Shadow entries should never be tagged, but this iteration - * is lockless so there is a window for page reclaim to evict - * a page we saw tagged. Skip over it. - */ - if (xa_is_value(folio)) - continue; - - pages[ret] = &folio->page; - if (++ret == nr_pages) { - *index = folio->index + folio_nr_pages(folio); - goto out; - } - } - - /* - * We come here when we got to @end. We take care to not overflow the - * index @index as it confuses some of the callers. This breaks the - * iteration when there is a page at index -1 but that is already - * broken anyway. - */ - if (end == (pgoff_t)-1) - *index = (pgoff_t)-1; - else - *index = end + 1; -out: - rcu_read_unlock(); - - return ret; -} -EXPORT_SYMBOL(find_get_pages_range_tag); - /* * CD/DVDs are error prone. When a medium error occurs, the driver may fail * a _large_ part of the i/o request. Imagine the worst scenario: diff --git a/mm/swap.c b/mm/swap.c index 955930f41d20..89351b6dd149 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1098,16 +1098,6 @@ void folio_batch_remove_exceptionals(struct folio_batch *fbatch) fbatch->nr = j; } -unsigned pagevec_lookup_range_tag(struct pagevec *pvec, - struct address_space *mapping, pgoff_t *index, pgoff_t end, - xa_mark_t tag) -{ - pvec->nr = find_get_pages_range_tag(mapping, index, end, tag, - PAGEVEC_SIZE, pvec->pages); - return pagevec_count(pvec); -} -EXPORT_SYMBOL(pagevec_lookup_range_tag); - /* * Perform any setup for the swap system */ -- 2.36.1