public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] btrfs: Fix some folio-related comments
@ 2025-01-21  5:40 Matthew Wilcox (Oracle)
  2025-01-21  5:40 ` [PATCH 2/3] btrfs: Fix two misuses of folio_shift() Matthew Wilcox (Oracle)
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Matthew Wilcox (Oracle) @ 2025-01-21  5:40 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: Matthew Wilcox (Oracle), linux-btrfs

Remove references to the page lock and page->mapping.  Also
btrfs folios can never be swizzled into swap.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/btrfs/extent_io.c | 8 +++-----
 fs/btrfs/inode.c     | 2 +-
 fs/btrfs/subpage.c   | 2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index d9f856358704..289ecb8ce217 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2189,10 +2189,8 @@ static int extent_write_cache_pages(struct address_space *mapping,
 			done_index = folio_next_index(folio);
 			/*
 			 * At this point we hold neither the i_pages lock nor
-			 * the page lock: the page may be truncated or
-			 * invalidated (changing page->mapping to NULL),
-			 * or even swizzled back from swapper_space to
-			 * tmpfs file mapping
+			 * the folio lock: the folio may be truncated or
+			 * invalidated (changing folio->mapping to NULL)
 			 */
 			if (!folio_trylock(folio)) {
 				submit_write_bio(bio_ctrl, 0);
@@ -3222,7 +3220,7 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,
 	}
 	/*
 	 * Now all pages of that extent buffer is unmapped, set UNMAPPED flag,
-	 * so it can be cleaned up without utilizing page->mapping.
+	 * so it can be cleaned up without utilizing folio->mapping.
 	 */
 	set_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags);
 
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index fe2c810335ff..e6ea4f172b50 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2891,7 +2891,7 @@ int btrfs_writepage_cow_fixup(struct folio *folio)
 	 * We are already holding a reference to this inode from
 	 * write_cache_pages.  We need to hold it because the space reservation
 	 * takes place outside of the folio lock, and we can't trust
-	 * page->mapping outside of the folio lock.
+	 * folio->mapping outside of the folio lock.
 	 */
 	ihold(inode);
 	btrfs_folio_set_checked(fs_info, folio, folio_pos(folio), folio_size(folio));
diff --git a/fs/btrfs/subpage.c b/fs/btrfs/subpage.c
index 722acf768396..6a8636c0ffed 100644
--- a/fs/btrfs/subpage.c
+++ b/fs/btrfs/subpage.c
@@ -72,7 +72,7 @@ bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, struct address_space
 
 	/*
 	 * Only data pages (either through DIO or compression) can have no
-	 * mapping. And if page->mapping->host is data inode, it's subpage.
+	 * mapping. And if mapping->host is data inode, it's subpage.
 	 * As we have ruled our sectorsize >= PAGE_SIZE case already.
 	 */
 	if (!mapping || !mapping->host || is_data_inode(BTRFS_I(mapping->host)))
-- 
2.45.2


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

end of thread, other threads:[~2025-01-24 21:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21  5:40 [PATCH 1/3] btrfs: Fix some folio-related comments Matthew Wilcox (Oracle)
2025-01-21  5:40 ` [PATCH 2/3] btrfs: Fix two misuses of folio_shift() Matthew Wilcox (Oracle)
2025-01-21  7:21   ` Qu Wenruo
2025-01-21 16:10     ` David Sterba
2025-01-21 17:59       ` Matthew Wilcox
2025-01-22 15:24         ` David Sterba
2025-01-24  6:11           ` Qu Wenruo
2025-01-24 21:49             ` David Sterba
2025-01-21  5:40 ` [PATCH 3/3] btrfs: Convert io_ctl_prepare_pages() to work on folios Matthew Wilcox (Oracle)
2025-01-21  7:22   ` Qu Wenruo
2025-01-21  7:14 ` [PATCH 1/3] btrfs: Fix some folio-related comments Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox