]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: Switch from using the private_2 flag to owner_2
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 2 Oct 2024 04:01:06 +0000 (05:01 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 4 Oct 2024 07:24:25 +0000 (09:24 +0200)
We are close to removing the private_2 flag, so switch btrfs to using
owner_2 for its ordered flag.  This is mostly used by buffer head
filesystems, so btrfs can use it because it doesn't use buffer heads.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20241002040111.1023018-5-willy@infradead.org
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/btrfs/ordered-data.c

index 317a3712270fc05799f20595f11c28b7db4a0a79..307dedf95c7066d7df6f01aa41b5a20b8a639bf5 100644 (file)
@@ -744,16 +744,11 @@ const char *btrfs_super_csum_driver(u16 csum_type);
 size_t __attribute_const__ btrfs_get_num_csums(void);
 
 /*
- * We use page status Private2 to indicate there is an ordered extent with
+ * We use folio flag owner_2 to indicate there is an ordered extent with
  * unfinished IO.
- *
- * Rename the Private2 accessors to Ordered, to improve readability.
  */
-#define PageOrdered(page)              PagePrivate2(page)
-#define SetPageOrdered(page)           SetPagePrivate2(page)
-#define ClearPageOrdered(page)         ClearPagePrivate2(page)
-#define folio_test_ordered(folio)      folio_test_private_2(folio)
-#define folio_set_ordered(folio)       folio_set_private_2(folio)
-#define folio_clear_ordered(folio)     folio_clear_private_2(folio)
+#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 edac499fd83d29181f8374b4f505cd177ded7018..a4055896261db649c0a4009a7215a3a86de3e522 100644 (file)
@@ -1513,7 +1513,7 @@ static noinline int cow_file_range(struct btrfs_inode *inode,
                 * (which the caller expects to stay locked), don't clear any
                 * dirty bits and don't set any writeback bits
                 *
-                * Do set the Ordered (Private2) bit so we know this page was
+                * Do set the Ordered flag so we know this page was
                 * properly setup for writepage.
                 */
                page_ops = (keep_locked ? 0 : PAGE_UNLOCK);
@@ -7292,7 +7292,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
         *
         * But already submitted bio can still be finished on this folio.
         * Furthermore, endio function won't skip folio which has Ordered
-        * (Private2) already cleared, so it's possible for endio and
+        * already cleared, so it's possible for endio and
         * invalidate_folio to do the same ordered extent accounting twice
         * on one folio.
         *
@@ -7358,7 +7358,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
                range_len = range_end + 1 - cur;
                if (!btrfs_folio_test_ordered(fs_info, folio, cur, range_len)) {
                        /*
-                        * If Ordered (Private2) is cleared, it means endio has
+                        * If Ordered is cleared, it means endio has
                         * already been executed for the range.
                         * We can't delete the extent states as
                         * btrfs_finish_ordered_io() may still use some of them.
@@ -7431,7 +7431,7 @@ next:
        }
        /*
         * We have iterated through all ordered extents of the page, the page
-        * should not have Ordered (Private2) anymore, or the above iteration
+        * should not have Ordered anymore, or the above iteration
         * did something wrong.
         */
        ASSERT(!folio_test_ordered(folio));
index 2104d60c216166d577ef81750c63167248f33b6a..95c8499a159a3b6e0b84c39f57279cf3496d0607 100644 (file)
@@ -346,10 +346,10 @@ static bool can_finish_ordered_extent(struct btrfs_ordered_extent *ordered,
                ASSERT(file_offset + len <= folio_pos(folio) + folio_size(folio));
 
                /*
-                * Ordered (Private2) bit indicates whether we still have
+                * Ordered flag indicates whether we still have
                 * pending io unfinished for the ordered extent.
                 *
-                * If there's no such bit, we need to skip to next range.
+                * If it's not set, we need to skip to next range.
                 */
                if (!btrfs_folio_test_ordered(fs_info, folio, file_offset, len))
                        return false;