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_inc_return(&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()
632 GFP_NOIO, &ppl_conf->flush_bs); in ppl_do_flush()
664 struct ppl_conf *ppl_conf = conf->log_private; in ppl_quiesce() local
668 for (i = 0; i < ppl_conf->count; i++) { in ppl_quiesce()
669 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_quiesce()
787 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover_entry() local
788 struct mddev *mddev = ppl_conf->mddev; in ppl_recover_entry()
790 int block_size = ppl_conf->block_size; in ppl_recover_entry()
962 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover() local
1017 ppl_conf->mismatch_count++; in ppl_recover()
1022 ppl_conf->recovered_entries++; in ppl_recover()
1054 pplhdr->signature = cpu_to_le32(log->ppl_conf->signature); in ppl_write_empty_header()
1070 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_load_distributed() local
1127 ppl_conf->signature = signature; in ppl_load_distributed()
1128 } else if (ppl_conf->signature != signature) { in ppl_load_distributed()
1130 __func__, signature, ppl_conf->signature, in ppl_load_distributed()
1159 ppl_conf->mismatch_count++; in ppl_load_distributed()
1177 __func__, ret, ppl_conf->mismatch_count, in ppl_load_distributed()
1178 ppl_conf->recovered_entries); in ppl_load_distributed()
1182 static int ppl_load(struct ppl_conf *ppl_conf) in ppl_load() argument
1189 for (i = 0; i < ppl_conf->count; i++) { in ppl_load()
1190 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_load()
1205 if (ppl_conf->mddev->external) { in ppl_load()
1207 signature = ppl_conf->signature; in ppl_load()
1209 } else if (signature != ppl_conf->signature) { in ppl_load()
1211 mdname(ppl_conf->mddev)); in ppl_load()
1219 __func__, ret, ppl_conf->mismatch_count, in ppl_load()
1220 ppl_conf->recovered_entries); in ppl_load()
1224 static void __ppl_exit_log(struct ppl_conf *ppl_conf) in __ppl_exit_log() argument
1226 clear_bit(MD_HAS_PPL, &ppl_conf->mddev->flags); in __ppl_exit_log()
1227 clear_bit(MD_HAS_MULTIPLE_PPLS, &ppl_conf->mddev->flags); in __ppl_exit_log()
1229 kfree(ppl_conf->child_logs); in __ppl_exit_log()
1231 bioset_exit(&ppl_conf->bs); in __ppl_exit_log()
1232 bioset_exit(&ppl_conf->flush_bs); in __ppl_exit_log()
1233 mempool_exit(&ppl_conf->io_pool); in __ppl_exit_log()
1234 kmem_cache_destroy(ppl_conf->io_kc); in __ppl_exit_log()
1236 kfree(ppl_conf); in __ppl_exit_log()
1241 struct ppl_conf *ppl_conf = conf->log_private; in ppl_exit_log() local
1243 if (ppl_conf) { in ppl_exit_log()
1244 __ppl_exit_log(ppl_conf); in ppl_exit_log()
1302 &log->ppl_conf->mddev->flags); in ppl_init_child_log()
1317 struct ppl_conf *ppl_conf; in ppl_init_log() local
1355 ppl_conf = kzalloc_obj(struct ppl_conf); in ppl_init_log()
1356 if (!ppl_conf) in ppl_init_log()
1359 ppl_conf->mddev = mddev; in ppl_init_log()
1361 ppl_conf->io_kc = KMEM_CACHE(ppl_io_unit, 0); in ppl_init_log()
1362 if (!ppl_conf->io_kc) { in ppl_init_log()
1367 ret = mempool_init(&ppl_conf->io_pool, conf->raid_disks, ppl_io_pool_alloc, in ppl_init_log()
1368 ppl_io_pool_free, ppl_conf->io_kc); in ppl_init_log()
1372 ret = bioset_init(&ppl_conf->bs, conf->raid_disks, 0, BIOSET_NEED_BVECS); in ppl_init_log()
1376 ret = bioset_init(&ppl_conf->flush_bs, conf->raid_disks, 0, 0); in ppl_init_log()
1380 ppl_conf->count = conf->raid_disks; in ppl_init_log()
1381 ppl_conf->child_logs = kzalloc_objs(struct ppl_log, ppl_conf->count); in ppl_init_log()
1382 if (!ppl_conf->child_logs) { in ppl_init_log()
1387 atomic64_set(&ppl_conf->seq, 0); in ppl_init_log()
1388 INIT_LIST_HEAD(&ppl_conf->no_mem_stripes); in ppl_init_log()
1389 spin_lock_init(&ppl_conf->no_mem_stripes_lock); in ppl_init_log()
1392 ppl_conf->signature = ~crc32c(~0, mddev->uuid, sizeof(mddev->uuid)); in ppl_init_log()
1393 ppl_conf->block_size = 512; in ppl_init_log()
1395 ppl_conf->block_size = in ppl_init_log()
1399 for (i = 0; i < ppl_conf->count; i++) { in ppl_init_log()
1400 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_init_log()
1407 log->ppl_conf = ppl_conf; in ppl_init_log()
1420 ret = ppl_load(ppl_conf); in ppl_init_log()
1425 ppl_conf->recovered_entries > 0 && in ppl_init_log()
1426 ppl_conf->mismatch_count == 0) { in ppl_init_log()
1433 } else if (mddev->pers && ppl_conf->mismatch_count > 0) { in ppl_init_log()
1439 conf->log_private = ppl_conf; in ppl_init_log()
1440 set_bit(MD_HAS_PPL, &ppl_conf->mddev->flags); in ppl_init_log()
1444 __ppl_exit_log(ppl_conf); in ppl_init_log()
1450 struct ppl_conf *ppl_conf = conf->log_private; in ppl_modify_log() local
1464 if (rdev->raid_disk >= ppl_conf->count) in ppl_modify_log()
1467 log = &ppl_conf->child_logs[rdev->raid_disk]; in ppl_modify_log()