]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: centralize setting REQ_META
authorChristoph Hellwig <hch@lst.de>
Thu, 26 May 2022 07:36:39 +0000 (09:36 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:33 +0000 (17:45 +0200)
Set REQ_META in btrfs_submit_metadata_bio instead of the various callers.
We'll start relying on this flag inside of btrfs in a bit, and this
ensures it is always set correctly.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c

index ea32627139b04f90e2c87e537529a4e4d3ce561b..a085cd95ef12ef4ddb0532d2dd571d56565ff823 100644 (file)
@@ -914,6 +914,8 @@ void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_
        struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
        blk_status_t ret;
 
+       bio->bi_opf |= REQ_META;
+
        if (btrfs_op(bio) != BTRFS_MAP_WRITE) {
                /*
                 * called for a read, do the setup so that checksum validation
index 47407e6bb91e50e95e26fc1657c70319444936b3..d7059a48cefcabc7cf328c9b693e85a6192ea566 100644 (file)
@@ -4567,7 +4567,7 @@ static int write_one_subpage_eb(struct extent_buffer *eb,
 {
        struct btrfs_fs_info *fs_info = eb->fs_info;
        struct page *page = eb->pages[0];
-       unsigned int write_flags = wbc_to_write_flags(wbc) | REQ_META;
+       unsigned int write_flags = wbc_to_write_flags(wbc);
        bool no_dirty_ebs = false;
        int ret;
 
@@ -4612,7 +4612,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
 {
        u64 disk_bytenr = eb->start;
        int i, num_pages;
-       unsigned int write_flags = wbc_to_write_flags(wbc) | REQ_META;
+       unsigned int write_flags = wbc_to_write_flags(wbc);
        int ret = 0;
 
        prepare_eb_write(eb);
@@ -6630,7 +6630,7 @@ static int read_extent_buffer_subpage(struct extent_buffer *eb, int wait,
        btrfs_subpage_clear_error(fs_info, page, eb->start, eb->len);
 
        btrfs_subpage_start_reader(fs_info, page, eb->start, eb->len);
-       ret = submit_extent_page(REQ_OP_READ | REQ_META, NULL, &bio_ctrl,
+       ret = submit_extent_page(REQ_OP_READ, NULL, &bio_ctrl,
                                 page, eb->start, eb->len,
                                 eb->start - page_offset(page),
                                 end_bio_extent_readpage, mirror_num, 0,
@@ -6737,7 +6737,7 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int wait, int mirror_num)
                        }
 
                        ClearPageError(page);
-                       err = submit_extent_page(REQ_OP_READ | REQ_META, NULL,
+                       err = submit_extent_page(REQ_OP_READ, NULL,
                                         &bio_ctrl, page, page_offset(page),
                                         PAGE_SIZE, 0, end_bio_extent_readpage,
                                         mirror_num, 0, false);