]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: convert extent_write_locked_range() to take a folio
authorJosef Bacik <josef@toxicpanda.com>
Wed, 24 Jul 2024 20:31:44 +0000 (16:31 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 10 Sep 2024 14:51:15 +0000 (16:51 +0200)
This mostly uses folios, convert it to take a folio instead and update
the callers to pass in the folio.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c

index a1ba45690635a62365ed242a2c49e747e0de67a8..9ae17c9fd89b20e83736cccc5d616b9118655be6 100644 (file)
@@ -2274,7 +2274,7 @@ retry:
  * already been ran (aka, ordered extent inserted) and all pages are still
  * locked.
  */
-void extent_write_locked_range(struct inode *inode, const struct page *locked_page,
+void extent_write_locked_range(struct inode *inode, const struct folio *locked_folio,
                               u64 start, u64 end, struct writeback_control *wbc,
                               bool pages_dirty)
 {
@@ -2316,7 +2316,7 @@ void extent_write_locked_range(struct inode *inode, const struct page *locked_pa
                }
 
                ASSERT(folio_test_locked(folio));
-               if (pages_dirty && &folio->page != locked_page)
+               if (pages_dirty && folio != locked_folio)
                        ASSERT(folio_test_dirty(folio));
 
                ret = __extent_writepage_io(BTRFS_I(inode), folio, cur, cur_len,
index 5d36031578ff9c2f2e19d807b6c093dffa0b48b5..b38460279b9932e85f98220afc4a930411ec6f3c 100644 (file)
@@ -240,7 +240,7 @@ bool try_release_extent_mapping(struct page *page, gfp_t mask);
 int try_release_extent_buffer(struct page *page);
 
 int btrfs_read_folio(struct file *file, struct folio *folio);
-void extent_write_locked_range(struct inode *inode, const struct page *locked_page,
+void extent_write_locked_range(struct inode *inode, const struct folio *locked_folio,
                               u64 start, u64 end, struct writeback_control *wbc,
                               bool pages_dirty);
 int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc);
index 3dff49ba445374fc4c59a363550229486b8443f7..5761ccc92a448fc0c62855d0777af519ed57b34d 100644 (file)
@@ -1758,7 +1758,8 @@ static noinline int run_delalloc_cow(struct btrfs_inode *inode,
                                     true, false);
                if (ret)
                        return ret;
-               extent_write_locked_range(&inode->vfs_inode, locked_page, start,
+               extent_write_locked_range(&inode->vfs_inode,
+                                         page_folio(locked_page), start,
                                          done_offset, wbc, pages_dirty);
                start = done_offset + 1;
        }