X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libbcachefs%2Fchecksum.h;h=409ad534d9f40c23efd94817349ca1eeffb4ff44;hb=c1f55a60c41ca5ab8ed7a0893c3d29f8006da82a;hp=f7ccef7a55201985fbf03a4c937e26a3fd24cac2;hpb=e4716b10ed0210a13efdd3252c12199da3d52aad;p=bcachefs-tools-debian diff --git a/libbcachefs/checksum.h b/libbcachefs/checksum.h index f7ccef7..409ad53 100644 --- a/libbcachefs/checksum.h +++ b/libbcachefs/checksum.h @@ -99,14 +99,17 @@ static inline enum bch_csum_type bch2_csum_opt_to_type(enum bch_csum_opts type, } static inline enum bch_csum_type bch2_data_checksum_type(struct bch_fs *c, - unsigned opt) + struct bch_io_opts opts) { + if (opts.nocow) + return 0; + if (c->sb.encryption_type) return c->opts.wide_macs ? BCH_CSUM_chacha20_poly1305_128 : BCH_CSUM_chacha20_poly1305_80; - return bch2_csum_opt_to_type(opt, true); + return bch2_csum_opt_to_type(opts.data_checksum, true); } static inline enum bch_csum_type bch2_meta_checksum_type(struct bch_fs *c)