Lines Matching refs:ppl_conf

87 struct ppl_conf {  struct
116 struct ppl_conf *ppl_conf; /* shared between all log instances */ argument
235 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_new_iounit() local
240 io = mempool_alloc(&ppl_conf->io_pool, GFP_NOWAIT); in ppl_new_iounit()
259 pplhdr->signature = cpu_to_le32(ppl_conf->signature); in ppl_new_iounit()
261 io->seq = atomic64_add_return(1, &ppl_conf->seq); in ppl_new_iounit()
363 struct ppl_conf *ppl_conf = conf->log_private; in ppl_write_stripe() local
374 log = &ppl_conf->child_logs[sh->pd_idx]; in ppl_write_stripe()
388 spin_lock_irq(&ppl_conf->no_mem_stripes_lock); in ppl_write_stripe()
389 list_add_tail(&sh->log_list, &ppl_conf->no_mem_stripes); in ppl_write_stripe()
390 spin_unlock_irq(&ppl_conf->no_mem_stripes_lock); in ppl_write_stripe()
402 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_log_endio() local
408 md_error(ppl_conf->mddev, log->rdev); in ppl_log_endio()
431 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_submit_iounit() local
452 ilog2(ppl_conf->block_size >> 9)); in ppl_submit_iounit()
482 if ((ppl_conf->child_logs[i].wb_cache_on) && in ppl_submit_iounit()
497 &ppl_conf->bs); in ppl_submit_iounit()
534 struct ppl_conf *ppl_conf = conf->log_private; in ppl_write_stripe_run() local
538 for (i = 0; i < ppl_conf->count; i++) { in ppl_write_stripe_run()
539 log = &ppl_conf->child_logs[i]; in ppl_write_stripe_run()
550 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_io_unit_finished() local
551 struct r5conf *conf = ppl_conf->mddev->private; in ppl_io_unit_finished()
562 mempool_free(io, &ppl_conf->io_pool); in ppl_io_unit_finished()
564 spin_lock(&ppl_conf->no_mem_stripes_lock); in ppl_io_unit_finished()
565 if (!list_empty(&ppl_conf->no_mem_stripes)) { in ppl_io_unit_finished()
568 sh = list_first_entry(&ppl_conf->no_mem_stripes, in ppl_io_unit_finished()
574 spin_unlock(&ppl_conf->no_mem_stripes_lock); in ppl_io_unit_finished()
585 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_flush_endio() local
586 struct r5conf *conf = ppl_conf->mddev->private; in ppl_flush_endio()
611 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_do_flush() local
612 struct r5conf *conf = ppl_conf->mddev->private; in ppl_do_flush()
634 GFP_NOIO, &ppl_conf->flush_bs); in ppl_do_flush()
666 struct ppl_conf *ppl_conf = conf->log_private; in ppl_quiesce() local
670 for (i = 0; i < ppl_conf->count; i++) { in ppl_quiesce()
671 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_quiesce()
789 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover_entry() local
790 struct mddev *mddev = ppl_conf->mddev; in ppl_recover_entry()
792 int block_size = ppl_conf->block_size; in ppl_recover_entry()
968 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover() local
1023 ppl_conf->mismatch_count++; in ppl_recover()
1028 ppl_conf->recovered_entries++; in ppl_recover()
1060 pplhdr->signature = cpu_to_le32(log->ppl_conf->signature); in ppl_write_empty_header()
1076 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_load_distributed() local
1133 ppl_conf->signature = signature; in ppl_load_distributed()
1134 } else if (ppl_conf->signature != signature) { in ppl_load_distributed()
1136 __func__, signature, ppl_conf->signature, in ppl_load_distributed()
1165 ppl_conf->mismatch_count++; in ppl_load_distributed()
1183 __func__, ret, ppl_conf->mismatch_count, in ppl_load_distributed()
1184 ppl_conf->recovered_entries); in ppl_load_distributed()
1188 static int ppl_load(struct ppl_conf *ppl_conf) in ppl_load() argument
1195 for (i = 0; i < ppl_conf->count; i++) { in ppl_load()
1196 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_load()
1211 if (ppl_conf->mddev->external) { in ppl_load()
1213 signature = ppl_conf->signature; in ppl_load()
1215 } else if (signature != ppl_conf->signature) { in ppl_load()
1217 mdname(ppl_conf->mddev)); in ppl_load()
1225 __func__, ret, ppl_conf->mismatch_count, in ppl_load()
1226 ppl_conf->recovered_entries); in ppl_load()
1230 static void __ppl_exit_log(struct ppl_conf *ppl_conf) in __ppl_exit_log() argument
1232 clear_bit(MD_HAS_PPL, &ppl_conf->mddev->flags); in __ppl_exit_log()
1233 clear_bit(MD_HAS_MULTIPLE_PPLS, &ppl_conf->mddev->flags); in __ppl_exit_log()
1235 kfree(ppl_conf->child_logs); in __ppl_exit_log()
1237 bioset_exit(&ppl_conf->bs); in __ppl_exit_log()
1238 bioset_exit(&ppl_conf->flush_bs); in __ppl_exit_log()
1239 mempool_exit(&ppl_conf->io_pool); in __ppl_exit_log()
1240 kmem_cache_destroy(ppl_conf->io_kc); in __ppl_exit_log()
1242 kfree(ppl_conf); in __ppl_exit_log()
1247 struct ppl_conf *ppl_conf = conf->log_private; in ppl_exit_log() local
1249 if (ppl_conf) { in ppl_exit_log()
1250 __ppl_exit_log(ppl_conf); in ppl_exit_log()
1310 &log->ppl_conf->mddev->flags); in ppl_init_child_log()
1326 struct ppl_conf *ppl_conf; in ppl_init_log() local
1364 ppl_conf = kzalloc(sizeof(struct ppl_conf), GFP_KERNEL); in ppl_init_log()
1365 if (!ppl_conf) in ppl_init_log()
1368 ppl_conf->mddev = mddev; in ppl_init_log()
1370 ppl_conf->io_kc = KMEM_CACHE(ppl_io_unit, 0); in ppl_init_log()
1371 if (!ppl_conf->io_kc) { in ppl_init_log()
1376 ret = mempool_init(&ppl_conf->io_pool, conf->raid_disks, ppl_io_pool_alloc, in ppl_init_log()
1377 ppl_io_pool_free, ppl_conf->io_kc); in ppl_init_log()
1381 ret = bioset_init(&ppl_conf->bs, conf->raid_disks, 0, BIOSET_NEED_BVECS); in ppl_init_log()
1385 ret = bioset_init(&ppl_conf->flush_bs, conf->raid_disks, 0, 0); in ppl_init_log()
1389 ppl_conf->count = conf->raid_disks; in ppl_init_log()
1390 ppl_conf->child_logs = kcalloc(ppl_conf->count, sizeof(struct ppl_log), in ppl_init_log()
1392 if (!ppl_conf->child_logs) { in ppl_init_log()
1397 atomic64_set(&ppl_conf->seq, 0); in ppl_init_log()
1398 INIT_LIST_HEAD(&ppl_conf->no_mem_stripes); in ppl_init_log()
1399 spin_lock_init(&ppl_conf->no_mem_stripes_lock); in ppl_init_log()
1402 ppl_conf->signature = ~crc32c_le(~0, mddev->uuid, sizeof(mddev->uuid)); in ppl_init_log()
1403 ppl_conf->block_size = 512; in ppl_init_log()
1405 ppl_conf->block_size = queue_logical_block_size(mddev->queue); in ppl_init_log()
1408 for (i = 0; i < ppl_conf->count; i++) { in ppl_init_log()
1409 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_init_log()
1418 log->ppl_conf = ppl_conf; in ppl_init_log()
1431 ret = ppl_load(ppl_conf); in ppl_init_log()
1436 ppl_conf->recovered_entries > 0 && in ppl_init_log()
1437 ppl_conf->mismatch_count == 0) { in ppl_init_log()
1444 } else if (mddev->pers && ppl_conf->mismatch_count > 0) { in ppl_init_log()
1450 conf->log_private = ppl_conf; in ppl_init_log()
1451 set_bit(MD_HAS_PPL, &ppl_conf->mddev->flags); in ppl_init_log()
1455 __ppl_exit_log(ppl_conf); in ppl_init_log()
1461 struct ppl_conf *ppl_conf = conf->log_private; in ppl_modify_log() local
1475 if (rdev->raid_disk >= ppl_conf->count) in ppl_modify_log()
1478 log = &ppl_conf->child_logs[rdev->raid_disk]; in ppl_modify_log()