Lines Matching defs:lcn
148 if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED))
154 if ((dst->lcn >= 0) && (src->lcn >= 0) &&
155 ((dst->lcn + dst->length) == src->lcn))
158 if ((dst->lcn == LCN_HOLE) && (src->lcn == LCN_HOLE))
241 if (dst[marker].lcn == LCN_ENOENT)
327 if (dst[marker].lcn == LCN_HOLE || dst[marker].lcn == LCN_RL_NOT_MAPPED)
339 dst[loc].lcn = LCN_RL_NOT_MAPPED;
427 if (dsize - tail > 0 && dst[marker].lcn == LCN_ENOENT)
521 int sstart; /* First index with lcn > LCN_RL_NOT_MAPPED. */
525 lcn >= LCN_HOLE. */
557 drl[0].lcn = LCN_RL_NOT_MAPPED;
566 while (srl[si].length && srl[si].lcn < LCN_HOLE)
587 if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) &&
588 (srl[si].lcn >= 0)) {
599 if (srl[send].lcn == LCN_ENOENT)
602 /* Scan to the last element with lcn >= LCN_HOLE. */
603 for (sfinal = send; sfinal >= 0 && srl[sfinal].lcn < LCN_HOLE; sfinal--)
605 for (dfinal = dend; dfinal >= 0 && drl[dfinal].lcn < LCN_HOLE; dfinal--)
614 start = ((drl[dins].lcn < LCN_RL_NOT_MAPPED) || /* End of file */
616 finish = ((drl[dins].lcn >= LCN_RL_NOT_MAPPED) && /* End of file */
659 drl[ds].lcn);
660 drl[ds].lcn = LCN_ENOENT;
668 if (drl[ds].lcn == LCN_ENOENT) {
672 if (drl[ds].lcn != LCN_RL_NOT_MAPPED) {
684 drl[ds].lcn = LCN_RL_NOT_MAPPED;
694 drl[ds].lcn = LCN_ENOENT;
739 LCN lcn; /* Current lcn. */
757 /* Start at vcn = lowest_vcn and lcn 0. */
759 lcn = 0;
780 rl->lcn = LCN_RL_NOT_MAPPED;
840 * There might be no lcn change at all, as is the case for
841 * sparse clusters on NTFS 3.0+, in which case we set the lcn
845 rl[rlpos].lcn = LCN_HOLE;
847 /* Get the lcn change which really can be negative. */
854 /* Change the current lcn to its new value. */
855 lcn += deltaxcn;
858 * On NTFS 1.2-, apparently can have lcn == -1 to
860 * whether it is really the lcn or the deltaxcn that is
866 ntfs_error(vol->sb, "lcn delta == -1");
867 if (unlikely(lcn == (LCN)-1))
868 ntfs_error(vol->sb, "lcn == -1");
871 /* Check lcn is not below -1. */
872 if (unlikely(lcn < (LCN)-1)) {
877 /* Enter the current lcn into the runlist element. */
878 rl[rlpos].lcn = lcn;
927 rl[rlpos].lcn = LCN_RL_NOT_MAPPED;
939 rl[rlpos].lcn = LCN_ENOENT;
941 rl[rlpos].lcn = LCN_RL_NOT_MAPPED;
967 * ntfs_rl_vcn_to_lcn - convert a vcn into a lcn given a runlist
972 * cluster number (lcn) of a device using the runlist @rl to map vcns to their
1009 if (likely(rl[i].lcn >= (LCN)0))
1010 return rl[i].lcn + (vcn - rl[i].vcn);
1011 return rl[i].lcn;
1018 if (likely(rl[i].lcn < (LCN)0))
1019 return rl[i].lcn;
1046 if (likely(rl->lcn >= LCN_HOLE))
1052 if (likely(rl->lcn == LCN_ENOENT))
1066 * number (lcn) or a specific run length.
1147 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1163 * If the logical cluster number (lcn) denotes a hole and we
1165 * zero space. On earlier NTFS versions we just store the lcn.
1167 * an lcn of -1 and not a delta_lcn of -1 (unless both are -1).
1169 if (likely(rl->lcn >= 0 || vol->major_ver < 3)) {
1170 prev_lcn = rl->lcn;
1171 if (likely(rl->lcn >= 0))
1173 /* Change in lcn. */
1183 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1198 * If the logical cluster number (lcn) denotes a hole and we
1200 * zero space. On earlier NTFS versions we just store the lcn.
1202 * an lcn of -1 and not a delta_lcn of -1 (unless both are -1).
1204 if (likely(rl->lcn >= 0 || vol->major_ver < 3)) {
1205 /* Change in lcn. */
1206 rls += ntfs_get_nr_significant_bytes(rl->lcn -
1208 prev_lcn = rl->lcn;
1213 if (rl->lcn == LCN_RL_NOT_MAPPED)
1232 * a given logical cluster number (lcn) or a specific run length to the minimum
1349 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1368 * If the logical cluster number (lcn) denotes a hole and we
1370 * zero space. On earlier NTFS versions we just write the lcn
1371 * change. FIXME: Do we need to write the lcn change or just
1372 * the lcn in that case? Not sure as I have never seen this
1373 * case on NT4. - We assume that we just need to write the lcn
1376 if (likely(rl->lcn >= 0 || vol->major_ver < 3)) {
1377 prev_lcn = rl->lcn;
1378 if (likely(rl->lcn >= 0))
1380 /* Write change in lcn. */
1401 if (unlikely(length < 0 || rl->lcn < LCN_HOLE))
1419 * If the logical cluster number (lcn) denotes a hole and we
1421 * zero space. On earlier NTFS versions we just write the lcn
1422 * change. FIXME: Do we need to write the lcn change or just
1423 * the lcn in that case? Not sure as I have never seen this
1424 * case on NT4. - We assume that we just need to write the lcn
1427 if (likely(rl->lcn >= 0 || vol->major_ver < 3)) {
1428 /* Write change in lcn. */
1430 len_len, dst_max, rl->lcn - prev_lcn);
1433 prev_lcn = rl->lcn;
1454 if (rl->lcn == LCN_RL_NOT_MAPPED)
1515 rl->lcn = LCN_HOLE;
1517 rl[1].lcn = LCN_ENOENT;
1552 rl->lcn = LCN_ENOENT;
1573 if ((rl > runlist->rl) && ((rl - 1)->lcn == LCN_HOLE))
1593 rl->lcn = LCN_HOLE;
1600 rl->lcn = LCN_ENOENT;
1603 rl->lcn = LCN_ENOENT;
1658 if (unlikely(rl_end->lcn < LCN_HOLE))
1663 if (unlikely(rl_end->length && rl_end->lcn < LCN_HOLE))
1678 if (rl->lcn == LCN_HOLE) {
1691 if (rl_end->lcn == LCN_HOLE) {
1706 /* Only adjust the lcn if it is real. */
1707 if (rl->lcn >= 0)
1708 rl->lcn += delta;
1743 if (rl > runlist->rl && (rl - 1)->lcn == LCN_HOLE) {
1748 rl->lcn = LCN_HOLE;
1772 rl->lcn = LCN_HOLE;
1776 /* Only adjust the lcn if it is real. */
1777 if (rl->lcn >= 0 || lcn_fixup)
1778 rl->lcn += length;
1791 if (rl_end->lcn == LCN_HOLE) {
1825 rl->lcn = LCN_HOLE;
1848 if (rl->lcn >= 0) {
1849 rl->lcn -= delta;
1850 /* Need this in case the lcn just became negative. */
1879 rl->lcn = LCN_HOLE;
1884 rl->lcn += delta;