Lines Matching refs:drl
531 runlist_element *ntfs_runlists_merge(runlist_element *drl, in ntfs_runlists_merge() argument
545 ntfs_debug_dump_runlist(drl); in ntfs_runlists_merge()
552 return drl; in ntfs_runlists_merge()
553 if (IS_ERR(srl) || IS_ERR(drl)) in ntfs_runlists_merge()
557 if (unlikely(!drl)) { in ntfs_runlists_merge()
558 drl = srl; in ntfs_runlists_merge()
560 if (unlikely(drl[0].vcn)) { in ntfs_runlists_merge()
562 for (dend = 0; likely(drl[dend].length); dend++) in ntfs_runlists_merge()
565 drl = ntfs_rl_realloc(drl, dend, dend + 1); in ntfs_runlists_merge()
566 if (IS_ERR(drl)) in ntfs_runlists_merge()
567 return drl; in ntfs_runlists_merge()
569 ntfs_rl_mm(drl, 1, 0, dend); in ntfs_runlists_merge()
570 drl[0].vcn = 0; in ntfs_runlists_merge()
571 drl[0].lcn = LCN_RL_NOT_MAPPED; in ntfs_runlists_merge()
572 drl[0].length = drl[1].vcn; in ntfs_runlists_merge()
594 for (; drl[di].length; di++) { in ntfs_runlists_merge()
595 if (drl[di].vcn + drl[di].length > srl[sstart].vcn) in ntfs_runlists_merge()
601 if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) && in ntfs_runlists_merge()
610 for (dend = di; drl[dend].length; dend++) in ntfs_runlists_merge()
619 for (dfinal = dend; dfinal >= 0 && drl[dfinal].lcn < LCN_HOLE; dfinal--) in ntfs_runlists_merge()
628 start = ((drl[dins].lcn < LCN_RL_NOT_MAPPED) || /* End of file */ in ntfs_runlists_merge()
629 (drl[dins].vcn == srl[sstart].vcn)); /* Start of hole */ in ntfs_runlists_merge()
630 finish = ((drl[dins].lcn >= LCN_RL_NOT_MAPPED) && /* End of file */ in ntfs_runlists_merge()
631 ((drl[dins].vcn + drl[dins].length) <= /* End of hole */ in ntfs_runlists_merge()
635 if (finish && !drl[dins].length) in ntfs_runlists_merge()
637 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn)) in ntfs_runlists_merge()
647 drl = ntfs_rl_replace(drl, ds, srl + sstart, ss, dins); in ntfs_runlists_merge()
649 drl = ntfs_rl_insert(drl, ds, srl + sstart, ss, dins); in ntfs_runlists_merge()
652 drl = ntfs_rl_append(drl, ds, srl + sstart, ss, dins); in ntfs_runlists_merge()
654 drl = ntfs_rl_split(drl, ds, srl + sstart, ss, dins); in ntfs_runlists_merge()
656 if (IS_ERR(drl)) { in ntfs_runlists_merge()
658 return drl; in ntfs_runlists_merge()
663 for (ds = dend; drl[ds].length; ds++) in ntfs_runlists_merge()
666 if (drl[ds].vcn <= marker_vcn) { in ntfs_runlists_merge()
669 if (drl[ds].vcn == marker_vcn) { in ntfs_runlists_merge()
673 drl[ds].lcn); in ntfs_runlists_merge()
674 drl[ds].lcn = LCN_ENOENT; in ntfs_runlists_merge()
682 if (drl[ds].lcn == LCN_ENOENT) { in ntfs_runlists_merge()
686 if (drl[ds].lcn != LCN_RL_NOT_MAPPED) { in ntfs_runlists_merge()
689 drl = ntfs_rl_realloc_nofail(drl, ds, in ntfs_runlists_merge()
696 drl[ds].vcn = drl[ds - 1].vcn + in ntfs_runlists_merge()
697 drl[ds - 1].length; in ntfs_runlists_merge()
698 drl[ds].lcn = LCN_RL_NOT_MAPPED; in ntfs_runlists_merge()
702 drl[ds].length = marker_vcn - drl[ds].vcn; in ntfs_runlists_merge()
706 drl = ntfs_rl_realloc_nofail(drl, ds, ds + 1); in ntfs_runlists_merge()
707 drl[ds].vcn = marker_vcn; in ntfs_runlists_merge()
708 drl[ds].lcn = LCN_ENOENT; in ntfs_runlists_merge()
709 drl[ds].length = (s64)0; in ntfs_runlists_merge()
717 ntfs_debug_dump_runlist(drl); in ntfs_runlists_merge()
718 return drl; in ntfs_runlists_merge()