Skip to content

Commit a6752a6

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
btrfs: Switch from using the private_2 flag to owner_2
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) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent a04d5f8 commit a6752a6

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

fs/btrfs/ctree.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -744,16 +744,11 @@ const char *btrfs_super_csum_driver(u16 csum_type);
744744
size_t __attribute_const__ btrfs_get_num_csums(void);
745745

746746
/*
747-
* We use page status Private2 to indicate there is an ordered extent with
747+
* We use folio flag owner_2 to indicate there is an ordered extent with
748748
* unfinished IO.
749-
*
750-
* Rename the Private2 accessors to Ordered, to improve readability.
751749
*/
752-
#define PageOrdered(page) PagePrivate2(page)
753-
#define SetPageOrdered(page) SetPagePrivate2(page)
754-
#define ClearPageOrdered(page) ClearPagePrivate2(page)
755-
#define folio_test_ordered(folio) folio_test_private_2(folio)
756-
#define folio_set_ordered(folio) folio_set_private_2(folio)
757-
#define folio_clear_ordered(folio) folio_clear_private_2(folio)
750+
#define folio_test_ordered(folio) folio_test_owner_2(folio)
751+
#define folio_set_ordered(folio) folio_set_owner_2(folio)
752+
#define folio_clear_ordered(folio) folio_clear_owner_2(folio)
758753

759754
#endif

fs/btrfs/inode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,7 @@ static noinline int cow_file_range(struct btrfs_inode *inode,
15131513
* (which the caller expects to stay locked), don't clear any
15141514
* dirty bits and don't set any writeback bits
15151515
*
1516-
* Do set the Ordered (Private2) bit so we know this page was
1516+
* Do set the Ordered flag so we know this page was
15171517
* properly setup for writepage.
15181518
*/
15191519
page_ops = (keep_locked ? 0 : PAGE_UNLOCK);
@@ -7292,7 +7292,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
72927292
*
72937293
* But already submitted bio can still be finished on this folio.
72947294
* Furthermore, endio function won't skip folio which has Ordered
7295-
* (Private2) already cleared, so it's possible for endio and
7295+
* already cleared, so it's possible for endio and
72967296
* invalidate_folio to do the same ordered extent accounting twice
72977297
* on one folio.
72987298
*
@@ -7358,7 +7358,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
73587358
range_len = range_end + 1 - cur;
73597359
if (!btrfs_folio_test_ordered(fs_info, folio, cur, range_len)) {
73607360
/*
7361-
* If Ordered (Private2) is cleared, it means endio has
7361+
* If Ordered is cleared, it means endio has
73627362
* already been executed for the range.
73637363
* We can't delete the extent states as
73647364
* btrfs_finish_ordered_io() may still use some of them.
@@ -7431,7 +7431,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
74317431
}
74327432
/*
74337433
* We have iterated through all ordered extents of the page, the page
7434-
* should not have Ordered (Private2) anymore, or the above iteration
7434+
* should not have Ordered anymore, or the above iteration
74357435
* did something wrong.
74367436
*/
74377437
ASSERT(!folio_test_ordered(folio));

fs/btrfs/ordered-data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,10 @@ static bool can_finish_ordered_extent(struct btrfs_ordered_extent *ordered,
346346
ASSERT(file_offset + len <= folio_pos(folio) + folio_size(folio));
347347

348348
/*
349-
* Ordered (Private2) bit indicates whether we still have
349+
* Ordered flag indicates whether we still have
350350
* pending io unfinished for the ordered extent.
351351
*
352-
* If there's no such bit, we need to skip to next range.
352+
* If it's not set, we need to skip to next range.
353353
*/
354354
if (!btrfs_folio_test_ordered(fs_info, folio, file_offset, len))
355355
return false;

0 commit comments

Comments
 (0)