Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13798483rwl; Wed, 4 Jan 2023 13:17:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXuxxieElDjuqdH2M4NmFdUa+04UEsS+ApvqRQDKQoqekOFCz40E92KcJXyLCBOEtQsXNxtm X-Received: by 2002:a05:6a21:398a:b0:af:d52a:2dde with SMTP id ad10-20020a056a21398a00b000afd52a2ddemr62143137pzc.18.1672867021445; Wed, 04 Jan 2023 13:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672867021; cv=none; d=google.com; s=arc-20160816; b=uJRkok6Mt7Nx4mOQCkV/2dHeQ9whQtcBGaCg4LV/s4dOmIvCY/UzHc8vWkS9DpSUGQ YncmmaG4k+R7sPkcx8BR4BwKJB4n3JSyKU0rEQlvIvJpVorRRnfkcQTMmT5zc8SER3tP WMratVa3tcWbDcNordymPZy+btzQ5aXxF1kmEtJGPdF4ugviTgZBdvzI5rU9Xmz5ZqQP /kBExZ2tbB8gwXnVy4wIvprDP/cGpU7XQoi5St/Q4lB/oaNtYA/uYeks6JmOphWh13hB W6kbssaTKqAXeHXj9z/dGY0HMd7tCO/0LWofMHuCsdiPwQ4uy9/pd2s8okp7EXXG8qSu gccg== 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=4RtaC30O7Atkln5EkUr8a2iVlJILm+qXX7isWy43phI=; b=kxXTcp13GQCqgd7TJEriG1EQMOJuYshrb2kkasaksu74BCMMdZff6HtT1HTps0Ms10 Pqm5vDsl7XQdaoozVv/NqMyg8XNXQN7YhJ9D8n+BR3nXUVTTBHlHikB9/5XF362SzQmL 2lys++SKxyuqR1g+SUT88jf/DvFp0aLYSZj30Slth5k1aUc9BqFFPIria+uXgs5f5MBm ZTyJY6h3ZBQ18BoZaMSUF40mXVybA8ZDv3nTenXB77CSY5bHcotHw4GHCM/2wTSLW/QS igE7zkwkWm5l3SXspBGUk3N4TUJuwaPUIH78mrATjTg3XsM/6kkPf2qAiUgg7PRcexR5 p0Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dI7AOinQ; 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 n1-20020a63b441000000b004a2e20a1682si9612646pgu.95.2023.01.04.13.16.46; Wed, 04 Jan 2023 13:17:01 -0800 (PST) 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=dI7AOinQ; 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 S240683AbjADVQM (ORCPT + 99 others); Wed, 4 Jan 2023 16:16:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240363AbjADVPa (ORCPT ); Wed, 4 Jan 2023 16:15:30 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C23191B9DA; Wed, 4 Jan 2023 13:15:29 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id c6so3996382pls.4; Wed, 04 Jan 2023 13:15:29 -0800 (PST) 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=4RtaC30O7Atkln5EkUr8a2iVlJILm+qXX7isWy43phI=; b=dI7AOinQpZsTE8QFnkWx5x7pHBIx2GIKp/y/hPSc1NHAIhQSCV/YW9CIK9cZelspMz /UcbMNCeprdqj2GgjwjFWFax2vwmTS97zF8XvJynP1ckPDpwGdDlfgcvFL/67PrZtHoe 8p3Tw9Jon6YIgT2dQef0u6QzS5v45L3ZduPZ7Vuz5T+efr2+eM/L19V2q4WYQQWenBXe r/FJhL2oCKug1uqMTJTCUDKbhH4a7abWBWe80Bzb0hil6lc0QxeilyS7fU95p9sAo3Hd 5RiIKFAfe4YEQeX4Nw8KbDxJ6n6FANkPiGgIF3O5WGmAPzm6MuSYa4JZ31MPUbzgC2kF JUOQ== 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=4RtaC30O7Atkln5EkUr8a2iVlJILm+qXX7isWy43phI=; b=4Ere80a/DWT8+c83zXS1MqaWBoXiCRfyqo881LN9+OTMIUUdKZ6iqX1hKl52eDVZZb JMOi5I7BX/1nFGy9Rn9G2TwSm0pI9cSj391OdaRmSP0B+SYcsfyKcUWlRXGUqF8MgC/u yqn7bD2v2NCA/zshchAPAP/IslErQnVhQxn/jkS95DBUr5Wk2f++pFUCVc0pQqM7JW88 sBD5XGtEJuRxaQzzOOHG0I15pcZ3YEvbVlHe8vF1Dy2MgeublQNm/qMoewPZx41A+x/x 0RNfLqgCqg7vTP20oP13gE22oiQcgYiAx79aMT2G1+2p/Wtogf81tUZD9LZI4RcIoxvI H7Fw== X-Gm-Message-State: AFqh2kqTliGqIwupH/VvrZw3rZWLDoDcCq2ZxyhOcTo5sAKBubT7kntQ EU7EFPgXW0ZJlNfUo1rgqKB6HFJxjXje+g== X-Received: by 2002:a17:90a:ab8d:b0:226:7efc:989b with SMTP id n13-20020a17090aab8d00b002267efc989bmr10104588pjq.49.1672866929215; Wed, 04 Jan 2023 13:15:29 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::a55d]) by smtp.googlemail.com with ESMTPSA id i8-20020a17090a138800b00226369149cesm6408pja.21.2023.01.04.13.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 13:15:28 -0800 (PST) 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 v5 23/23] filemap: Remove find_get_pages_range_tag() Date: Wed, 4 Jan 2023 13:14:48 -0800 Message-Id: <20230104211448.4804-24-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104211448.4804-1-vishal.moola@gmail.com> References: <20230104211448.4804-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 bb3c1d51b1cb..9f1081683771 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -741,16 +741,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 85adbcf2d9a7..31bf18ec6d01 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2337,66 +2337,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 70e2063ef43a..5f20ba07d46b 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1119,16 +1119,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.38.1