1*59c8e88eSDag-Erling Smørgrav--- test117.left-P.txt 2*59c8e88eSDag-Erling Smørgrav+++ test117.right-P.txt 3*59c8e88eSDag-Erling Smørgrav@@ -65,6 +65,8 @@ 4*59c8e88eSDag-Erling Smørgrav struct sr_crypto_kdfinfo *, struct sr_crypto_kdfinfo *); 5*59c8e88eSDag-Erling Smørgrav int sr_crypto_create(struct sr_discipline *, 6*59c8e88eSDag-Erling Smørgrav struct bioc_createraid *, int, int64_t); 7*59c8e88eSDag-Erling Smørgrav+int sr_crypto_init(struct sr_discipline *, 8*59c8e88eSDag-Erling Smørgrav+ struct bioc_createraid *); 9*59c8e88eSDag-Erling Smørgrav int sr_crypto_assemble(struct sr_discipline *, 10*59c8e88eSDag-Erling Smørgrav struct bioc_createraid *, int, void *); 11*59c8e88eSDag-Erling Smørgrav int sr_crypto_alloc_resources(struct sr_discipline *); 12*59c8e88eSDag-Erling Smørgrav@@ -117,18 +119,34 @@ 13*59c8e88eSDag-Erling Smørgrav sr_crypto_create(struct sr_discipline *sd, struct bioc_createraid *bc, 14*59c8e88eSDag-Erling Smørgrav int no_chunk, int64_t coerced_size) 15*59c8e88eSDag-Erling Smørgrav { 16*59c8e88eSDag-Erling Smørgrav- struct sr_meta_opt_item *omi; 17*59c8e88eSDag-Erling Smørgrav- int rv = EINVAL; 18*59c8e88eSDag-Erling Smørgrav+ int rv = EINVAL; 19*59c8e88eSDag-Erling Smørgrav 20*59c8e88eSDag-Erling Smørgrav if (no_chunk != 1) { 21*59c8e88eSDag-Erling Smørgrav sr_error(sd->sd_sc, "%s requires exactly one chunk", 22*59c8e88eSDag-Erling Smørgrav sd->sd_name); 23*59c8e88eSDag-Erling Smørgrav- goto done; 24*59c8e88eSDag-Erling Smørgrav+ return (rv); 25*59c8e88eSDag-Erling Smørgrav } 26*59c8e88eSDag-Erling Smørgrav 27*59c8e88eSDag-Erling Smørgrav- if (coerced_size > SR_CRYPTO_MAXSIZE) { 28*59c8e88eSDag-Erling Smørgrav+ sd->sd_meta->ssdi.ssd_size = coerced_size; 29*59c8e88eSDag-Erling Smørgrav+ 30*59c8e88eSDag-Erling Smørgrav+ rv = sr_crypto_init(sd, bc); 31*59c8e88eSDag-Erling Smørgrav+ if (rv) 32*59c8e88eSDag-Erling Smørgrav+ return (rv); 33*59c8e88eSDag-Erling Smørgrav+ 34*59c8e88eSDag-Erling Smørgrav+ sd->sd_max_ccb_per_wu = no_chunk; 35*59c8e88eSDag-Erling Smørgrav+ return (0); 36*59c8e88eSDag-Erling Smørgrav+} 37*59c8e88eSDag-Erling Smørgrav+ 38*59c8e88eSDag-Erling Smørgrav+int 39*59c8e88eSDag-Erling Smørgrav+sr_crypto_init(struct sr_discipline *sd, struct bioc_createraid *bc) 40*59c8e88eSDag-Erling Smørgrav+{ 41*59c8e88eSDag-Erling Smørgrav+ struct sr_meta_opt_item *omi; 42*59c8e88eSDag-Erling Smørgrav+ int rv = EINVAL; 43*59c8e88eSDag-Erling Smørgrav+ 44*59c8e88eSDag-Erling Smørgrav+ if (sd->sd_meta->ssdi.ssd_size > SR_CRYPTO_MAXSIZE) { 45*59c8e88eSDag-Erling Smørgrav sr_error(sd->sd_sc, "%s exceeds maximum size (%lli > %llu)", 46*59c8e88eSDag-Erling Smørgrav- sd->sd_name, coerced_size, SR_CRYPTO_MAXSIZE); 47*59c8e88eSDag-Erling Smørgrav+ sd->sd_name, sd->sd_meta->ssdi.ssd_size, 48*59c8e88eSDag-Erling Smørgrav+ SR_CRYPTO_MAXSIZE); 49*59c8e88eSDag-Erling Smørgrav goto done; 50*59c8e88eSDag-Erling Smørgrav } 51*59c8e88eSDag-Erling Smørgrav 52*59c8e88eSDag-Erling Smørgrav@@ -170,12 +188,8 @@ 53*59c8e88eSDag-Erling Smørgrav if (!(bc->bc_flags & BIOC_SCNOAUTOASSEMBLE) && bc->bc_key_disk == NODEV) 54*59c8e88eSDag-Erling Smørgrav goto done; 55*59c8e88eSDag-Erling Smørgrav 56*59c8e88eSDag-Erling Smørgrav- sd->sd_meta->ssdi.ssd_size = coerced_size; 57*59c8e88eSDag-Erling Smørgrav- 58*59c8e88eSDag-Erling Smørgrav sr_crypto_create_keys(sd); 59*59c8e88eSDag-Erling Smørgrav 60*59c8e88eSDag-Erling Smørgrav- sd->sd_max_ccb_per_wu = no_chunk; 61*59c8e88eSDag-Erling Smørgrav- 62*59c8e88eSDag-Erling Smørgrav rv = 0; 63*59c8e88eSDag-Erling Smørgrav done: 64*59c8e88eSDag-Erling Smørgrav return (rv); 65