Lines Matching refs:l_mg
542 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in pblk_line_mg_free() local
545 kfree(l_mg->bb_template); in pblk_line_mg_free()
546 kfree(l_mg->bb_aux); in pblk_line_mg_free()
547 kfree(l_mg->vsc_list); in pblk_line_mg_free()
550 kfree(l_mg->sline_meta[i]); in pblk_line_mg_free()
551 kvfree(l_mg->eline_meta[i]->buf); in pblk_line_mg_free()
552 kfree(l_mg->eline_meta[i]); in pblk_line_mg_free()
555 mempool_destroy(l_mg->bitmap_pool); in pblk_line_mg_free()
556 kmem_cache_destroy(l_mg->bitmap_cache); in pblk_line_mg_free()
559 static void pblk_line_meta_free(struct pblk_line_mgmt *l_mg, in pblk_line_meta_free() argument
574 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in pblk_lines_free() local
578 for (i = 0; i < l_mg->nr_lines; i++) { in pblk_lines_free()
582 pblk_line_meta_free(l_mg, line); in pblk_lines_free()
628 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in calc_emeta_len() local
644 lm->emeta_sec[3] = DIV_ROUND_UP(l_mg->nr_lines * sizeof(u32), in calc_emeta_len()
648 lm->vsc_list_len = l_mg->nr_lines * sizeof(u32); in calc_emeta_len()
656 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in pblk_set_provision() local
697 sec_meta = (lm->smeta_sec + lm->emeta_sec[0]) * l_mg->nr_free_lines; in pblk_set_provision()
759 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in pblk_setup_line_meta() local
768 line->vsc = &l_mg->vsc_list[line_id]; in pblk_setup_line_meta()
777 list_add_tail(&line->list, &l_mg->bad_list); in pblk_setup_line_meta()
782 list_add_tail(&line->list, &l_mg->free_list); in pblk_setup_line_meta()
783 l_mg->nr_free_lines++; in pblk_setup_line_meta()
825 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in pblk_line_mg_init() local
829 l_mg->nr_lines = geo->num_chk; in pblk_line_mg_init()
830 l_mg->log_line = l_mg->data_line = NULL; in pblk_line_mg_init()
831 l_mg->l_seq_nr = l_mg->d_seq_nr = 0; in pblk_line_mg_init()
832 l_mg->nr_free_lines = 0; in pblk_line_mg_init()
833 bitmap_zero(&l_mg->meta_bitmap, PBLK_DATA_LINES); in pblk_line_mg_init()
835 INIT_LIST_HEAD(&l_mg->free_list); in pblk_line_mg_init()
836 INIT_LIST_HEAD(&l_mg->corrupt_list); in pblk_line_mg_init()
837 INIT_LIST_HEAD(&l_mg->bad_list); in pblk_line_mg_init()
838 INIT_LIST_HEAD(&l_mg->gc_full_list); in pblk_line_mg_init()
839 INIT_LIST_HEAD(&l_mg->gc_high_list); in pblk_line_mg_init()
840 INIT_LIST_HEAD(&l_mg->gc_mid_list); in pblk_line_mg_init()
841 INIT_LIST_HEAD(&l_mg->gc_low_list); in pblk_line_mg_init()
842 INIT_LIST_HEAD(&l_mg->gc_empty_list); in pblk_line_mg_init()
843 INIT_LIST_HEAD(&l_mg->gc_werr_list); in pblk_line_mg_init()
845 INIT_LIST_HEAD(&l_mg->emeta_list); in pblk_line_mg_init()
847 l_mg->gc_lists[0] = &l_mg->gc_werr_list; in pblk_line_mg_init()
848 l_mg->gc_lists[1] = &l_mg->gc_high_list; in pblk_line_mg_init()
849 l_mg->gc_lists[2] = &l_mg->gc_mid_list; in pblk_line_mg_init()
850 l_mg->gc_lists[3] = &l_mg->gc_low_list; in pblk_line_mg_init()
852 spin_lock_init(&l_mg->free_lock); in pblk_line_mg_init()
853 spin_lock_init(&l_mg->close_lock); in pblk_line_mg_init()
854 spin_lock_init(&l_mg->gc_lock); in pblk_line_mg_init()
856 l_mg->vsc_list = kcalloc(l_mg->nr_lines, sizeof(__le32), GFP_KERNEL); in pblk_line_mg_init()
857 if (!l_mg->vsc_list) in pblk_line_mg_init()
860 l_mg->bb_template = kzalloc(lm->sec_bitmap_len, GFP_KERNEL); in pblk_line_mg_init()
861 if (!l_mg->bb_template) in pblk_line_mg_init()
864 l_mg->bb_aux = kzalloc(lm->sec_bitmap_len, GFP_KERNEL); in pblk_line_mg_init()
865 if (!l_mg->bb_aux) in pblk_line_mg_init()
872 l_mg->sline_meta[i] = kmalloc(lm->smeta_len, GFP_KERNEL); in pblk_line_mg_init()
873 if (!l_mg->sline_meta[i]) in pblk_line_mg_init()
877 l_mg->bitmap_cache = kmem_cache_create("pblk_lm_bitmap", in pblk_line_mg_init()
879 if (!l_mg->bitmap_cache) in pblk_line_mg_init()
883 l_mg->bitmap_pool = mempool_create_slab_pool(PBLK_DATA_LINES * 2, in pblk_line_mg_init()
884 l_mg->bitmap_cache); in pblk_line_mg_init()
885 if (!l_mg->bitmap_pool) in pblk_line_mg_init()
905 l_mg->eline_meta[i] = emeta; in pblk_line_mg_init()
908 for (i = 0; i < l_mg->nr_lines; i++) in pblk_line_mg_init()
909 l_mg->vsc_list[i] = cpu_to_le32(EMPTY_ENTRY); in pblk_line_mg_init()
913 bitmap_set(l_mg->bb_template, i, geo->ws_opt); in pblk_line_mg_init()
919 kvfree(l_mg->eline_meta[i]->buf); in pblk_line_mg_init()
920 kfree(l_mg->eline_meta[i]); in pblk_line_mg_init()
923 mempool_destroy(l_mg->bitmap_pool); in pblk_line_mg_init()
925 kmem_cache_destroy(l_mg->bitmap_cache); in pblk_line_mg_init()
928 kfree(l_mg->sline_meta[i]); in pblk_line_mg_init()
929 kfree(l_mg->bb_aux); in pblk_line_mg_init()
931 kfree(l_mg->bb_template); in pblk_line_mg_init()
933 kfree(l_mg->vsc_list); in pblk_line_mg_init()
1001 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in pblk_lines_init() local
1025 pblk->lines = kcalloc(l_mg->nr_lines, sizeof(struct pblk_line), in pblk_lines_init()
1032 for (i = 0; i < l_mg->nr_lines; i++) { in pblk_lines_init()
1060 pblk_line_meta_free(l_mg, &pblk->lines[i]); in pblk_lines_init()
1258 geo->all_luns, pblk->l_mg.nr_lines, in pblk_init()