@@ -178,7 +178,8 @@ static int add_extent_changeset(struct extent_state *state, u32 bits,
178
178
return ret ;
179
179
}
180
180
181
- static void submit_one_bio (struct bio * bio , int mirror_num , unsigned long bio_flags )
181
+ static void submit_one_bio (struct bio * bio , int mirror_num ,
182
+ enum btrfs_compression_type compress_type )
182
183
{
183
184
struct extent_io_tree * tree = bio -> bi_private ;
184
185
@@ -189,7 +190,7 @@ static void submit_one_bio(struct bio *bio, int mirror_num, unsigned long bio_fl
189
190
190
191
if (is_data_inode (tree -> private_data ))
191
192
btrfs_submit_data_bio (tree -> private_data , bio , mirror_num ,
192
- bio_flags );
193
+ compress_type );
193
194
else
194
195
btrfs_submit_metadata_bio (tree -> private_data , bio , mirror_num );
195
196
/*
@@ -3246,7 +3247,7 @@ struct bio *btrfs_bio_clone_partial(struct bio *orig, u64 offset, u64 size)
3246
3247
* a contiguous page to the previous one
3247
3248
* @size: portion of page that we want to write
3248
3249
* @pg_offset: starting offset in the page
3249
- * @bio_flags: flags of the current bio to see if we can merge them
3250
+ * @compress_type: compression type of the current bio to see if we can merge them
3250
3251
*
3251
3252
* Attempt to add a page to bio considering stripe alignment etc.
3252
3253
*
@@ -3258,7 +3259,7 @@ static int btrfs_bio_add_page(struct btrfs_bio_ctrl *bio_ctrl,
3258
3259
struct page * page ,
3259
3260
u64 disk_bytenr , unsigned int size ,
3260
3261
unsigned int pg_offset ,
3261
- unsigned long bio_flags )
3262
+ enum btrfs_compression_type compress_type )
3262
3263
{
3263
3264
struct bio * bio = bio_ctrl -> bio ;
3264
3265
u32 bio_size = bio -> bi_iter .bi_size ;
@@ -3270,7 +3271,7 @@ static int btrfs_bio_add_page(struct btrfs_bio_ctrl *bio_ctrl,
3270
3271
ASSERT (bio );
3271
3272
/* The limit should be calculated when bio_ctrl->bio is allocated */
3272
3273
ASSERT (bio_ctrl -> len_to_oe_boundary && bio_ctrl -> len_to_stripe_boundary );
3273
- if (bio_ctrl -> bio_flags != bio_flags )
3274
+ if (bio_ctrl -> bio_flags != compress_type )
3274
3275
return 0 ;
3275
3276
3276
3277
if (bio_ctrl -> bio_flags != BTRFS_COMPRESS_NONE )
@@ -3359,7 +3360,7 @@ static int alloc_new_bio(struct btrfs_inode *inode,
3359
3360
unsigned int opf ,
3360
3361
bio_end_io_t end_io_func ,
3361
3362
u64 disk_bytenr , u32 offset , u64 file_offset ,
3362
- unsigned long bio_flags )
3363
+ enum btrfs_compression_type compress_type )
3363
3364
{
3364
3365
struct btrfs_fs_info * fs_info = inode -> root -> fs_info ;
3365
3366
struct bio * bio ;
@@ -3370,12 +3371,12 @@ static int alloc_new_bio(struct btrfs_inode *inode,
3370
3371
* For compressed page range, its disk_bytenr is always @disk_bytenr
3371
3372
* passed in, no matter if we have added any range into previous bio.
3372
3373
*/
3373
- if (bio_flags != BTRFS_COMPRESS_NONE )
3374
+ if (compress_type != BTRFS_COMPRESS_NONE )
3374
3375
bio -> bi_iter .bi_sector = disk_bytenr >> SECTOR_SHIFT ;
3375
3376
else
3376
3377
bio -> bi_iter .bi_sector = (disk_bytenr + offset ) >> SECTOR_SHIFT ;
3377
3378
bio_ctrl -> bio = bio ;
3378
- bio_ctrl -> bio_flags = bio_flags ;
3379
+ bio_ctrl -> bio_flags = compress_type ;
3379
3380
bio -> bi_end_io = end_io_func ;
3380
3381
bio -> bi_private = & inode -> io_tree ;
3381
3382
bio -> bi_opf = opf ;
@@ -3434,7 +3435,7 @@ static int alloc_new_bio(struct btrfs_inode *inode,
3434
3435
* @end_io_func: end_io callback for new bio
3435
3436
* @mirror_num: desired mirror to read/write
3436
3437
* @prev_bio_flags: flags of previous bio to see if we can merge the current one
3437
- * @bio_flags: flags of the current bio to see if we can merge them
3438
+ * @compress_type: compress type for current bio
3438
3439
*/
3439
3440
static int submit_extent_page (unsigned int opf ,
3440
3441
struct writeback_control * wbc ,
@@ -3443,7 +3444,7 @@ static int submit_extent_page(unsigned int opf,
3443
3444
size_t size , unsigned long pg_offset ,
3444
3445
bio_end_io_t end_io_func ,
3445
3446
int mirror_num ,
3446
- unsigned long bio_flags ,
3447
+ enum btrfs_compression_type compress_type ,
3447
3448
bool force_bio_submit )
3448
3449
{
3449
3450
int ret = 0 ;
@@ -3468,22 +3469,22 @@ static int submit_extent_page(unsigned int opf,
3468
3469
ret = alloc_new_bio (inode , bio_ctrl , wbc , opf ,
3469
3470
end_io_func , disk_bytenr , offset ,
3470
3471
page_offset (page ) + cur ,
3471
- bio_flags );
3472
+ compress_type );
3472
3473
if (ret < 0 )
3473
3474
return ret ;
3474
3475
}
3475
3476
/*
3476
3477
* We must go through btrfs_bio_add_page() to ensure each
3477
3478
* page range won't cross various boundaries.
3478
3479
*/
3479
- if (bio_flags != BTRFS_COMPRESS_NONE )
3480
+ if (compress_type != BTRFS_COMPRESS_NONE )
3480
3481
added = btrfs_bio_add_page (bio_ctrl , page , disk_bytenr ,
3481
3482
size - offset , pg_offset + offset ,
3482
- bio_flags );
3483
+ compress_type );
3483
3484
else
3484
3485
added = btrfs_bio_add_page (bio_ctrl , page ,
3485
3486
disk_bytenr + offset , size - offset ,
3486
- pg_offset + offset , bio_flags );
3487
+ pg_offset + offset , compress_type );
3487
3488
3488
3489
/* Metadata page range should never be split */
3489
3490
if (!is_data_inode (& inode -> vfs_inode ))
0 commit comments