diff options
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index b35ce16b3df3..5982c8a71f02 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
@@ -295,7 +295,8 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
295 | unsigned long len, u64 disk_start, | 295 | unsigned long len, u64 disk_start, |
296 | unsigned long compressed_len, | 296 | unsigned long compressed_len, |
297 | struct page **compressed_pages, | 297 | struct page **compressed_pages, |
298 | unsigned long nr_pages) | 298 | unsigned long nr_pages, |
299 | unsigned int write_flags) | ||
299 | { | 300 | { |
300 | struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); | 301 | struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); |
301 | struct bio *bio = NULL; | 302 | struct bio *bio = NULL; |
@@ -327,7 +328,7 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
327 | bdev = fs_info->fs_devices->latest_bdev; | 328 | bdev = fs_info->fs_devices->latest_bdev; |
328 | 329 | ||
329 | bio = btrfs_bio_alloc(bdev, first_byte); | 330 | bio = btrfs_bio_alloc(bdev, first_byte); |
330 | bio_set_op_attrs(bio, REQ_OP_WRITE, 0); | 331 | bio->bi_opf = REQ_OP_WRITE | write_flags; |
331 | bio->bi_private = cb; | 332 | bio->bi_private = cb; |
332 | bio->bi_end_io = end_compressed_bio_write; | 333 | bio->bi_end_io = end_compressed_bio_write; |
333 | refcount_set(&cb->pending_bios, 1); | 334 | refcount_set(&cb->pending_bios, 1); |
@@ -374,7 +375,7 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
374 | bio_put(bio); | 375 | bio_put(bio); |
375 | 376 | ||
376 | bio = btrfs_bio_alloc(bdev, first_byte); | 377 | bio = btrfs_bio_alloc(bdev, first_byte); |
377 | bio_set_op_attrs(bio, REQ_OP_WRITE, 0); | 378 | bio->bi_opf = REQ_OP_WRITE | write_flags; |
378 | bio->bi_private = cb; | 379 | bio->bi_private = cb; |
379 | bio->bi_end_io = end_compressed_bio_write; | 380 | bio->bi_end_io = end_compressed_bio_write; |
380 | bio_add_page(bio, page, PAGE_SIZE, 0); | 381 | bio_add_page(bio, page, PAGE_SIZE, 0); |
@@ -1528,5 +1529,5 @@ unsigned int btrfs_compress_str2level(const char *str) | |||
1528 | if (str[4] == ':' && '1' <= str[5] && str[5] <= '9' && str[6] == 0) | 1529 | if (str[4] == ':' && '1' <= str[5] && str[5] <= '9' && str[6] == 0) |
1529 | return str[5] - '0'; | 1530 | return str[5] - '0'; |
1530 | 1531 | ||
1531 | return 0; | 1532 | return BTRFS_ZLIB_DEFAULT_LEVEL; |
1532 | } | 1533 | } |