Commit 0f07003b authored by David Sterba's avatar David Sterba

btrfs: rename bio_ctrl::bio_flags to compress_type

The bio_ctrl is the last use of bio_flags that has been converted to
compress type everywhere else.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent cb3a12d9
...@@ -144,7 +144,7 @@ struct tree_entry { ...@@ -144,7 +144,7 @@ struct tree_entry {
*/ */
struct btrfs_bio_ctrl { struct btrfs_bio_ctrl {
struct bio *bio; struct bio *bio;
unsigned long bio_flags; enum btrfs_compression_type compress_type;
u32 len_to_stripe_boundary; u32 len_to_stripe_boundary;
u32 len_to_oe_boundary; u32 len_to_oe_boundary;
}; };
...@@ -3271,10 +3271,10 @@ static int btrfs_bio_add_page(struct btrfs_bio_ctrl *bio_ctrl, ...@@ -3271,10 +3271,10 @@ static int btrfs_bio_add_page(struct btrfs_bio_ctrl *bio_ctrl,
ASSERT(bio); ASSERT(bio);
/* The limit should be calculated when bio_ctrl->bio is allocated */ /* The limit should be calculated when bio_ctrl->bio is allocated */
ASSERT(bio_ctrl->len_to_oe_boundary && bio_ctrl->len_to_stripe_boundary); ASSERT(bio_ctrl->len_to_oe_boundary && bio_ctrl->len_to_stripe_boundary);
if (bio_ctrl->bio_flags != compress_type) if (bio_ctrl->compress_type != compress_type)
return 0; return 0;
if (bio_ctrl->bio_flags != BTRFS_COMPRESS_NONE) if (bio_ctrl->compress_type != BTRFS_COMPRESS_NONE)
contig = bio->bi_iter.bi_sector == sector; contig = bio->bi_iter.bi_sector == sector;
else else
contig = bio_end_sector(bio) == sector; contig = bio_end_sector(bio) == sector;
...@@ -3317,7 +3317,7 @@ static int calc_bio_boundaries(struct btrfs_bio_ctrl *bio_ctrl, ...@@ -3317,7 +3317,7 @@ static int calc_bio_boundaries(struct btrfs_bio_ctrl *bio_ctrl,
* The split happens for real compressed bio, which happens in * The split happens for real compressed bio, which happens in
* btrfs_submit_compressed_read/write(). * btrfs_submit_compressed_read/write().
*/ */
if (bio_ctrl->bio_flags != BTRFS_COMPRESS_NONE) { if (bio_ctrl->compress_type != BTRFS_COMPRESS_NONE) {
bio_ctrl->len_to_oe_boundary = U32_MAX; bio_ctrl->len_to_oe_boundary = U32_MAX;
bio_ctrl->len_to_stripe_boundary = U32_MAX; bio_ctrl->len_to_stripe_boundary = U32_MAX;
return 0; return 0;
...@@ -3376,7 +3376,7 @@ static int alloc_new_bio(struct btrfs_inode *inode, ...@@ -3376,7 +3376,7 @@ static int alloc_new_bio(struct btrfs_inode *inode,
else else
bio->bi_iter.bi_sector = (disk_bytenr + offset) >> SECTOR_SHIFT; bio->bi_iter.bi_sector = (disk_bytenr + offset) >> SECTOR_SHIFT;
bio_ctrl->bio = bio; bio_ctrl->bio = bio;
bio_ctrl->bio_flags = compress_type; bio_ctrl->compress_type = compress_type;
bio->bi_end_io = end_io_func; bio->bi_end_io = end_io_func;
bio->bi_private = &inode->io_tree; bio->bi_private = &inode->io_tree;
bio->bi_opf = opf; bio->bi_opf = opf;
...@@ -3456,7 +3456,7 @@ static int submit_extent_page(unsigned int opf, ...@@ -3456,7 +3456,7 @@ static int submit_extent_page(unsigned int opf,
ASSERT(pg_offset < PAGE_SIZE && size <= PAGE_SIZE && ASSERT(pg_offset < PAGE_SIZE && size <= PAGE_SIZE &&
pg_offset + size <= PAGE_SIZE); pg_offset + size <= PAGE_SIZE);
if (force_bio_submit && bio_ctrl->bio) { if (force_bio_submit && bio_ctrl->bio) {
submit_one_bio(bio_ctrl->bio, mirror_num, bio_ctrl->bio_flags); submit_one_bio(bio_ctrl->bio, mirror_num, bio_ctrl->compress_type);
bio_ctrl->bio = NULL; bio_ctrl->bio = NULL;
} }
...@@ -3498,7 +3498,7 @@ static int submit_extent_page(unsigned int opf, ...@@ -3498,7 +3498,7 @@ static int submit_extent_page(unsigned int opf,
if (added < size - offset) { if (added < size - offset) {
/* The bio should contain some page(s) */ /* The bio should contain some page(s) */
ASSERT(bio_ctrl->bio->bi_iter.bi_size); ASSERT(bio_ctrl->bio->bi_iter.bi_size);
submit_one_bio(bio_ctrl->bio, mirror_num, bio_ctrl->bio_flags); submit_one_bio(bio_ctrl->bio, mirror_num, bio_ctrl->compress_type);
bio_ctrl->bio = NULL; bio_ctrl->bio = NULL;
} }
cur += added; cur += added;
...@@ -3815,7 +3815,7 @@ int btrfs_readpage(struct file *file, struct page *page) ...@@ -3815,7 +3815,7 @@ int btrfs_readpage(struct file *file, struct page *page)
* bio to do the cleanup. * bio to do the cleanup.
*/ */
if (bio_ctrl.bio) if (bio_ctrl.bio)
submit_one_bio(bio_ctrl.bio, 0, bio_ctrl.bio_flags); submit_one_bio(bio_ctrl.bio, 0, bio_ctrl.compress_type);
return ret; return ret;
} }
...@@ -5274,7 +5274,7 @@ void extent_readahead(struct readahead_control *rac) ...@@ -5274,7 +5274,7 @@ void extent_readahead(struct readahead_control *rac)
free_extent_map(em_cached); free_extent_map(em_cached);
if (bio_ctrl.bio) if (bio_ctrl.bio)
submit_one_bio(bio_ctrl.bio, 0, bio_ctrl.bio_flags); submit_one_bio(bio_ctrl.bio, 0, bio_ctrl.compress_type);
} }
/* /*
...@@ -6761,7 +6761,7 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int wait, int mirror_num) ...@@ -6761,7 +6761,7 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int wait, int mirror_num)
} }
if (bio_ctrl.bio) { if (bio_ctrl.bio) {
submit_one_bio(bio_ctrl.bio, mirror_num, bio_ctrl.bio_flags); submit_one_bio(bio_ctrl.bio, mirror_num, bio_ctrl.compress_type);
bio_ctrl.bio = NULL; bio_ctrl.bio = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment