Lines Matching refs:lcn

203 	if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED))
209 if ((dst->lcn >= 0) && (src->lcn >= 0) &&
210 ((dst->lcn + dst->length) == src->lcn))
213 if ((dst->lcn == LCN_HOLE) && (src->lcn == LCN_HOLE))
332 if (d_elements - tail > 0 && d_rl[marker].lcn == LCN_ENOENT)
423 if (d_rl[marker].lcn == LCN_HOLE ||
424 d_rl[marker].lcn == LCN_RL_NOT_MAPPED)
436 d_rl[loc].lcn = LCN_RL_NOT_MAPPED;
501 if (d_rl[marker].lcn == LCN_ENOENT)
546 d_rl[loc + s_size + 1].lcn = d_rl[loc].lcn;
601 unsigned s_start; /* First index in @s_rl with lcn >= LCN_HOLE. */
603 unsigned d_final; /* Last index in @d_rl with lcn >= LCN_HOLE. */
604 unsigned s_final; /* Last index in @s_rl with lcn >= LCN_HOLE. */
638 s_rl[0].lcn = LCN_RL_NOT_MAPPED;
654 while (s_rl[si].length && s_rl[si].lcn < LCN_HOLE)
672 if ((d_rl[d_ins].vcn == s_rl[s_start].vcn) && (d_rl[d_ins].lcn >= 0) &&
673 (s_rl[s_start].lcn >= 0)) {
677 /* Scan backwards for the last element with lcn >= LCN_HOLE. */
679 if (s_rl[s_final].lcn >= LCN_HOLE)
683 if (d_rl[d_final].lcn >= LCN_HOLE)
709 start = (d_rl[d_ins].lcn < LCN_RL_NOT_MAPPED ||
711 finish = (d_rl[d_ins].lcn >= LCN_RL_NOT_MAPPED &&
723 if (s_rl[s_elements - 1].lcn == LCN_ENOENT) {
770 (unsigned long long)d_rl[di].lcn);
771 d_rl[di].lcn = LCN_ENOENT;
784 if (d_rl[di].lcn == LCN_ENOENT) {
792 if (d_rl[di].lcn != LCN_RL_NOT_MAPPED) {
810 d_rl[di].lcn = LCN_RL_NOT_MAPPED;
826 d_rl[di].lcn = LCN_ENOENT;
870 LCN lcn; /* Current lcn. */
886 /* Start at vcn = lowest_vcn and lcn 0. */
888 lcn = 0;
909 rl->lcn = LCN_RL_NOT_MAPPED;
968 * There might be no lcn change at all, as is the case for
969 * sparse clusters on NTFS 3.0+, in which case we set the lcn
973 rl[rlpos].lcn = LCN_HOLE;
975 /* Get the lcn change which really can be negative. */
982 /* Change the current lcn to its new value. */
983 lcn += deltaxcn;
986 * On NTFS 1.2-, apparently one can have lcn == -1 to
988 * whether it is really the lcn or the deltaxcn that is
994 ntfs_error(vol->mp, "lcn delta == -1");
995 if (lcn == (LCN)-1)
996 ntfs_error(vol->mp, "lcn == -1");
999 /* Check lcn is not below -1. */
1000 if (lcn < (LCN)-1) {
1005 /* Enter the current lcn into the runlist element. */
1006 rl[rlpos].lcn = lcn;
1041 rl[rlpos].lcn = LCN_RL_NOT_MAPPED;
1050 rl[rlpos].lcn = LCN_ENOENT;
1052 rl[rlpos].lcn = LCN_RL_NOT_MAPPED;
1092 * ntfs_rl_vcn_to_lcn - convert a vcn into a lcn given a runlist
1098 * cluster number (lcn) of a device using the runlist @rl to map vcns to their
1102 * the number of contiguous clusters after the returned lcn in *@clusters.
1141 if (rl[i].lcn >= (LCN)0)
1142 return rl[i].lcn + ofs;
1143 return rl[i].lcn;
1147 * Set *@clusters just in case rl[i].lcn is LCN_HOLE. That should
1157 if (rl[i].lcn < (LCN)0)
1158 return rl[i].lcn;
1184 if (rl->lcn >= LCN_HOLE)
1190 if (rl->lcn == LCN_ENOENT)
1204 * number (lcn) or a specific run length.
1292 if (length < 0 || rl->lcn < LCN_HOLE)
1308 * If the logical cluster number (lcn) denotes a hole and we
1310 * zero space. On earlier NTFS versions we just store the lcn.
1312 * an lcn of -1 and not a delta_lcn of -1 (unless both are -1).
1314 if (rl->lcn >= 0 || vol->major_ver < 3) {
1315 prev_lcn = rl->lcn;
1316 if (rl->lcn >= 0)
1318 /* Change in lcn. */
1328 if (length < 0 || rl->lcn < LCN_HOLE)
1343 * If the logical cluster number (lcn) denotes a hole and we
1345 * zero space. On earlier NTFS versions we just store the lcn.
1347 * an lcn of -1 and not a delta_lcn of -1 (unless both are -1).
1349 if (rl->lcn >= 0 || vol->major_ver < 3) {
1350 /* Change in lcn. */
1351 rls += ntfs_get_nr_significant_bytes(rl->lcn -
1353 prev_lcn = rl->lcn;
1359 if (rl->lcn == LCN_RL_NOT_MAPPED)
1378 * a given logical cluster number (lcn) or a specific run length to the minumum
1501 if (length < 0 || rl->lcn < LCN_HOLE)
1520 * If the logical cluster number (lcn) denotes a hole and we
1522 * zero space. On earlier NTFS versions we just write the lcn
1523 * change. FIXME: Do we need to write the lcn change or just
1524 * the lcn in that case? Not sure as I have never seen this
1525 * case on NT4. - We assume that we just need to write the lcn
1528 if (rl->lcn >= 0 || vol->major_ver < 3) {
1529 prev_lcn = rl->lcn;
1530 if (rl->lcn >= 0)
1532 /* Write change in lcn. */
1553 if (length < 0 || rl->lcn < LCN_HOLE)
1571 * If the logical cluster number (lcn) denotes a hole and we
1573 * zero space. On earlier NTFS versions we just write the lcn
1574 * change. FIXME: Do we need to write the lcn change or just
1575 * the lcn in that case? Not sure as I have never seen this
1576 * case on NT4. - We assume that we just need to write the lcn
1579 if (rl->lcn >= 0 || vol->major_ver < 3) {
1580 /* Write change in lcn. */
1582 len_len, dst_max, rl->lcn - prev_lcn);
1585 prev_lcn = rl->lcn;
1606 if (rl->lcn == LCN_RL_NOT_MAPPED)
1726 rl->lcn = LCN_HOLE;
1728 rl[1].lcn = LCN_ENOENT;
1755 rl[element].lcn = LCN_ENOENT;
1776 rl[prev_element].lcn == LCN_HOLE))
1797 rl[element].lcn = LCN_HOLE;
1806 rl[element].lcn = LCN_ENOENT;
1866 if (rl_end->lcn < LCN_HOLE)
1872 if (rl_end->length && rl_end->lcn < LCN_HOLE)
1882 if (rl->lcn == LCN_HOLE) {
1895 if (rl_end->lcn == LCN_HOLE) {
1912 /* Only adjust the lcn if it is real. */
1913 if (rl->lcn >= 0)
1914 rl->lcn += delta;
1939 if (rl > runlist->rl && (rl - 1)->lcn == LCN_HOLE) {
1945 rl->lcn = LCN_HOLE;
1972 rl->lcn = LCN_HOLE;
1976 /* Only adjust the lcn if it is real. */
1977 if (rl->lcn >= 0 || lcn_fixup)
1978 rl->lcn += len;
1991 if (rl_end->lcn == LCN_HOLE) {
2029 rl->lcn = LCN_HOLE;
2053 if (rl->lcn >= 0) {
2054 rl->lcn -= delta;
2055 /* Need this in case the lcn just became negative. */
2084 rl->lcn = LCN_HOLE;
2089 rl->lcn += delta;
2101 * @runlist: runlist describing vcn to lcn mapping of data
2154 ntfs_debug("Reading vcn 0x%llx, lcn 0x%llx, length 0x%llx.",
2156 (unsigned long long)rl->lcn,
2159 if (rl->lcn < 0) {
2165 block = rl->lcn << cluster_to_block_shift;
2222 * @runlist: runlist describing vcn to lcn mapping of data
2287 LCN lcn;
2290 lcn = ntfs_rl_vcn_to_lcn(rl, vcn, NULL);
2291 if (lcn < 0)
2292 panic("%s(): lcn < 0\n", __FUNCTION__);
2293 ntfs_debug("Writing vcn 0x%llx, start offset 0x%x, lcn "
2295 (unsigned long long)lcn);
2297 block = ((lcn << cluster_shift) + vcn_ofs) >> block_shift;
2298 end_block = (lcn + 1) << shift;
2397 LCN lcn;
2403 lcn = rl->lcn;
2404 if (lcn < 0) {
2405 if (lcn == LCN_HOLE || lcn == LCN_RL_NOT_MAPPED)
2408 (long long)lcn);
2412 block = lcn << shift;
2413 end_block = (lcn + rl->length) << shift;
2490 if (rl->lcn >= 0) {
2507 if (rl->lcn >= 0)
2511 if (rl->lcn >= 0)