Lines Matching defs:vcn
174 if ((dst->vcn + dst->length) != src->vcn)
259 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn;
263 dst[marker].vcn = dst[marker-1].vcn + dst[marker-1].length;
306 disc = (src[0].vcn > 0);
316 disc = (src[0].vcn > dst[loc - 1].vcn + merged_length);
346 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length;
349 dst[marker].length = dst[marker + 1].vcn - dst[marker].vcn;
354 dst[loc].vcn = dst[loc - 1].vcn + dst[loc - 1].length;
355 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn;
357 dst[loc].vcn = 0;
358 dst[loc].length = dst[loc + 1].vcn;
447 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length;
495 dst[loc].length = dst[loc+1].vcn - dst[loc].vcn;
496 dst[loc+ssize+1].vcn = dst[loc+ssize].vcn + dst[loc+ssize].length;
497 dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn;
531 if (drl[0].vcn) {
541 drl[0].vcn = 0;
543 drl[0].length = drl[1].vcn;
570 if (drl[di].vcn + drl[di].length > srl[sstart].vcn)
576 if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) &&
590 marker_vcn = srl[marker = send].vcn;
605 (drl[dins].vcn == srl[sstart].vcn)); /* Start of hole */
607 ((drl[dins].vcn + drl[dins].length) <= /* End of hole */
608 (srl[send - 1].vcn + srl[send - 1].length)));
613 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn))
642 if (drl[ds].vcn <= marker_vcn) {
645 if (drl[ds].vcn == marker_vcn) {
673 /* Need to set vcn if it isn't set already. */
675 drl[ds].vcn = drl[ds - 1].vcn +
681 drl[ds].length = marker_vcn - drl[ds].vcn;
692 drl[ds].vcn = marker_vcn;
786 VCN vcn; /* Current vcn. */
805 /* Start at vcn = lowest_vcn and lcn 0. */
806 vcn = sle64_to_cpu(attr->lowest_vcn);
824 if (vcn) {
825 rl->vcn = (VCN)0;
827 rl->length = vcn;
848 /* Enter the current vcn into the current runlist element. */
849 rl[rlpos].vcn = vcn;
851 * Get the change in vcn, i.e. the run length in clusters.
881 /* Increment the current vcn by the current run length. */
882 vcn += deltaxcn;
940 * vcn in the runlist - 1, or something has gone badly wrong.
943 if (deltaxcn && vcn - 1 != deltaxcn) {
965 if (num_clusters > vcn) {
970 ntfs_log_debug("More extents to follow; vcn = 0x%llx, "
972 (long long)vcn,
974 rl[rlpos].vcn = vcn;
975 vcn += rl[rlpos].length = num_clusters - vcn;
978 } else if (vcn > num_clusters) {
983 ntfs_log_error("Corrupt attribute. vcn = 0x%llx, "
985 (long long)vcn,
994 rl[rlpos].vcn = vcn;
1036 * ntfs_rl_vcn_to_lcn - convert a vcn into a lcn given a runlist
1038 * @vcn: vcn to convert
1040 * Convert the virtual cluster number @vcn of an attribute into a logical
1051 * -3 = LCN_ENOENT There is no such vcn in the attribute.
1054 LCN ntfs_rl_vcn_to_lcn(const runlist_element *rl, const VCN vcn)
1058 if (vcn < (VCN)0)
1068 /* Catch out of lower bounds vcn. */
1069 if (vcn < rl[0].vcn)
1073 if (vcn < rl[i+1].vcn) {
1075 return rl[i].lcn + (vcn - rl[i].vcn);
1310 * @start_vcn: vcn at which to start the mapping pairs array
1313 * array corresponding to the runlist @rl, starting at vcn @start_vcn. This
1349 while (rl->length && start_vcn >= rl[1].vcn)
1351 if ((!rl->length && start_vcn > rl->vcn) || start_vcn < rl->vcn) {
1359 if (start_vcn > rl->vcn) {
1365 delta = start_vcn - rl->vcn;
1464 * @start_vcn: vcn at which to start the mapping pairs array
1465 * @stop_vcn: first vcn outside destination buffer on success or ENOSPC error
1467 * Create the mapping pairs array from the runlist @rl, starting at vcn
1475 * the first vcn outside the destination buffer. Note that on error @dst has
1510 while (rl->length && start_vcn >= rl[1].vcn)
1512 if ((!rl->length && start_vcn > rl->vcn) || start_vcn < rl->vcn)
1521 if (start_vcn > rl->vcn) {
1527 delta = start_vcn - rl->vcn;
1598 /* Set stop vcn. */
1607 /* Set stop vcn. */
1629 * ntfs_rl_truncate - truncate a runlist starting at a specified vcn
1631 * @start_vcn: first vcn which should be cut off
1633 * Truncate the runlist *@arl starting at vcn @start_vcn as well as the memory
1658 if (start_vcn < rl->vcn) {
1664 /* Find the starting vcn in the run list. */
1666 if (start_vcn < rl[1].vcn)
1678 rl->length = start_vcn - rl->vcn;
1691 rl->vcn = start_vcn;
1776 (R)->vcn = V; \
1822 rl->vcn, lcn_str[ind], rl->length);
1825 rl->vcn, rl->lcn, rl->length);
1893 * @vcn:
1900 static runlist_element * test_rl_pure_src(BOOL contig, BOOL multi, int vcn, int len)
1915 MKRL(result+0, vcn + (0*len/4), fudge + vcn + 1000 + (0*len/4), len / 4)
1916 MKRL(result+1, vcn + (1*len/4), fudge + vcn + 1000 + (1*len/4), len / 4)
1917 MKRL(result+2, vcn + (2*len/4), fudge + vcn + 1000 + (2*len/4), len / 4)
1918 MKRL(result+3, vcn + (3*len/4), fudge + vcn + 1000 + (3*len/4), len / 4)
1919 MKRL(result+4, vcn + (4*len/4), LCN_RL_NOT_MAPPED, 0)
1921 MKRL(result+0, vcn, fudge + vcn + 1000, len)
1922 MKRL(result+1, vcn + len, LCN_RL_NOT_MAPPED, 0)
1932 * @vcn:
1941 static void test_rl_pure_test(int test, BOOL contig, BOOL multi, int vcn, int len, runlist_element *file, int size)
1947 src = test_rl_pure_src(contig, multi, vcn, len);