Lines Matching refs:ti
77 int (*ctr)(struct crypt_config *cc, struct dm_target *ti,
308 struct dm_target *ti, in setup_essiv_cpu() argument
317 ti->error = "Error allocating crypto tfm for ESSIV"; in setup_essiv_cpu()
323 ti->error = "Block size of ESSIV cipher does " in setup_essiv_cpu()
331 ti->error = "Failed to set key for ESSIV cipher"; in setup_essiv_cpu()
358 static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_essiv_ctr() argument
367 ti->error = "Digest algorithm missing for ESSIV mode"; in crypt_iv_essiv_ctr()
374 ti->error = "Error initializing ESSIV hash"; in crypt_iv_essiv_ctr()
381 ti->error = "Error kmallocing salt storage in ESSIV"; in crypt_iv_essiv_ctr()
389 essiv_tfm = setup_essiv_cpu(cc, ti, salt, in crypt_iv_essiv_ctr()
418 static int crypt_iv_benbi_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_benbi_ctr() argument
428 ti->error = "cypher blocksize is not a power of 2"; in crypt_iv_benbi_ctr()
433 ti->error = "cypher blocksize is > 512"; in crypt_iv_benbi_ctr()
479 static int crypt_iv_lmk_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_lmk_ctr() argument
486 ti->error = "Error initializing LMK hash"; in crypt_iv_lmk_ctr()
499 ti->error = "Error kmallocing seed storage in LMK"; in crypt_iv_lmk_ctr()
628 static int crypt_iv_tcw_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_tcw_ctr() argument
634 ti->error = "Wrong key size for TCW"; in crypt_iv_tcw_ctr()
640 ti->error = "Error initializing CRC32 in TCW"; in crypt_iv_tcw_ctr()
648 ti->error = "Error allocating seed storage in TCW"; in crypt_iv_tcw_ctr()
1507 static void crypt_dtr(struct dm_target *ti) in crypt_dtr() argument
1509 struct crypt_config *cc = ti->private; in crypt_dtr()
1511 ti->private = NULL; in crypt_dtr()
1538 dm_put_device(ti, cc->dev); in crypt_dtr()
1547 static int crypt_ctr_cipher(struct dm_target *ti, in crypt_ctr_cipher() argument
1550 struct crypt_config *cc = ti->private; in crypt_ctr_cipher()
1558 ti->error = "Bad cipher specification"; in crypt_ctr_cipher()
1578 ti->error = "Bad cipher key count specification"; in crypt_ctr_cipher()
1605 ti->error = "IV mechanism required"; in crypt_ctr_cipher()
1623 ti->error = "Error allocating crypto tfm"; in crypt_ctr_cipher()
1669 ti->error = "Invalid IV mode"; in crypt_ctr_cipher()
1676 ti->error = "Error decoding and setting key"; in crypt_ctr_cipher()
1682 ret = cc->iv_gen_ops->ctr(cc, ti, ivopts); in crypt_ctr_cipher()
1684 ti->error = "Error creating IV"; in crypt_ctr_cipher()
1693 ti->error = "Error initialising IV"; in crypt_ctr_cipher()
1704 ti->error = "Cannot allocate cipher strings"; in crypt_ctr_cipher()
1712 static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) in crypt_ctr() argument
1728 ti->error = "Not enough arguments"; in crypt_ctr()
1736 ti->error = "Cannot allocate encryption context"; in crypt_ctr()
1741 ti->private = cc; in crypt_ctr()
1742 ret = crypt_ctr_cipher(ti, argv[0], argv[1]); in crypt_ctr()
1767 ti->error = "Cannot allocate crypt request mempool"; in crypt_ctr()
1771 cc->per_bio_data_size = ti->per_bio_data_size = in crypt_ctr()
1778 ti->error = "Cannot allocate page mempool"; in crypt_ctr()
1784 ti->error = "Cannot allocate crypt bioset"; in crypt_ctr()
1792 ti->error = "Invalid iv_offset sector"; in crypt_ctr()
1797 if (dm_get_device(ti, argv[3], dm_table_get_mode(ti->table), &cc->dev)) { in crypt_ctr()
1798 ti->error = "Device lookup failed"; in crypt_ctr()
1803 ti->error = "Invalid device sector"; in crypt_ctr()
1816 ret = dm_read_arg_group(_args, &as, &opt_params, &ti->error); in crypt_ctr()
1824 ti->error = "Not enough feature arguments"; in crypt_ctr()
1829 ti->num_discard_bios = 1; in crypt_ctr()
1838 ti->error = "Invalid feature arguments"; in crypt_ctr()
1847 ti->error = "Couldn't create kcryptd io queue"; in crypt_ctr()
1857 ti->error = "Couldn't create kcryptd queue"; in crypt_ctr()
1868 ti->error = "Couldn't spawn write thread"; in crypt_ctr()
1873 ti->num_flush_bios = 1; in crypt_ctr()
1874 ti->discard_zeroes_data_unsupported = true; in crypt_ctr()
1879 crypt_dtr(ti); in crypt_ctr()
1883 static int crypt_map(struct dm_target *ti, struct bio *bio) in crypt_map() argument
1886 struct crypt_config *cc = ti->private; in crypt_map()
1897 dm_target_offset(ti, bio->bi_iter.bi_sector); in crypt_map()
1902 crypt_io_init(io, cc, bio, dm_target_offset(ti, bio->bi_iter.bi_sector)); in crypt_map()
1914 static void crypt_status(struct dm_target *ti, status_type_t type, in crypt_status() argument
1917 struct crypt_config *cc = ti->private; in crypt_status()
1938 num_feature_args += !!ti->num_discard_bios; in crypt_status()
1943 if (ti->num_discard_bios) in crypt_status()
1955 static void crypt_postsuspend(struct dm_target *ti) in crypt_postsuspend() argument
1957 struct crypt_config *cc = ti->private; in crypt_postsuspend()
1962 static int crypt_preresume(struct dm_target *ti) in crypt_preresume() argument
1964 struct crypt_config *cc = ti->private; in crypt_preresume()
1974 static void crypt_resume(struct dm_target *ti) in crypt_resume() argument
1976 struct crypt_config *cc = ti->private; in crypt_resume()
1985 static int crypt_message(struct dm_target *ti, unsigned argc, char **argv) in crypt_message() argument
1987 struct crypt_config *cc = ti->private; in crypt_message()
2021 static int crypt_merge(struct dm_target *ti, struct bvec_merge_data *bvm, in crypt_merge() argument
2024 struct crypt_config *cc = ti->private; in crypt_merge()
2031 bvm->bi_sector = cc->start + dm_target_offset(ti, bvm->bi_sector); in crypt_merge()
2036 static int crypt_iterate_devices(struct dm_target *ti, in crypt_iterate_devices() argument
2039 struct crypt_config *cc = ti->private; in crypt_iterate_devices()
2041 return fn(ti, cc->dev, cc->start, ti->len, data); in crypt_iterate_devices()
2044 static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits) in crypt_io_hints() argument