linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cifs: convert to add_to_page_cache()
@ 2020-10-19 18:59 Kent Overstreet
  2020-10-19 18:59 ` [PATCH 2/2] fs: kill add_to_page_cache_locked() Kent Overstreet
  2020-10-20  7:58 ` [PATCH 1/2] cifs: convert to add_to_page_cache() Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Kent Overstreet @ 2020-10-19 18:59 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, akpm, sfrench, linux-cifs; +Cc: Kent Overstreet

This is just open coding add_to_page_cache(), and the next patch will
delete add_to_page_cache_locked().

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
---
 fs/cifs/file.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index be46fab4c9..a17a21181e 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -4296,20 +4296,12 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list,
 
 	page = lru_to_page(page_list);
 
-	/*
-	 * Lock the page and put it in the cache. Since no one else
-	 * should have access to this page, we're safe to simply set
-	 * PG_locked without checking it first.
-	 */
-	__SetPageLocked(page);
-	rc = add_to_page_cache_locked(page, mapping,
-				      page->index, gfp);
+	rc = add_to_page_cache(page, mapping,
+			       page->index, gfp);
 
 	/* give up if we can't stick it in the cache */
-	if (rc) {
-		__ClearPageLocked(page);
+	if (rc)
 		return rc;
-	}
 
 	/* move first page to the tmplist */
 	*offset = (loff_t)page->index << PAGE_SHIFT;
@@ -4328,12 +4320,9 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list,
 		if (*bytes + PAGE_SIZE > rsize)
 			break;
 
-		__SetPageLocked(page);
-		rc = add_to_page_cache_locked(page, mapping, page->index, gfp);
-		if (rc) {
-			__ClearPageLocked(page);
+		rc = add_to_page_cache(page, mapping, page->index, gfp);
+		if (rc)
 			break;
-		}
 		list_move_tail(&page->lru, tmplist);
 		(*bytes) += PAGE_SIZE;
 		expected_index++;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-21  9:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-19 18:59 [PATCH 1/2] cifs: convert to add_to_page_cache() Kent Overstreet
2020-10-19 18:59 ` [PATCH 2/2] fs: kill add_to_page_cache_locked() Kent Overstreet
2020-10-19 19:12   ` Matthew Wilcox
2020-10-21  9:24   ` [fs] 8e602a0a70: kernel_BUG_at_mm/filemap.c kernel test robot
2020-10-20  7:58 ` [PATCH 1/2] cifs: convert to add_to_page_cache() Christoph Hellwig
2020-10-20 17:08   ` Steve French

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).