Lines Matching refs:ti

77 	int (*ctr)(struct crypt_config *cc, struct dm_target *ti,
309 struct dm_target *ti, in setup_essiv_cpu() argument
318 ti->error = "Error allocating crypto tfm for ESSIV"; in setup_essiv_cpu()
324 ti->error = "Block size of ESSIV cipher does " in setup_essiv_cpu()
332 ti->error = "Failed to set key for ESSIV cipher"; in setup_essiv_cpu()
359 static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_essiv_ctr() argument
368 ti->error = "Digest algorithm missing for ESSIV mode"; in crypt_iv_essiv_ctr()
375 ti->error = "Error initializing ESSIV hash"; in crypt_iv_essiv_ctr()
382 ti->error = "Error kmallocing salt storage in ESSIV"; in crypt_iv_essiv_ctr()
390 essiv_tfm = setup_essiv_cpu(cc, ti, salt, in crypt_iv_essiv_ctr()
419 static int crypt_iv_benbi_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_benbi_ctr() argument
429 ti->error = "cypher blocksize is not a power of 2"; in crypt_iv_benbi_ctr()
434 ti->error = "cypher blocksize is > 512"; in crypt_iv_benbi_ctr()
480 static int crypt_iv_lmk_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_lmk_ctr() argument
487 ti->error = "Error initializing LMK hash"; in crypt_iv_lmk_ctr()
500 ti->error = "Error kmallocing seed storage in LMK"; in crypt_iv_lmk_ctr()
629 static int crypt_iv_tcw_ctr(struct crypt_config *cc, struct dm_target *ti, in crypt_iv_tcw_ctr() argument
635 ti->error = "Wrong key size for TCW"; in crypt_iv_tcw_ctr()
641 ti->error = "Error initializing CRC32 in TCW"; in crypt_iv_tcw_ctr()
649 ti->error = "Error allocating seed storage in TCW"; in crypt_iv_tcw_ctr()
1524 static void crypt_dtr(struct dm_target *ti) in crypt_dtr() argument
1526 struct crypt_config *cc = ti->private; in crypt_dtr()
1528 ti->private = NULL; in crypt_dtr()
1558 dm_put_device(ti, cc->dev); in crypt_dtr()
1567 static int crypt_ctr_cipher(struct dm_target *ti, in crypt_ctr_cipher() argument
1570 struct crypt_config *cc = ti->private; in crypt_ctr_cipher()
1578 ti->error = "Bad cipher specification"; in crypt_ctr_cipher()
1598 ti->error = "Bad cipher key count specification"; in crypt_ctr_cipher()
1625 ti->error = "IV mechanism required"; in crypt_ctr_cipher()
1643 ti->error = "Error allocating crypto tfm"; in crypt_ctr_cipher()
1689 ti->error = "Invalid IV mode"; in crypt_ctr_cipher()
1696 ti->error = "Error decoding and setting key"; in crypt_ctr_cipher()
1702 ret = cc->iv_gen_ops->ctr(cc, ti, ivopts); in crypt_ctr_cipher()
1704 ti->error = "Error creating IV"; in crypt_ctr_cipher()
1713 ti->error = "Error initialising IV"; in crypt_ctr_cipher()
1724 ti->error = "Cannot allocate cipher strings"; in crypt_ctr_cipher()
1732 static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) in crypt_ctr() argument
1748 ti->error = "Not enough arguments"; in crypt_ctr()
1756 ti->error = "Cannot allocate encryption context"; in crypt_ctr()
1761 ti->private = cc; in crypt_ctr()
1762 ret = crypt_ctr_cipher(ti, argv[0], argv[1]); in crypt_ctr()
1787 ti->error = "Cannot allocate crypt request mempool"; in crypt_ctr()
1791 cc->per_bio_data_size = ti->per_bio_data_size = in crypt_ctr()
1798 ti->error = "Cannot allocate page mempool"; in crypt_ctr()
1804 ti->error = "Cannot allocate crypt bioset"; in crypt_ctr()
1812 ti->error = "Invalid iv_offset sector"; in crypt_ctr()
1817 ret = dm_get_device(ti, argv[3], dm_table_get_mode(ti->table), &cc->dev); in crypt_ctr()
1819 ti->error = "Device lookup failed"; in crypt_ctr()
1825 ti->error = "Invalid device sector"; in crypt_ctr()
1838 ret = dm_read_arg_group(_args, &as, &opt_params, &ti->error); in crypt_ctr()
1846 ti->error = "Not enough feature arguments"; in crypt_ctr()
1851 ti->num_discard_bios = 1; in crypt_ctr()
1860 ti->error = "Invalid feature arguments"; in crypt_ctr()
1869 ti->error = "Couldn't create kcryptd io queue"; in crypt_ctr()
1879 ti->error = "Couldn't create kcryptd queue"; in crypt_ctr()
1890 ti->error = "Couldn't spawn write thread"; in crypt_ctr()
1895 ti->num_flush_bios = 1; in crypt_ctr()
1896 ti->discard_zeroes_data_unsupported = true; in crypt_ctr()
1901 crypt_dtr(ti); in crypt_ctr()
1905 static int crypt_map(struct dm_target *ti, struct bio *bio) in crypt_map() argument
1908 struct crypt_config *cc = ti->private; in crypt_map()
1919 dm_target_offset(ti, bio->bi_iter.bi_sector); in crypt_map()
1924 crypt_io_init(io, cc, bio, dm_target_offset(ti, bio->bi_iter.bi_sector)); in crypt_map()
1936 static void crypt_status(struct dm_target *ti, status_type_t type, in crypt_status() argument
1939 struct crypt_config *cc = ti->private; in crypt_status()
1960 num_feature_args += !!ti->num_discard_bios; in crypt_status()
1965 if (ti->num_discard_bios) in crypt_status()
1977 static void crypt_postsuspend(struct dm_target *ti) in crypt_postsuspend() argument
1979 struct crypt_config *cc = ti->private; in crypt_postsuspend()
1984 static int crypt_preresume(struct dm_target *ti) in crypt_preresume() argument
1986 struct crypt_config *cc = ti->private; in crypt_preresume()
1996 static void crypt_resume(struct dm_target *ti) in crypt_resume() argument
1998 struct crypt_config *cc = ti->private; in crypt_resume()
2007 static int crypt_message(struct dm_target *ti, unsigned argc, char **argv) in crypt_message() argument
2009 struct crypt_config *cc = ti->private; in crypt_message()
2043 static int crypt_iterate_devices(struct dm_target *ti, in crypt_iterate_devices() argument
2046 struct crypt_config *cc = ti->private; in crypt_iterate_devices()
2048 return fn(ti, cc->dev, cc->start, ti->len, data); in crypt_iterate_devices()
2051 static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits) in crypt_io_hints() argument