Lines Matching defs:srl
486 * @srl: new runlist to be merged into @drl
488 * First we sanity check the two runlists @srl and @drl to make sure that they
489 * are sensible and can be merged. The runlist @srl must be either after the
492 * It is up to the caller to serialize access to the runlists @drl and @srl.
498 * There are four possible ways @srl can be merged. It can:
507 * runlists @drl and @srl are deallocated before returning so you cannot use
518 runlist_element *srl)
522 int dins; /* Index into @drl at which to insert @srl. */
533 ntfs_debug_dump_runlist(srl);
537 if (unlikely(!srl))
539 if (IS_ERR(srl) || IS_ERR(drl))
544 drl = srl;
566 while (srl[si].length && srl[si].lcn < LCN_HOLE)
570 BUG_ON(!srl[si].length);
576 * Skip forward in @drl until we reach the position where @srl needs to
577 * be inserted. If we reach the end of @drl, @srl just needs to be
581 if (drl[di].vcn + drl[di].length > srl[sstart].vcn)
587 if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) &&
588 (srl[si].lcn >= 0)) {
594 for (send = si; srl[send].length; send++)
599 if (srl[send].lcn == LCN_ENOENT)
600 marker_vcn = srl[marker = send].vcn;
603 for (sfinal = send; sfinal >= 0 && srl[sfinal].lcn < LCN_HOLE; sfinal--)
611 int ds = dend + 1; /* Number of elements in drl & srl */
615 (drl[dins].vcn == srl[sstart].vcn)); /* Start of hole */
618 (srl[send - 1].vcn + srl[send - 1].length)));
623 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn))
633 drl = ntfs_rl_replace(drl, ds, srl + sstart, ss, dins);
635 drl = ntfs_rl_insert(drl, ds, srl + sstart, ss, dins);
638 drl = ntfs_rl_append(drl, ds, srl + sstart, ss, dins);
640 drl = ntfs_rl_split(drl, ds, srl + sstart, ss, dins);
646 ntfs_free(srl);
651 /* We only need to care if @srl ended after @drl. */