• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/ntfs/

Lines Matching defs:drl

499  * @drl:	original runlist to be worked on
500 * @srl: new runlist to be merged into @drl
502 * First we sanity check the two runlists @srl and @drl to make sure that they
504 * runlist @drl or completely within a hole (or unmapped region) in @drl.
506 * It is up to the caller to serialize access to the runlists @drl and @srl.
521 * runlists @drl and @srl are deallocated before returning so you cannot use
531 runlist_element *ntfs_runlists_merge(runlist_element *drl,
536 int dins; /* Index into @drl at which to insert @srl. */
545 ntfs_debug_dump_runlist(drl);
552 return drl;
553 if (IS_ERR(srl) || IS_ERR(drl))
557 if (unlikely(!drl)) {
558 drl = srl;
560 if (unlikely(drl[0].vcn)) {
562 for (dend = 0; likely(drl[dend].length); dend++)
565 drl = ntfs_rl_realloc(drl, dend, dend + 1);
566 if (IS_ERR(drl))
567 return drl;
569 ntfs_rl_mm(drl, 1, 0, dend);
570 drl[0].vcn = 0;
571 drl[0].lcn = LCN_RL_NOT_MAPPED;
572 drl[0].length = drl[1].vcn;
590 * Skip forward in @drl until we reach the position where @srl needs to
591 * be inserted. If we reach the end of @drl, @srl just needs to be
592 * appended to @drl.
594 for (; drl[di].length; di++) {
595 if (drl[di].vcn + drl[di].length > srl[sstart].vcn)
601 if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) &&
610 for (dend = di; drl[dend].length; dend++)
619 for (dfinal = dend; dfinal >= 0 && drl[dfinal].lcn < LCN_HOLE; dfinal--)
625 int ds = dend + 1; /* Number of elements in drl & srl */
628 start = ((drl[dins].lcn < LCN_RL_NOT_MAPPED) || /* End of file */
629 (drl[dins].vcn == srl[sstart].vcn)); /* Start of hole */
630 finish = ((drl[dins].lcn >= LCN_RL_NOT_MAPPED) && /* End of file */
631 ((drl[dins].vcn + drl[dins].length) <= /* End of hole */
635 if (finish && !drl[dins].length)
637 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn))
641 drl = ntfs_rl_replace(drl, ds, srl + sstart, ss, dins);
643 drl = ntfs_rl_insert(drl, ds, srl + sstart, ss, dins);
646 drl = ntfs_rl_append(drl, ds, srl + sstart, ss, dins);
648 drl = ntfs_rl_split(drl, ds, srl + sstart, ss, dins);
650 if (IS_ERR(drl)) {
652 return drl;
657 for (ds = dend; drl[ds].length; ds++)
659 /* We only need to care if @srl ended after @drl. */
660 if (drl[ds].vcn <= marker_vcn) {
663 if (drl[ds].vcn == marker_vcn) {
667 drl[ds].lcn);
668 drl[ds].lcn = LCN_ENOENT;
673 * @drl or extend an existing one before adding the
676 if (drl[ds].lcn == LCN_ENOENT) {
680 if (drl[ds].lcn != LCN_RL_NOT_MAPPED) {
683 drl = ntfs_rl_realloc_nofail(drl, ds,
690 drl[ds].vcn = drl[ds - 1].vcn +
691 drl[ds - 1].length;
692 drl[ds].lcn = LCN_RL_NOT_MAPPED;
696 drl[ds].length = marker_vcn - drl[ds].vcn;
700 drl = ntfs_rl_realloc_nofail(drl, ds, ds + 1);
701 drl[ds].vcn = marker_vcn;
702 drl[ds].lcn = LCN_ENOENT;
703 drl[ds].length = (s64)0;
711 ntfs_debug_dump_runlist(drl);
712 return drl;