]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: remove folio_test_ordered() usage
authorQu Wenruo <wqu@suse.com>
Thu, 7 May 2026 05:29:20 +0000 (14:59 +0930)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Jun 2026 13:53:32 +0000 (15:53 +0200)
This involves:

- The ASSERT() inside end_bbio_data_write()
  It's only an ASSERT() and it has never been triggered as far as I
  know.

- btrfs_migrate_folio()
  Since all folio_test_ordered() usage will be removed, there is no need to
  copy the folio ordered flag.

- The ASSERT() inside btrfs_invalidate_folio()
  This one has its usefulness as it indeed caught some bugs during
  development.
  But that's the last user and will not be worth the folio flag or the
  subpage bitmap.

This will allow btrfs to finally remove the ordered flags.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/inode.c

index 9593996bfff43303f5e7e8f6b73b787429c6ba2b..231a73b5489c0a241289ba5095ad28fcc97747fa 100644 (file)
@@ -530,7 +530,6 @@ static void end_bbio_data_write(struct btrfs_bio *bbio)
                u32 len = fi.length;
 
                bio_size += len;
-               ASSERT(btrfs_folio_test_ordered(fs_info, folio, start, len));
                btrfs_folio_clear_ordered(fs_info, folio, start, len);
                btrfs_folio_clear_writeback(fs_info, folio, start, len);
        }
index 76923c28a243a4d747fc231e774ec66f066c5ac2..e72ea6ea7d959147fd6dddbdbb517e6e912024cd 100644 (file)
@@ -7499,12 +7499,6 @@ static int btrfs_migrate_folio(struct address_space *mapping,
 
        if (ret)
                return ret;
-
-       if (folio_test_ordered(src)) {
-               folio_clear_ordered(src);
-               folio_set_ordered(dst);
-       }
-
        return 0;
 }
 #else
@@ -7672,12 +7666,6 @@ next:
        }
        btrfs_folio_clear_dirty(fs_info, folio, page_start, folio_size(folio));
        btrfs_clear_folio_dirty_tag(folio);
-       /*
-        * We have iterated through all ordered extents of the page, the page
-        * should not have Ordered anymore, or the above iteration
-        * did something wrong.
-        */
-       ASSERT(!folio_test_ordered(folio));
        if (!inode_evicting)
                __btrfs_release_folio(folio, GFP_NOFS);
        clear_folio_extent_mapped(folio);