btrfs: rename EXTENT_BUFFER_NO_CHECK to EXTENT_BUFFER_ZONED_ZEROOUT
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Thu, 23 Nov 2023 15:47:15 +0000 (07:47 -0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 19:27:02 +0000 (20:27 +0100)
EXTENT_BUFFER_ZONED_ZEROOUT better describes the state of the extent buffer,
namely it is written as all zeros. This is needed in zoned mode, to
preserve I/O ordering.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/zoned.c

index 17ec983ea6727ce2376da1df1401642cafd62f51..21c7835b46eca47a76fe35ee56fd3e0045946c6e 100644 (file)
@@ -254,7 +254,7 @@ blk_status_t btree_csum_one_bio(struct btrfs_bio *bbio)
        if (WARN_ON_ONCE(bbio->bio.bi_iter.bi_size != eb->len))
                return BLK_STS_IOERR;
 
-       if (test_bit(EXTENT_BUFFER_NO_CHECK, &eb->bflags)) {
+       if (test_bit(EXTENT_BUFFER_ZONED_ZEROOUT, &eb->bflags)) {
                WARN_ON_ONCE(found_start != 0);
                return BLK_STS_OK;
        }
index 01423670bc8a2b5aba840a98687d6cec84a166b9..1f48c7eb233ee92132da5c9136e50665185cd612 100644 (file)
@@ -5061,7 +5061,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
        __btrfs_tree_lock(buf, nest);
        btrfs_clear_buffer_dirty(trans, buf);
        clear_bit(EXTENT_BUFFER_STALE, &buf->bflags);
-       clear_bit(EXTENT_BUFFER_NO_CHECK, &buf->bflags);
+       clear_bit(EXTENT_BUFFER_ZONED_ZEROOUT, &buf->bflags);
 
        set_extent_buffer_uptodate(buf);
 
index d68626d1c286aa408771751240fedd569d1a6d62..85cee54200ce41bcb3273dd373f3c16a6a01b09f 100644 (file)
@@ -4152,7 +4152,7 @@ static void __write_extent_buffer(const struct extent_buffer *eb,
        /* For unmapped (dummy) ebs, no need to check their uptodate status. */
        const bool check_uptodate = !test_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags);
 
-       WARN_ON(test_bit(EXTENT_BUFFER_NO_CHECK, &eb->bflags));
+       WARN_ON(test_bit(EXTENT_BUFFER_ZONED_ZEROOUT, &eb->bflags));
 
        if (check_eb_range(eb, start, len))
                return;
index 8eac8384b24c09debd357b703e36d5d14283fd74..021040b3117e365552b9d0aa4d6a39a0dc97e5ba 100644 (file)
@@ -28,7 +28,8 @@ enum {
        EXTENT_BUFFER_IN_TREE,
        /* write IO error */
        EXTENT_BUFFER_WRITE_ERR,
-       EXTENT_BUFFER_NO_CHECK,
+       /* Indicate the extent buffer is written zeroed out (for zoned) */
+       EXTENT_BUFFER_ZONED_ZEROOUT,
        /* Indicate that extent buffer pages a being read */
        EXTENT_BUFFER_READING,
 };
index 830f0b6ec89e96de1265d7feab6b2ef9d2bb10cf..f1bcf2ac618011e027b2a047300ff7f0e0ae43f2 100644 (file)
@@ -1716,7 +1716,7 @@ void btrfs_redirty_list_add(struct btrfs_transaction *trans,
        ASSERT(!test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags));
 
        memzero_extent_buffer(eb, 0, eb->len);
-       set_bit(EXTENT_BUFFER_NO_CHECK, &eb->bflags);
+       set_bit(EXTENT_BUFFER_ZONED_ZEROOUT, &eb->bflags);
        set_extent_buffer_dirty(eb);
        set_extent_bit(&trans->dirty_pages, eb->start, eb->start + eb->len - 1,
                        EXTENT_DIRTY, NULL);