Lines Matching refs:rl

190 	runlist_element *rl;
663 static void rl_set(runlist *rl, VCN vcn, LCN lcn, s64 len)
665 rl->vcn = vcn;
666 rl->lcn = lcn;
667 rl->length = len;
670 static int rl_items(runlist *rl)
674 while (rl[i++].length)
687 static void dump_runlist(runlist *rl)
689 while (rl->length)
690 dump_run(rl++);
709 static void collect_resize_constraints(ntfs_resize_t *resize, runlist *rl)
717 last_lcn = rl->lcn + (rl->length - 1);
756 if (rl[1].length != 0 || rl->vcn)
776 static void collect_relocation_info(ntfs_resize_t *resize, runlist *rl)
781 lcn = rl->lcn;
782 lcn_length = rl->length;
831 runlist *rl;
841 if (!(rl = ntfs_mapping_pairs_decompress(vol, a, NULL))) {
850 for (i = 0; rl[i].length; i++) {
851 s64 lcn = rl[i].lcn;
852 s64 lcn_length = rl[i].length;
892 free(rl);
1108 runlist *rl;
1113 if (!(rl = ntfs_mapping_pairs_decompress(resize->vol,
1117 for (i = 0; rl[i].length; i++) {
1119 if (rl[i].lcn == LCN_HOLE || rl[i].lcn == LCN_RL_NOT_MAPPED)
1122 collect_resize_constraints(resize, rl + i);
1124 collect_relocation_info(resize, rl + i);
1126 free(rl);
1175 static void rl_fixup(runlist **rl)
1177 runlist *tmp = *rl;
1186 (*rl)++;
1187 for (tmp = *rl; tmp->length; tmp++)
1191 for (tmp = *rl; tmp->length; tmp++) {
1226 while (na->rl[oldcnt].length)
1236 pold = na->rl;
1285 free(na->rl);
1286 na->rl = newrl;
1324 runlist_element *rl;
1333 rl = delayed->rl;
1352 if (replace_runlist(na,rl,delayed->lowest_vcn)
1543 static void replace_later(ntfs_resize_t *resize, runlist *rl, runlist *head_rl)
1575 delayed->rl = rl;
1607 static int replace_attribute_runlist(ntfs_resize_t *resize, runlist *rl)
1620 head_rl = rl;
1621 rl_fixup(&rl);
1623 if ((mp_size = ntfs_get_size_for_mapping_pairs(vol, rl, 0, INT_MAX)) == -1)
1672 replace_later(resize,rl,head_rl);
1686 if (ntfs_mapping_pairs_build(vol, (u8*)mp, mp_size, rl, 0, NULL))
1702 static void set_bitmap_clusters(struct bitmap *bm, runlist *rl, u8 bit)
1704 for (; rl->length; rl++)
1705 set_bitmap_range(bm, rl->lcn, rl->length, bit);
1708 static void release_bitmap_clusters(struct bitmap *bm, runlist *rl)
1711 set_bitmap_clusters(bm, rl, 0);
1785 runlist *rl = NULL;
1803 if (!(rl = (runlist *)realloc(rl, rl_size)))
1806 rl_set(rl + runs, vcn, rle.lcn, rle.length);
1813 rl_set(rl + runs, vcn, -1LL, 0LL);
1817 dump_runlist(rl);
1819 return rl;
1944 static void rl_split_run(runlist **rl, int run, s64 pos)
1950 items = rl_items(*rl);
1960 rle = *rl + run;
1962 memmove(rl_new, *rl, size_head);
1974 free(*rl);
1975 *rl = rl_new;
1978 static void rl_insert_at_run(runlist **rl, int run, runlist *ins)
1985 items = rl_items(*rl);
1990 if (!(*rl = (runlist *)realloc(*rl, new_size)))
1993 rle = *rl + run;
2005 // (*rl + run)->lcn = ins->lcn;
2008 static void relocate_run(ntfs_resize_t *resize, runlist **rl, int run)
2015 lcn = (*rl + run)->lcn;
2016 lcn_length = (*rl + run)->length;
2023 rl_split_run(rl, run, new_vol_size);
2045 (unsigned long long)(*rl + run)->vcn,
2050 rl_insert_at_run(rl, run, relocate_rl);
2068 runlist *rl;
2076 if (!(rl = ntfs_mapping_pairs_decompress(resize->vol, a, NULL)))
2079 for (i = 0; rl[i].length; i++) {
2080 s64 lcn = rl[i].lcn;
2081 s64 lcn_length = rl[i].length;
2094 relocate_run(resize, &rl, i);
2098 if (!replace_attribute_runlist(resize, rl))
2099 free(rl);
2102 free(rl);
2272 if (!resize->vol->mft_na->rl)
2275 if ((resize->vol->mft_na->rl->lcn + resize->vol->mft_na->rl->length)
2285 length = resize->vol->mft_na->rl->length;
2407 if (ntfs_attr_map_whole_runlist(na) || !na->rl) {
2466 runlist **rl,
2475 if (!(*rl = ntfs_mapping_pairs_decompress(vol, a, NULL)))
2478 release_bitmap_clusters(bm, *rl);
2479 free(*rl);
2484 if (!(*rl = alloc_cluster(bm, nr_bm_clusters, new_size, 0)))
2506 runlist *rl;
2522 realloc_bitmap_data_attr(resize, &rl, nr_bm_clusters);
2526 realloc_bitmap_data_attr(resize, &rl, nr_bm_clusters);
2544 truncated = !replace_attribute_runlist(resize, rl);
2551 size = ntfs_rl_pwrite(vol, rl, 0, 0, bm_bsize, resize->lcn_bitmap.bm);
2561 free(lcnbmp_na->rl);
2562 lcnbmp_na->rl = rl;
2615 runlist *rl;
2627 rl = na->rl;
2628 for (i = 0; rl[i].length; i++) {
2630 if (rl[i].lcn == LCN_HOLE || rl[i].lcn == LCN_RL_NOT_MAPPED)
2633 badclusters += rl[i].length;
2635 (long long)rl[i].lcn,
2636 (long long)rl[i].lcn + rl[i].length - 1,
2637 (long long)rl[i].length);
2782 vol->mft_na->rl->lcn, r->mftmir_rl.length);
3251 runlist_element *rl;
3266 // rl in extent not implemented
3267 rl = ntfs_mapping_pairs_decompress(expand->vol, a,
3270 if (rl && expand->mft_bitmap) {
3271 for (prl=rl; prl->length && ok; prl++) {
3283 free(rl);
3300 runlist *rl;
3318 rl = ntfs_mapping_pairs_decompress(expand->vol, a, NULL);
3319 if (!rl) {
3324 for (i = 0; rl[i].length; i++) {
3326 if (rl[i].lcn == LCN_HOLE
3327 || rl[i].lcn == LCN_RL_NOT_MAPPED)
3330 badclusters += rl[i].length;
3333 (long long)rl[i].lcn,
3334 (long long)rl[i].lcn
3335 + rl[i].length - 1,
3336 (long long)rl[i].length);
3355 free(rl);
3372 runlist_element *rl;
3388 rl = ntfs_mapping_pairs_decompress(expand->vol, a, NULL);
3389 if (!rl || !rl[0].length || rl[1].length) {
3393 free(rl);
3398 rl = ntfs_mapping_pairs_decompress(expand->vol, a, NULL);
3399 if (!rl || !rl[0].length || rl[1].length) {
3403 free(rl);
3581 static int set_bitmap(expand_t *expand, runlist_element *rl)
3590 if ((rl->lcn >= 0)
3591 && (rl->length > 0)
3592 && ((rl->lcn + rl->length)
3594 lcn = rl->lcn;
3595 lcn_end = lcn + rl->length;
3617 (long long)rl->lcn,(long long)rl->length);
3622 (long long)rl->lcn,(long long)rl->length);
3902 ATTR_RECORD *a, runlist_element *rl)
3916 head_rl = rl;
3917 rl_fixup(&rl);
3918 if ((mp_size = ntfs_get_size_for_mapping_pairs(vol, rl,
3973 replace_later(&resize,rl,head_rl);
3988 if (ntfs_mapping_pairs_build(vol, (u8*)mp, mp_size, rl, 0, NULL))
4030 runlist_element *rl;
4042 rl = ntfs_mapping_pairs_decompress(expand->vol, a,
4044 if (rl) {
4045 for (prl=rl; prl->length; prl++)
4051 if (update_runlist(expand,inum,a,rl)) {
4054 free(rl);
4079 runlist_element *rl;
4128 rl = ntfs_mapping_pairs_decompress(vol, a,
4130 if (rl) {
4132 for (prl=rl; prl->length; prl++)
4143 old_rl = rl;
4144 rl = new_rl;
4146 rl[0].vcn = 0;
4147 rl[0].lcn = lcn;
4148 rl[0].length = lth;
4149 rl[1].vcn = lth;
4150 rl[1].lcn = LCN_ENOENT;
4151 rl[1].length = 0;
4152 if (set_bitmap(expand,rl))
4164 old_rl = rl;
4166 prl = rl;
4180 if (!res && update_runlist(expand,inum,a,rl))
4183 free(rl);
4211 runlist_element *rl;
4229 rl = rebase_runlists_meta(expand, inum);
4230 if (rl)
4231 free(rl);