void bch2_bio_free_pages_pool(struct bch_fs *c, struct bio *bio)
{
struct bvec_iter_all iter;
- struct bio_vec bv;
+ struct bio_vec *bv;
bio_for_each_segment_all(bv, bio, iter)
- if (bv.bv_page != ZERO_PAGE(0))
- mempool_free(bv.bv_page, &c->bio_bounce_pages);
+ if (bv->bv_page != ZERO_PAGE(0))
+ mempool_free(bv->bv_page, &c->bio_bounce_pages);
bio->bi_vcnt = 0;
}
&devs_have,
opts.data_replicas,
opts.data_replicas,
- RESERVE_none, 0, &cl, &wp);
+ BCH_WATERMARK_normal, 0, &cl, &wp);
if (ret) {
bch2_trans_unlock(trans);
closure_sync(&cl);
/* Can we just write the entire extent as is? */
if (op->crc.uncompressed_size == op->crc.live_size &&
op->crc.compressed_size <= wp->sectors_free &&
- (op->crc.compression_type == op->compression_type ||
+ (op->crc.compression_type == bch2_compression_opt_to_type(op->compression_opt) ||
op->incompressible)) {
if (!crc_is_compressed(op->crc) &&
op->csum_type != op->crc.csum_type &&
/*
* If we want to compress the data, it has to be decrypted:
*/
- if ((op->compression_type ||
+ if ((op->compression_opt ||
bch2_csum_type_is_encryption(op->crc.csum_type) !=
bch2_csum_type_is_encryption(op->csum_type)) &&
bch2_write_decrypt(op))
}
if (ec_buf ||
- op->compression_type ||
+ op->compression_opt ||
(op->csum_type &&
!(op->flags & BCH_WRITE_PAGES_STABLE)) ||
(bch2_csum_type_is_encryption(op->csum_type) &&
dst->bi_iter.bi_size < c->opts.encoded_extent_max)
break;
- BUG_ON(op->compression_type &&
+ BUG_ON(op->compression_opt &&
(op->flags & BCH_WRITE_DATA_ENCODED) &&
bch2_csum_type_is_encryption(op->crc.csum_type));
- BUG_ON(op->compression_type && !bounce);
+ BUG_ON(op->compression_opt && !bounce);
crc.compression_type = op->incompressible
? BCH_COMPRESSION_TYPE_incompressible
- : op->compression_type
+ : op->compression_opt
? bch2_bio_compress(c, dst, &dst_len, src, &src_len,
- op->compression_type)
+ op->compression_opt)
: 0;
if (!crc_is_compressed(crc)) {
dst_len = min(dst->bi_iter.bi_size, src->bi_iter.bi_size);
percpu_ref_put(&bch_dev_bkey_exists(c, buckets[i].b.inode)->io_ref);
/* We can retry this: */
- ret = BCH_ERR_transaction_restart;
+ ret = -BCH_ERR_transaction_restart;
goto out;
}
&op->devs_have,
op->nr_replicas,
op->nr_replicas_required,
- op->alloc_reserve,
+ op->watermark,
op->flags,
(op->flags & (BCH_WRITE_ALLOC_NOWAIT|
BCH_WRITE_ONLY_SPECIFIED_DEVS))
op->end_io(op);
}
-const char * const bch2_write_flags[] = {
+static const char * const bch2_write_flags[] = {
#define x(f) #f,
BCH_WRITE_FLAGS()
#undef x