Lines Matching refs:lcn
171 if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED))
177 if ((dst->lcn >= 0) && (src->lcn >= 0) &&
178 ((dst->lcn + dst->length) == src->lcn))
181 if ((dst->lcn == LCN_HOLE) && (src->lcn == LCN_HOLE))
262 if (dst[marker].lcn == LCN_ENOENT)
348 if (dst[marker].lcn == LCN_HOLE || dst[marker].lcn == LCN_RL_NOT_MAPPED)
360 dst[loc].lcn = LCN_RL_NOT_MAPPED;
446 if (((dsize - tail) > 0) && (dst[marker].lcn == LCN_ENOENT))
510 int sstart; /* First index with lcn > LCN_RL_NOT_MAPPED. */
514 lcn >= LCN_HOLE. */
542 drl[0].lcn = LCN_RL_NOT_MAPPED;
551 while (srl[si].length && srl[si].lcn < (LCN)LCN_HOLE)
576 if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) &&
577 (srl[si].lcn >= 0)) {
589 if (srl[send].lcn == (LCN)LCN_ENOENT)
592 /* Scan to the last element with lcn >= LCN_HOLE. */
593 for (sfinal = send; sfinal >= 0 && srl[sfinal].lcn < LCN_HOLE; sfinal--)
595 for (dfinal = dend; dfinal >= 0 && drl[dfinal].lcn < LCN_HOLE; dfinal--)
604 start = ((drl[dins].lcn < LCN_RL_NOT_MAPPED) || /* End of file */
606 finish = ((drl[dins].lcn >= LCN_RL_NOT_MAPPED) && /* End of file */
648 (long long)drl[ds].lcn);
649 drl[ds].lcn = (LCN)LCN_ENOENT;
657 if (drl[ds].lcn == (LCN)LCN_ENOENT) {
661 if (drl[ds].lcn != (LCN)LCN_RL_NOT_MAPPED) {
677 drl[ds].lcn = (LCN)LCN_RL_NOT_MAPPED;
693 drl[ds].lcn = (LCN)LCN_ENOENT;
709 marker_vcn = ((runlist*)NULL)->lcn;
787 LCN lcn; /* Current lcn. */
805 /* Start at vcn = lowest_vcn and lcn 0. */
807 lcn = 0;
826 rl->lcn = (LCN)LCN_RL_NOT_MAPPED;
884 * There might be no lcn change at all, as is the case for
885 * sparse clusters on NTFS 3.0+, in which case we set the lcn
889 rl[rlpos].lcn = (LCN)LCN_HOLE;
891 /* Get the lcn change which really can be negative. */
898 /* Change the current lcn to it's new value. */
899 lcn += deltaxcn;
902 * On NTFS 1.2-, apparently can have lcn == -1 to
904 * whether it is really the lcn or the deltaxcn that is
910 ntfs_log_debug("lcn delta == -1\n");
911 if (lcn == (LCN)-1)
912 ntfs_log_debug("lcn == -1\n");
915 /* Check lcn is not below -1. */
916 if (lcn < (LCN)-1) {
922 if ((lcn != (LCN)-1) && !rl[rlpos].length) {
927 /* Enter the current lcn into the runlist element. */
928 rl[rlpos].lcn = lcn;
976 rl[rlpos].lcn = (LCN)LCN_RL_NOT_MAPPED;
989 rl[rlpos].lcn = (LCN)LCN_ENOENT;
991 rl[rlpos].lcn = (LCN)LCN_RL_NOT_MAPPED;
1036 * ntfs_rl_vcn_to_lcn - convert a vcn into a lcn given a runlist
1041 * cluster number (lcn) of a device using the runlist @rl to map vcns to their
1074 if (rl[i].lcn >= (LCN)0)
1075 return rl[i].lcn + (vcn - rl[i].vcn);
1076 return rl[i].lcn;
1083 if (rl[i].lcn < (LCN)0)
1084 return rl[i].lcn;
1137 if (rl->lcn < (LCN)0) {
1138 if (rl->lcn != (LCN)LCN_HOLE)
1150 /* It is a real lcn, read it from the volume. */
1154 bytes_read = ntfs_pread(vol->dev, (rl->lcn <<
1228 if (rl->lcn < (LCN)0) {
1230 if (rl->lcn != (LCN)LCN_HOLE)
1241 /* It is a real lcn, write it to the volume. */
1246 written = ntfs_pwrite(vol->dev, (rl->lcn <<
1285 * number (lcn) or a specific run length.
1363 if (rl->length < 0 || rl->lcn < LCN_HOLE)
1369 * If the logical cluster number (lcn) denotes a hole and we
1371 * zero space. On earlier NTFS versions we just store the lcn.
1373 * an lcn of -1 and not a delta_lcn of -1 (unless both are -1).
1375 if (rl->lcn >= 0 || vol->major_ver < 3) {
1376 prev_lcn = rl->lcn;
1377 if (rl->lcn >= 0)
1379 /* Change in lcn. */
1387 if (rl->length < 0 || rl->lcn < LCN_HOLE)
1392 * If the logical cluster number (lcn) denotes a hole and we
1394 * zero space. On earlier NTFS versions we just store the lcn.
1396 * an lcn of -1 and not a delta_lcn of -1 (unless both are -1).
1398 if (rl->lcn >= 0 || vol->major_ver < 3) {
1399 /* Change in lcn. */
1400 rls += ntfs_get_nr_significant_bytes(rl->lcn -
1402 prev_lcn = rl->lcn;
1408 if (rl->lcn == LCN_RL_NOT_MAPPED)
1429 * a given logical cluster number (lcn) or a specific run length to the minimum
1525 if (rl->length < 0 || rl->lcn < LCN_HOLE)
1534 * If the logical cluster number (lcn) denotes a hole and we
1536 * zero space. On earlier NTFS versions we just write the lcn
1537 * change. FIXME: Do we need to write the lcn change or just
1538 * the lcn in that case? Not sure as I have never seen this
1539 * case on NT4. - We assume that we just need to write the lcn
1542 if (rl->lcn >= 0 || vol->major_ver < 3) {
1543 prev_lcn = rl->lcn;
1544 if (rl->lcn >= 0)
1546 /* Write change in lcn. */
1565 if (rl->length < 0 || rl->lcn < LCN_HOLE)
1573 * If the logical cluster number (lcn) denotes a hole and we
1575 * zero space. On earlier NTFS versions we just write the lcn
1576 * change. FIXME: Do we need to write the lcn change or just
1577 * the lcn in that case? Not sure as I have never seen this
1578 * case on NT4. - We assume that we just need to write the lcn
1581 if (rl->lcn >= 0 || vol->major_ver < 3) {
1582 /* Write change in lcn. */
1584 len_len, dst_max, rl->lcn - prev_lcn);
1587 prev_lcn = rl->lcn;
1619 if (rl->lcn == LCN_RL_NOT_MAPPED)
1694 rl->lcn = (LCN)LCN_ENOENT;
1728 if (rlc->lcn < 0) {
1729 if (rlc->lcn != LCN_HOLE) {
1758 if (rlc->lcn < 0) {
1759 if (rlc->lcn != LCN_HOLE) {
1777 (R)->lcn = L; \
1807 LCN lcn = rl->lcn;
1816 if (lcn < (LCN)0) {
1817 int ind = -lcn - 1;
1825 rl->vcn, rl->lcn, rl->length);