Lines Matching refs:ppl_conf
95 struct ppl_conf { struct
122 struct ppl_conf *ppl_conf; /* shared between all log instances */ argument
242 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_new_iounit() local
247 io = mempool_alloc(&ppl_conf->io_pool, GFP_NOWAIT); in ppl_new_iounit()
265 pplhdr->signature = cpu_to_le32(ppl_conf->signature); in ppl_new_iounit()
267 io->seq = atomic64_add_return(1, &ppl_conf->seq); in ppl_new_iounit()
369 struct ppl_conf *ppl_conf = conf->log_private; in ppl_write_stripe() local
380 log = &ppl_conf->child_logs[sh->pd_idx]; in ppl_write_stripe()
394 spin_lock_irq(&ppl_conf->no_mem_stripes_lock); in ppl_write_stripe()
395 list_add_tail(&sh->log_list, &ppl_conf->no_mem_stripes); in ppl_write_stripe()
396 spin_unlock_irq(&ppl_conf->no_mem_stripes_lock); in ppl_write_stripe()
408 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_log_endio() local
414 md_error(ppl_conf->mddev, log->rdev); in ppl_log_endio()
439 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_submit_iounit() local
460 ilog2(ppl_conf->block_size >> 9)); in ppl_submit_iounit()
492 if ((ppl_conf->child_logs[i].wb_cache_on) && in ppl_submit_iounit()
506 &ppl_conf->bs); in ppl_submit_iounit()
545 struct ppl_conf *ppl_conf = conf->log_private; in ppl_write_stripe_run() local
549 for (i = 0; i < ppl_conf->count; i++) { in ppl_write_stripe_run()
550 log = &ppl_conf->child_logs[i]; in ppl_write_stripe_run()
561 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_io_unit_finished() local
562 struct r5conf *conf = ppl_conf->mddev->private; in ppl_io_unit_finished()
573 mempool_free(io, &ppl_conf->io_pool); in ppl_io_unit_finished()
575 spin_lock(&ppl_conf->no_mem_stripes_lock); in ppl_io_unit_finished()
576 if (!list_empty(&ppl_conf->no_mem_stripes)) { in ppl_io_unit_finished()
579 sh = list_first_entry(&ppl_conf->no_mem_stripes, in ppl_io_unit_finished()
585 spin_unlock(&ppl_conf->no_mem_stripes_lock); in ppl_io_unit_finished()
596 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_flush_endio() local
597 struct r5conf *conf = ppl_conf->mddev->private; in ppl_flush_endio()
623 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_do_flush() local
624 struct r5conf *conf = ppl_conf->mddev->private; in ppl_do_flush()
645 bio = bio_alloc_bioset(GFP_NOIO, 0, &ppl_conf->flush_bs); in ppl_do_flush()
680 struct ppl_conf *ppl_conf = conf->log_private; in ppl_quiesce() local
684 for (i = 0; i < ppl_conf->count; i++) { in ppl_quiesce()
685 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_quiesce()
803 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover_entry() local
804 struct mddev *mddev = ppl_conf->mddev; in ppl_recover_entry()
806 int block_size = ppl_conf->block_size; in ppl_recover_entry()
978 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover() local
1033 ppl_conf->mismatch_count++; in ppl_recover()
1038 ppl_conf->recovered_entries++; in ppl_recover()
1070 pplhdr->signature = cpu_to_le32(log->ppl_conf->signature); in ppl_write_empty_header()
1086 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_load_distributed() local
1143 ppl_conf->signature = signature; in ppl_load_distributed()
1144 } else if (ppl_conf->signature != signature) { in ppl_load_distributed()
1146 __func__, signature, ppl_conf->signature, in ppl_load_distributed()
1177 ppl_conf->mismatch_count++; in ppl_load_distributed()
1195 __func__, ret, ppl_conf->mismatch_count, in ppl_load_distributed()
1196 ppl_conf->recovered_entries); in ppl_load_distributed()
1200 static int ppl_load(struct ppl_conf *ppl_conf) in ppl_load() argument
1207 for (i = 0; i < ppl_conf->count; i++) { in ppl_load()
1208 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_load()
1223 if (ppl_conf->mddev->external) { in ppl_load()
1225 signature = ppl_conf->signature; in ppl_load()
1227 } else if (signature != ppl_conf->signature) { in ppl_load()
1229 mdname(ppl_conf->mddev)); in ppl_load()
1237 __func__, ret, ppl_conf->mismatch_count, in ppl_load()
1238 ppl_conf->recovered_entries); in ppl_load()
1242 static void __ppl_exit_log(struct ppl_conf *ppl_conf) in __ppl_exit_log() argument
1244 clear_bit(MD_HAS_PPL, &ppl_conf->mddev->flags); in __ppl_exit_log()
1245 clear_bit(MD_HAS_MULTIPLE_PPLS, &ppl_conf->mddev->flags); in __ppl_exit_log()
1247 kfree(ppl_conf->child_logs); in __ppl_exit_log()
1249 bioset_exit(&ppl_conf->bs); in __ppl_exit_log()
1250 bioset_exit(&ppl_conf->flush_bs); in __ppl_exit_log()
1251 mempool_exit(&ppl_conf->io_pool); in __ppl_exit_log()
1252 kmem_cache_destroy(ppl_conf->io_kc); in __ppl_exit_log()
1254 kfree(ppl_conf); in __ppl_exit_log()
1259 struct ppl_conf *ppl_conf = conf->log_private; in ppl_exit_log() local
1261 if (ppl_conf) { in ppl_exit_log()
1262 __ppl_exit_log(ppl_conf); in ppl_exit_log()
1322 &log->ppl_conf->mddev->flags); in ppl_init_child_log()
1338 struct ppl_conf *ppl_conf; in ppl_init_log() local
1376 ppl_conf = kzalloc(sizeof(struct ppl_conf), GFP_KERNEL); in ppl_init_log()
1377 if (!ppl_conf) in ppl_init_log()
1380 ppl_conf->mddev = mddev; in ppl_init_log()
1382 ppl_conf->io_kc = KMEM_CACHE(ppl_io_unit, 0); in ppl_init_log()
1383 if (!ppl_conf->io_kc) { in ppl_init_log()
1388 ret = mempool_init(&ppl_conf->io_pool, conf->raid_disks, ppl_io_pool_alloc, in ppl_init_log()
1389 ppl_io_pool_free, ppl_conf->io_kc); in ppl_init_log()
1393 ret = bioset_init(&ppl_conf->bs, conf->raid_disks, 0, BIOSET_NEED_BVECS); in ppl_init_log()
1397 ret = bioset_init(&ppl_conf->flush_bs, conf->raid_disks, 0, 0); in ppl_init_log()
1401 ppl_conf->count = conf->raid_disks; in ppl_init_log()
1402 ppl_conf->child_logs = kcalloc(ppl_conf->count, sizeof(struct ppl_log), in ppl_init_log()
1404 if (!ppl_conf->child_logs) { in ppl_init_log()
1409 atomic64_set(&ppl_conf->seq, 0); in ppl_init_log()
1410 INIT_LIST_HEAD(&ppl_conf->no_mem_stripes); in ppl_init_log()
1411 spin_lock_init(&ppl_conf->no_mem_stripes_lock); in ppl_init_log()
1414 ppl_conf->signature = ~crc32c_le(~0, mddev->uuid, sizeof(mddev->uuid)); in ppl_init_log()
1415 ppl_conf->block_size = 512; in ppl_init_log()
1417 ppl_conf->block_size = queue_logical_block_size(mddev->queue); in ppl_init_log()
1420 for (i = 0; i < ppl_conf->count; i++) { in ppl_init_log()
1421 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_init_log()
1428 log->ppl_conf = ppl_conf; in ppl_init_log()
1441 ret = ppl_load(ppl_conf); in ppl_init_log()
1446 ppl_conf->recovered_entries > 0 && in ppl_init_log()
1447 ppl_conf->mismatch_count == 0) { in ppl_init_log()
1454 } else if (mddev->pers && ppl_conf->mismatch_count > 0) { in ppl_init_log()
1460 conf->log_private = ppl_conf; in ppl_init_log()
1461 set_bit(MD_HAS_PPL, &ppl_conf->mddev->flags); in ppl_init_log()
1465 __ppl_exit_log(ppl_conf); in ppl_init_log()
1471 struct ppl_conf *ppl_conf = conf->log_private; in ppl_modify_log() local
1486 if (rdev->raid_disk >= ppl_conf->count) in ppl_modify_log()
1489 log = &ppl_conf->child_logs[rdev->raid_disk]; in ppl_modify_log()