Lines Matching refs:ti
65 static void inlinecrypt_dtr(struct dm_target *ti) in inlinecrypt_dtr() argument
67 struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_dtr()
72 dm_put_device(ti, ctx->dev); in inlinecrypt_dtr()
233 static int inlinecrypt_ctr_optional(struct dm_target *ti, in inlinecrypt_ctr_optional() argument
236 struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_ctr_optional()
250 err = dm_read_arg_group(_args, &as, &opt_params, &ti->error); in inlinecrypt_ctr_optional()
257 ti->error = "Not enough feature arguments"; in inlinecrypt_ctr_optional()
264 ti->error = "Invalid block key type"; in inlinecrypt_ctr_optional()
273 ti->error = "Invalid block key type"; in inlinecrypt_ctr_optional()
277 ti->num_discard_bios = 1; in inlinecrypt_ctr_optional()
283 ti->error = "Invalid sector_size"; in inlinecrypt_ctr_optional()
289 ti->error = "Invalid feature arguments"; in inlinecrypt_ctr_optional()
296 ti->error = "iv_large_sectors must be specified"; in inlinecrypt_ctr_optional()
310 static int inlinecrypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) in inlinecrypt_ctr() argument
321 ti->error = "Not enough arguments"; in inlinecrypt_ctr()
327 ti->error = "Out of memory"; in inlinecrypt_ctr()
330 ti->private = ctx; in inlinecrypt_ctr()
335 ti->error = "Out of memory"; in inlinecrypt_ctr()
341 ti->error = "Unsupported cipher"; in inlinecrypt_ctr()
349 ti->error = "Cannot parse key size"; in inlinecrypt_ctr()
356 ti->error = "Malformed key string"; in inlinecrypt_ctr()
362 ti->error = "Invalid iv_offset sector"; in inlinecrypt_ctr()
368 err = dm_get_device(ti, argv[3], dm_table_get_mode(ti->table), in inlinecrypt_ctr()
371 ti->error = "Device lookup failed"; in inlinecrypt_ctr()
378 ti->error = "Invalid start sector"; in inlinecrypt_ctr()
388 err = inlinecrypt_ctr_optional(ti, argc - 5, &argv[5]); in inlinecrypt_ctr()
393 if (ti->len & ((ctx->sector_size >> SECTOR_SHIFT) - 1)) { in inlinecrypt_ctr()
394 ti->error = "Device size is not a multiple of sector_size"; in inlinecrypt_ctr()
399 ti->error = "Wrong alignment of iv_offset sector"; in inlinecrypt_ctr()
404 ctx->max_dun = (ctx->iv_offset + ti->len - 1) >> in inlinecrypt_ctr()
413 ti->error = "Error initializing blk-crypto key"; in inlinecrypt_ctr()
419 ti->error = "Error starting to use blk-crypto"; in inlinecrypt_ctr()
423 ti->num_flush_bios = 1; in inlinecrypt_ctr()
429 inlinecrypt_dtr(ti); in inlinecrypt_ctr()
435 static int inlinecrypt_map(struct dm_target *ti, struct bio *bio) in inlinecrypt_map() argument
437 const struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_map()
459 sector_in_target = dm_target_offset(ti, bio->bi_iter.bi_sector); in inlinecrypt_map()
505 static void inlinecrypt_status(struct dm_target *ti, status_type_t type, in inlinecrypt_status() argument
509 const struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_status()
529 num_feature_args += !!ti->num_discard_bios; in inlinecrypt_status()
534 if (ti->num_discard_bios) in inlinecrypt_status()
545 static int inlinecrypt_prepare_ioctl(struct dm_target *ti, in inlinecrypt_prepare_ioctl() argument
549 const struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_prepare_ioctl()
555 return ctx->start != 0 || ti->len != bdev_nr_sectors(dev->bdev); in inlinecrypt_prepare_ioctl()
558 static int inlinecrypt_iterate_devices(struct dm_target *ti, in inlinecrypt_iterate_devices() argument
562 const struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_iterate_devices()
564 return fn(ti, ctx->dev, ctx->start, ti->len, data); in inlinecrypt_iterate_devices()
568 static int inlinecrypt_report_zones(struct dm_target *ti, in inlinecrypt_report_zones() argument
572 const struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_report_zones()
575 ctx->start + dm_target_offset(ti, args->next_sector), in inlinecrypt_report_zones()
582 static void inlinecrypt_io_hints(struct dm_target *ti, in inlinecrypt_io_hints() argument
585 const struct inlinecrypt_ctx *ctx = ti->private; in inlinecrypt_io_hints()