linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: [PATCH 01/12] readahead: Remove read_cache_pages()
Date: Wed, 30 Mar 2022 15:49:19 +0100	[thread overview]
Message-ID: <20220330144930.315951-2-willy@infradead.org> (raw)
In-Reply-To: <20220330144930.315951-1-willy@infradead.org>

With no remaining users, remove this function and the related
infrastructure.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/pagemap.h |  2 --
 mm/readahead.c          | 76 -----------------------------------------
 2 files changed, 78 deletions(-)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index a8d0b327b066..993994cd943a 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -752,8 +752,6 @@ struct page *read_cache_page(struct address_space *, pgoff_t index,
 		filler_t *filler, void *data);
 extern struct page * read_cache_page_gfp(struct address_space *mapping,
 				pgoff_t index, gfp_t gfp_mask);
-extern int read_cache_pages(struct address_space *mapping,
-		struct list_head *pages, filler_t *filler, void *data);
 
 static inline struct page *read_mapping_page(struct address_space *mapping,
 				pgoff_t index, struct file *file)
diff --git a/mm/readahead.c b/mm/readahead.c
index d3a47546d17d..9097af639beb 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -142,82 +142,6 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
 }
 EXPORT_SYMBOL_GPL(file_ra_state_init);
 
-/*
- * see if a page needs releasing upon read_cache_pages() failure
- * - the caller of read_cache_pages() may have set PG_private or PG_fscache
- *   before calling, such as the NFS fs marking pages that are cached locally
- *   on disk, thus we need to give the fs a chance to clean up in the event of
- *   an error
- */
-static void read_cache_pages_invalidate_page(struct address_space *mapping,
-					     struct page *page)
-{
-	if (page_has_private(page)) {
-		if (!trylock_page(page))
-			BUG();
-		page->mapping = mapping;
-		folio_invalidate(page_folio(page), 0, PAGE_SIZE);
-		page->mapping = NULL;
-		unlock_page(page);
-	}
-	put_page(page);
-}
-
-/*
- * release a list of pages, invalidating them first if need be
- */
-static void read_cache_pages_invalidate_pages(struct address_space *mapping,
-					      struct list_head *pages)
-{
-	struct page *victim;
-
-	while (!list_empty(pages)) {
-		victim = lru_to_page(pages);
-		list_del(&victim->lru);
-		read_cache_pages_invalidate_page(mapping, victim);
-	}
-}
-
-/**
- * read_cache_pages - populate an address space with some pages & start reads against them
- * @mapping: the address_space
- * @pages: The address of a list_head which contains the target pages.  These
- *   pages have their ->index populated and are otherwise uninitialised.
- * @filler: callback routine for filling a single page.
- * @data: private data for the callback routine.
- *
- * Hides the details of the LRU cache etc from the filesystems.
- *
- * Returns: %0 on success, error return by @filler otherwise
- */
-int read_cache_pages(struct address_space *mapping, struct list_head *pages,
-			int (*filler)(void *, struct page *), void *data)
-{
-	struct page *page;
-	int ret = 0;
-
-	while (!list_empty(pages)) {
-		page = lru_to_page(pages);
-		list_del(&page->lru);
-		if (add_to_page_cache_lru(page, mapping, page->index,
-				readahead_gfp_mask(mapping))) {
-			read_cache_pages_invalidate_page(mapping, page);
-			continue;
-		}
-		put_page(page);
-
-		ret = filler(data, page);
-		if (unlikely(ret)) {
-			read_cache_pages_invalidate_pages(mapping, pages);
-			break;
-		}
-		task_io_account_read(PAGE_SIZE);
-	}
-	return ret;
-}
-
-EXPORT_SYMBOL(read_cache_pages);
-
 static void read_pages(struct readahead_control *rac, struct list_head *pages,
 		bool skip_page)
 {
-- 
2.34.1


  reply	other threads:[~2022-03-30 14:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 14:49 [PATCH 00/12] Additional patches for 5.18 Matthew Wilcox (Oracle)
2022-03-30 14:49 ` Matthew Wilcox (Oracle) [this message]
2022-03-30 14:51   ` [PATCH 01/12] readahead: Remove read_cache_pages() Christoph Hellwig
2022-03-30 14:49 ` [PATCH 02/12] fs: Remove ->readpages address space operation Matthew Wilcox (Oracle)
2022-03-30 14:51   ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 03/12] iomap: Simplify is_partially_uptodate a little Matthew Wilcox (Oracle)
2022-03-30 14:52   ` Christoph Hellwig
2022-03-30 16:00     ` Matthew Wilcox
2022-03-31 12:33       ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 04/12] fs: Remove read_actor_t Matthew Wilcox (Oracle)
2022-03-30 14:52   ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 05/12] fs, net: Move read_descriptor_t to net.h Matthew Wilcox (Oracle)
2022-03-30 14:52   ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 06/12] fs: Pass an iocb to generic_perform_write() Matthew Wilcox (Oracle)
2022-03-30 14:49 ` [PATCH 07/12] filemap: Remove AOP_FLAG_CONT_EXPAND Matthew Wilcox (Oracle)
2022-03-30 14:52   ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 08/12] ext4: Correct ext4_journalled_dirty_folio() conversion Matthew Wilcox (Oracle)
2022-03-30 14:53   ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 09/12] f2fs: Correct f2fs_dirty_data_folio() conversion Matthew Wilcox (Oracle)
2022-03-30 14:53   ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 10/12] f2fs: Get the superblock from the mapping instead of the page Matthew Wilcox (Oracle)
2022-03-30 14:49 ` [PATCH 11/12] ntfs: Correct mark_ntfs_record_dirty() folio conversion Matthew Wilcox (Oracle)
2022-03-30 14:53   ` Christoph Hellwig
2022-03-30 14:49 ` [PATCH 12/12] btrfs: Remove a use of PAGE_SIZE in btrfs_invalidate_folio() Matthew Wilcox (Oracle)
2022-03-30 14:53   ` Christoph Hellwig
2022-03-31 12:35 ` [PATCH 13/12] mm: remove the pages argument to read_pages Christoph Hellwig
2022-03-31 13:50   ` Matthew Wilcox
2022-03-31 12:35 ` [PATCH 14/12] mm: remove the skip_page " Christoph Hellwig
2022-03-31 23:32 ` [PATCH 00/12] Additional patches for 5.18 Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220330144930.315951-2-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).