btrfs: move the folio ordered helpers from ctree.h into fs.h
authorFilipe Manana <fdmanana@suse.com>
Mon, 16 Dec 2024 12:58:09 +0000 (12:58 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Jan 2025 13:53:17 +0000 (14:53 +0100)
The folio ordered helper macros are defined at ctree.h but this is not
the best place since ctree.{h,c} is all about the btree data structure
implementation and not a generic module. So move these macros into the
fs.h header.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/fs.h

index a1bab0b3f1930867288f51f761971be7915a2131..3d9855d30057f05de2758472cd27e488fec0adb5 100644 (file)
@@ -756,12 +756,4 @@ static inline bool btrfs_is_data_reloc_root(const struct btrfs_root *root)
        return root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID;
 }
 
-/*
- * We use folio flag owner_2 to indicate there is an ordered extent with
- * unfinished IO.
- */
-#define folio_test_ordered(folio)      folio_test_owner_2(folio)
-#define folio_set_ordered(folio)       folio_set_owner_2(folio)
-#define folio_clear_ordered(folio)     folio_clear_owner_2(folio)
-
 #endif
index 15c26c6f4d6e4ce45b48607a42df1c64baf88fc2..7a27f5fe9bc2aaac0f4408353bac4eac051f0a1d 100644 (file)
@@ -1066,6 +1066,14 @@ static inline void btrfs_wake_unfinished_drop(struct btrfs_fs_info *fs_info)
        (unlikely(test_bit(BTRFS_FS_STATE_LOG_CLEANUP_ERROR,            \
                           &(fs_info)->fs_state)))
 
+/*
+ * We use folio flag owner_2 to indicate there is an ordered extent with
+ * unfinished IO.
+ */
+#define folio_test_ordered(folio)      folio_test_owner_2(folio)
+#define folio_set_ordered(folio)       folio_set_owner_2(folio)
+#define folio_clear_ordered(folio)     folio_clear_owner_2(folio)
+
 #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
 
 #define EXPORT_FOR_TESTS