Lines Matching refs:length
151 if ((dst->vcn + dst->length) != src->vcn)
155 ((dst->lcn + dst->length) == src->lcn))
177 dst->length += src->length;
238 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn;
240 /* We may have changed the length of the file, so fix the end marker */
242 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length;
292 merged_length = dst[loc - 1].length;
294 merged_length += src->length;
325 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length;
326 /* ... and the length. */
328 dst[marker].length = dst[marker + 1].vcn - dst[marker].vcn;
333 dst[loc].vcn = dst[loc - 1].vcn + dst[loc - 1].length;
334 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn;
337 dst[loc].length = dst[loc + 1].vcn;
426 /* We may have changed the length of the file, so fix the end marker. */
428 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length;
476 dst[loc].length = dst[loc+1].vcn - dst[loc].vcn;
477 dst[loc+ssize+1].vcn = dst[loc+ssize].vcn + dst[loc+ssize].length;
478 dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn;
548 for (dend = 0; likely(drl[dend].length); dend++)
558 drl[0].length = drl[1].vcn;
566 while (srl[si].length && srl[si].lcn < LCN_HOLE)
570 BUG_ON(!srl[si].length);
580 for (; drl[di].length; di++) {
581 if (drl[di].vcn + drl[di].length > srl[sstart].vcn)
594 for (send = si; srl[send].length; send++)
596 for (dend = di; drl[dend].length; dend++)
617 ((drl[dins].vcn + drl[dins].length) <= /* End of hole */
618 (srl[send - 1].vcn + srl[send - 1].length)));
621 if (finish && !drl[dins].length)
623 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn))
649 for (ds = dend; drl[ds].length; ds++)
683 drl[ds - 1].length;
688 drl[ds].length = marker_vcn - drl[ds].vcn;
695 drl[ds].length = (s64)0;
763 attr_end = (u8*)attr + le32_to_cpu(attr->length);
781 rl->length = vcn;
806 * Get the change in vcn, i.e. the run length in clusters.
808 * A negative run length doesn't make any sense, but hey, I
810 * length as a signed value so that's how it is...
818 } else { /* The length entry is compulsory. */
819 ntfs_error(vol->sb, "Missing length entry in mapping "
824 * Assume a negative length to indicate data corruption and
828 ntfs_error(vol->sb, "Invalid length in mapping pairs "
833 * Enter the current run length into the current runlist
836 rl[rlpos].length = deltaxcn;
837 /* Increment the current vcn by the current run length. */
925 vcn += rl[rlpos].length = max_cluster -
945 rl[rlpos].length = (s64)0;
1007 for (i = 0; likely(rl[i].length); i++) {
1044 while (likely(rl->length)) {
1066 * number (lcn) or a specific run length.
1134 while (rl->length && first_vcn >= rl[1].vcn)
1136 if (unlikely((!rl->length && first_vcn > rl->vcn) ||
1144 s64 delta, length = rl->length;
1146 /* We know rl->length != 0 already. */
1147 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1151 * run length.
1156 length = s1 - rl->vcn;
1160 /* Header byte + length. */
1161 rls += 1 + ntfs_get_nr_significant_bytes(length - delta);
1180 for (; rl->length && !the_end; rl++) {
1181 s64 length = rl->length;
1183 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1187 * run length.
1192 length = s1 - rl->vcn;
1195 /* Header byte + length. */
1196 rls += 1 + ntfs_get_nr_significant_bytes(length);
1232 * a given logical cluster number (lcn) or a specific run length to the minimum
1333 while (rl->length && first_vcn >= rl[1].vcn)
1335 if (unlikely((!rl->length && first_vcn > rl->vcn) ||
1346 s64 delta, length = rl->length;
1348 /* We know rl->length != 0 already. */
1349 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1353 * run length.
1358 length = s1 - rl->vcn;
1362 /* Write length. */
1364 length - delta);
1398 for (; rl->length && !the_end; rl++) {
1399 s64 length = rl->length;
1401 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1405 * run length.
1410 length = s1 - rl->vcn;
1413 /* Write length. */
1415 length);
1465 * @new_length: the new length of the runlist in VCNs
1468 * holding the runlist elements to a length of @new_length VCNs.
1505 * length @new_length followed by a terminator runlist element.
1514 rl[1].length = rl->vcn = 0;
1516 rl[1].vcn = rl->length = new_length;
1522 while (likely(rl->length && new_length >= rl[1].vcn))
1528 if (rl->length) {
1535 while (likely(trl->length))
1539 rl->length = new_length - rl->vcn;
1545 if (rl->length) {
1547 if (!rl->length)
1550 rl->length = 0;
1566 } else if (likely(/* !rl->length && */ new_length > rl->vcn)) {
1574 (rl - 1)->length = new_length - (rl - 1)->vcn;
1594 rl->length = new_length - rl->vcn;
1597 rl->length = 0;
1601 } else /* if (unlikely(!rl->length && new_length == rl->vcn)) */ {
1614 * @length: size of the hole to be created in units of clusters
1617 * @length clusters.
1622 * If @start and/or @start + @length are outside the runlist return error code
1626 * + @length return error code -EINVAL.
1631 const VCN start, const s64 length)
1633 const VCN end = start + length;
1639 ntfs_debug("Entering for start 0x%llx, length 0x%llx.",
1640 (long long)start, (long long)length);
1643 BUG_ON(length < 0);
1647 if (likely(!start && !length))
1652 while (likely(rl->length && start >= rl[1].vcn))
1656 while (likely(rl_end->length && end >= rl_end[1].vcn)) {
1663 if (unlikely(rl_end->length && rl_end->lcn < LCN_HOLE))
1666 if (!rl_end->length && end > rl_end->vcn)
1668 if (!length)
1670 if (!rl->length)
1674 while (likely(rl_real_end->length))
1689 rl->length = end - rl->vcn;
1693 rl->length = rl_end->vcn - rl->vcn;
1705 rl->length -= delta;
1773 rl->length = length;
1775 rl->vcn += length;
1778 rl->lcn += length;
1779 rl->length -= length;
1793 rl->length = start - rl->vcn;
1801 rl->length = rl[1].vcn - start;
1820 if (rl[1].length && end >= rl[2].vcn) {
1822 rl->length = start - rl->vcn;
1839 rl->length = start - rl->vcn;
1853 rl->length += delta;
1876 rl->length = start - rl->vcn;
1880 rl->length = length;
1885 rl->length -= delta;