• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/ntfs-3g-2009.3.8/libntfs-3g/

Lines Matching defs:drl

468 static runlist_element *ntfs_runlists_merge_i(runlist_element *drl, 
473 int dins; /* Index into @drl at which to insert @srl. */
481 ntfs_debug_runlist_dump(drl);
487 return drl;
490 if (!drl) {
491 drl = srl;
493 if (drl[0].vcn) {
495 for (dend = 0; drl[dend].length; dend++)
498 drl = ntfs_rl_realloc(drl, dend, dend + 1);
499 if (!drl)
500 return drl;
502 ntfs_rl_mm(drl, 1, 0, dend);
503 drl[0].vcn = 0;
504 drl[0].lcn = LCN_RL_NOT_MAPPED;
505 drl[0].length = drl[1].vcn;
527 * Skip forward in @drl until we reach the position where @srl needs to
528 * be inserted. If we reach the end of @drl, @srl just needs to be
529 * appended to @drl.
531 for (; drl[di].length; di++) {
532 if (drl[di].vcn + drl[di].length > srl[sstart].vcn)
538 if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) &&
548 for (dend = di; drl[dend].length; dend++)
557 for (dfinal = dend; dfinal >= 0 && drl[dfinal].lcn < LCN_HOLE; dfinal--)
563 int ds = dend + 1; /* Number of elements in drl & srl */
566 start = ((drl[dins].lcn < LCN_RL_NOT_MAPPED) || /* End of file */
567 (drl[dins].vcn == srl[sstart].vcn)); /* Start of hole */
568 finish = ((drl[dins].lcn >= LCN_RL_NOT_MAPPED) && /* End of file */
569 ((drl[dins].vcn + drl[dins].length) <= /* End of hole */
573 if (finish && !drl[dins].length)
575 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn))
585 drl = ntfs_rl_replace(drl, ds, srl + sstart, ss, dins);
587 drl = ntfs_rl_insert(drl, ds, srl + sstart, ss, dins);
590 drl = ntfs_rl_append(drl, ds, srl + sstart, ss, dins);
592 drl = ntfs_rl_split(drl, ds, srl + sstart, ss, dins);
594 if (!drl) {
596 return drl;
601 for (ds = dend; drl[ds].length; ds++)
603 /* We only need to care if @srl ended after @drl. */
604 if (drl[ds].vcn <= marker_vcn) {
607 if (drl[ds].vcn == marker_vcn) {
610 (long long)drl[ds].lcn);
611 drl[ds].lcn = (LCN)LCN_ENOENT;
616 * @drl or extend an existing one before adding the
619 if (drl[ds].lcn == (LCN)LCN_ENOENT) {
623 if (drl[ds].lcn != (LCN)LCN_RL_NOT_MAPPED) {
629 drl = ntfs_rl_realloc(drl, ds, ds + 2);
630 if (!drl)
637 drl[ds].vcn = drl[ds - 1].vcn +
638 drl[ds - 1].length;
639 drl[ds].lcn = (LCN)LCN_RL_NOT_MAPPED;
643 drl[ds].length = marker_vcn - drl[ds].vcn;
650 drl = ntfs_rl_realloc(drl, ds, ds + 1);
651 if (!drl)
654 drl[ds].vcn = marker_vcn;
655 drl[ds].lcn = (LCN)LCN_ENOENT;
656 drl[ds].length = (s64)0;
664 ntfs_debug_runlist_dump(drl);
665 return drl;
672 return drl;
677 * @drl: original runlist to be worked on
678 * @srl: new runlist to be merged into @drl
680 * First we sanity check the two runlists @srl and @drl to make sure that they
682 * runlist @drl or completely within a hole (or unmapped region) in @drl.
697 * runlists @drl and @srl are deallocated before returning so you cannot use
707 runlist_element *ntfs_runlists_merge(runlist_element *drl,
713 rl = ntfs_runlists_merge_i(drl, srl);
1783 * @drl:
1790 static runlist_element * test_rl_runlists_merge(runlist_element *drl, runlist_element *srl)
1795 test_rl_dump_runlist(drl);
1799 res = ntfs_runlists_merge(drl, srl);