]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: update some folio related comments
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 21 Jan 2025 05:40:50 +0000 (05:40 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Mar 2025 13:44:42 +0000 (14:44 +0100)
Remove references to the page lock and page->mapping.  Also btrfs folios
can never be swizzled into swap (mentioned in extent_write_cache_pages()).

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/subpage.c

index b2fae67f8fa3425bc6a1c14d30e1136d2ab87a0d..112bf48c218c4553ee8a3064c1a9e644d42cb480 100644 (file)
@@ -2192,10 +2192,8 @@ retry:
                        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);
@@ -3233,7 +3231,7 @@ out:
        }
        /*
         * 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);
 
index 2a6cddabdd86f3781bcd39cb66032696e11a8c74..b32112c50707021a812f131f8563bc483aba0847 100644 (file)
@@ -2896,7 +2896,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));
index 722acf768396ea8c818c130324fa61bdd00bb852..6a8636c0ffed551ecb4d4149d7174bb4176dbf21 100644 (file)
@@ -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)))