Lines Matching refs:log

136 	struct ppl_log *log;  member
232 static struct ppl_io_unit *ppl_new_iounit(struct ppl_log *log, in ppl_new_iounit() argument
235 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_new_iounit()
248 io->log = log; in ppl_new_iounit()
253 bio_init(&io->bio, log->rdev->bdev, io->biovec, PPL_IO_INLINE_BVECS, in ppl_new_iounit()
267 static int ppl_log_stripe(struct ppl_log *log, struct stripe_head *sh) in ppl_log_stripe() argument
269 struct ppl_io_unit *io = log->current_io; in ppl_log_stripe()
280 if (io && (io->pp_size == log->entry_space || in ppl_log_stripe()
289 io = ppl_new_iounit(log, sh); in ppl_log_stripe()
292 spin_lock_irq(&log->io_list_lock); in ppl_log_stripe()
293 list_add_tail(&io->log_sibling, &log->io_list); in ppl_log_stripe()
294 spin_unlock_irq(&log->io_list_lock); in ppl_log_stripe()
296 log->current_io = io; in ppl_log_stripe()
365 struct ppl_log *log; in ppl_write_stripe() local
374 log = &ppl_conf->child_logs[sh->pd_idx]; in ppl_write_stripe()
376 mutex_lock(&log->io_mutex); in ppl_write_stripe()
378 if (!log->rdev || test_bit(Faulty, &log->rdev->flags)) { in ppl_write_stripe()
379 mutex_unlock(&log->io_mutex); in ppl_write_stripe()
387 if (ppl_log_stripe(log, sh)) { in ppl_write_stripe()
393 mutex_unlock(&log->io_mutex); in ppl_write_stripe()
401 struct ppl_log *log = io->log; in ppl_log_endio() local
402 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_log_endio()
408 md_error(ppl_conf->mddev, log->rdev); in ppl_log_endio()
430 struct ppl_log *log = io->log; in ppl_submit_iounit() local
431 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_submit_iounit()
439 if (!log->rdev || test_bit(Faulty, &log->rdev->flags)) { in ppl_submit_iounit()
460 if (log->use_multippl && in ppl_submit_iounit()
461 log->rdev->ppl.sector + log->rdev->ppl.size - log->next_io_sector < in ppl_submit_iounit()
463 log->next_io_sector = log->rdev->ppl.sector; in ppl_submit_iounit()
467 bio->bi_iter.bi_sector = log->next_io_sector; in ppl_submit_iounit()
471 (unsigned long long)log->next_io_sector); in ppl_submit_iounit()
473 if (log->use_multippl) in ppl_submit_iounit()
474 log->next_io_sector += (PPL_HEADER_SIZE + io->pp_size) >> 9; in ppl_submit_iounit()
476 WARN_ON(log->disk_flush_bitmap != 0); in ppl_submit_iounit()
484 set_bit(i, &log->disk_flush_bitmap); in ppl_submit_iounit()
509 static void ppl_submit_current_io(struct ppl_log *log) in ppl_submit_current_io() argument
513 spin_lock_irq(&log->io_list_lock); in ppl_submit_current_io()
515 io = list_first_entry_or_null(&log->io_list, struct ppl_io_unit, in ppl_submit_current_io()
520 spin_unlock_irq(&log->io_list_lock); in ppl_submit_current_io()
525 if (io == log->current_io) in ppl_submit_current_io()
526 log->current_io = NULL; in ppl_submit_current_io()
535 struct ppl_log *log; in ppl_write_stripe_run() local
539 log = &ppl_conf->child_logs[i]; in ppl_write_stripe_run()
541 mutex_lock(&log->io_mutex); in ppl_write_stripe_run()
542 ppl_submit_current_io(log); in ppl_write_stripe_run()
543 mutex_unlock(&log->io_mutex); in ppl_write_stripe_run()
549 struct ppl_log *log = io->log; in ppl_io_unit_finished() local
550 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_io_unit_finished()
558 spin_lock(&log->io_list_lock); in ppl_io_unit_finished()
560 spin_unlock(&log->io_list_lock); in ppl_io_unit_finished()
584 struct ppl_log *log = io->log; in ppl_flush_endio() local
585 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_flush_endio()
610 struct ppl_log *log = io->log; in ppl_do_flush() local
611 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_do_flush()
619 for_each_set_bit(i, &log->disk_flush_bitmap, raid_disks) { in ppl_do_flush()
645 log->disk_flush_bitmap = 0; in ppl_do_flush()
654 struct ppl_log *log) in ppl_no_io_unit_submitted() argument
658 io = list_first_entry_or_null(&log->io_list, struct ppl_io_unit, in ppl_no_io_unit_submitted()
671 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_quiesce() local
673 spin_lock_irq(&log->io_list_lock); in ppl_quiesce()
675 ppl_no_io_unit_submitted(conf, log), in ppl_quiesce()
676 log->io_list_lock); in ppl_quiesce()
677 spin_unlock_irq(&log->io_list_lock); in ppl_quiesce()
700 if (io->log->disk_flush_bitmap) in ppl_stripe_write_finished()
786 static int ppl_recover_entry(struct ppl_log *log, struct ppl_header_entry *e, in ppl_recover_entry() argument
789 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover_entry()
920 if (!sync_page_io(log->rdev, in ppl_recover_entry()
921 ppl_sector - log->rdev->data_offset + i, in ppl_recover_entry()
926 md_error(mddev, log->rdev); in ppl_recover_entry()
943 BUG_ON(parity_rdev->bdev->bd_dev != log->rdev->bdev->bd_dev); in ppl_recover_entry()
965 static int ppl_recover(struct ppl_log *log, struct ppl_header *pplhdr, in ppl_recover() argument
968 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_recover()
969 struct md_rdev *rdev = log->rdev; in ppl_recover()
1025 ret = ppl_recover_entry(log, e, ppl_sector); in ppl_recover()
1041 static int ppl_write_empty_header(struct ppl_log *log) in ppl_write_empty_header() argument
1045 struct md_rdev *rdev = log->rdev; in ppl_write_empty_header()
1058 log->rdev->ppl.size, GFP_NOIO, 0); in ppl_write_empty_header()
1060 pplhdr->signature = cpu_to_le32(log->ppl_conf->signature); in ppl_write_empty_header()
1074 static int ppl_load_distributed(struct ppl_log *log) in ppl_load_distributed() argument
1076 struct ppl_conf *ppl_conf = log->ppl_conf; in ppl_load_distributed()
1077 struct md_rdev *rdev = log->rdev; in ppl_load_distributed()
1173 ret = ppl_recover(log, pplhdr, pplhdr_offset); in ppl_load_distributed()
1177 ret = ppl_write_empty_header(log); in ppl_load_distributed()
1196 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_load() local
1199 if (!log->rdev) in ppl_load()
1202 ret = ppl_load_distributed(log); in ppl_load()
1302 static void ppl_init_child_log(struct ppl_log *log, struct md_rdev *rdev) in ppl_init_child_log() argument
1308 log->use_multippl = true; in ppl_init_child_log()
1310 &log->ppl_conf->mddev->flags); in ppl_init_child_log()
1311 log->entry_space = PPL_SPACE_SIZE; in ppl_init_child_log()
1313 log->use_multippl = false; in ppl_init_child_log()
1314 log->entry_space = (log->rdev->ppl.size << 9) - in ppl_init_child_log()
1317 log->next_io_sector = rdev->ppl.sector; in ppl_init_child_log()
1321 log->wb_cache_on = true; in ppl_init_child_log()
1409 struct ppl_log *log = &ppl_conf->child_logs[i]; in ppl_init_log() local
1414 mutex_init(&log->io_mutex); in ppl_init_log()
1415 spin_lock_init(&log->io_list_lock); in ppl_init_log()
1416 INIT_LIST_HEAD(&log->io_list); in ppl_init_log()
1418 log->ppl_conf = ppl_conf; in ppl_init_log()
1419 log->rdev = rdev; in ppl_init_log()
1426 ppl_init_child_log(log, rdev); in ppl_init_log()
1462 struct ppl_log *log; in ppl_modify_log() local
1478 log = &ppl_conf->child_logs[rdev->raid_disk]; in ppl_modify_log()
1480 mutex_lock(&log->io_mutex); in ppl_modify_log()
1484 log->rdev = rdev; in ppl_modify_log()
1485 ret = ppl_write_empty_header(log); in ppl_modify_log()
1486 ppl_init_child_log(log, rdev); in ppl_modify_log()
1489 log->rdev = NULL; in ppl_modify_log()
1491 mutex_unlock(&log->io_mutex); in ppl_modify_log()