Lines Matching full:length
158 if ((dst->vcn + dst->length) != src->vcn) in ntfs_are_rl_mergeable()
162 ((dst->lcn + dst->length) == src->lcn)) in ntfs_are_rl_mergeable()
187 dst->length += src->length; in __ntfs_rl_merge()
246 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn; in ntfs_rl_append()
248 /* We may have changed the length of the file, so fix the end marker */ in ntfs_rl_append()
250 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; in ntfs_rl_append()
296 merged_length = dst[loc - 1].length; in ntfs_rl_insert()
298 merged_length += src->length; in ntfs_rl_insert()
331 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; in ntfs_rl_insert()
332 /* ... and the length. */ in ntfs_rl_insert()
335 dst[marker].length = dst[marker + 1].vcn - dst[marker].vcn; in ntfs_rl_insert()
340 dst[loc].vcn = dst[loc - 1].vcn + dst[loc - 1].length; in ntfs_rl_insert()
341 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn; in ntfs_rl_insert()
344 dst[loc].length = dst[loc + 1].vcn; in ntfs_rl_insert()
431 /* We may have changed the length of the file, so fix the end marker. */ in ntfs_rl_replace()
433 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; in ntfs_rl_replace()
479 dst[loc].length = dst[loc+1].vcn - dst[loc].vcn; in ntfs_rl_split()
480 dst[loc+ssize+1].vcn = dst[loc+ssize].vcn + dst[loc+ssize].length; in ntfs_rl_split()
481 dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn; in ntfs_rl_split()
545 for (; srl[s_rl_count].length; s_rl_count++) in ntfs_runlists_merge()
563 drl[0].length = drl[1].vcn; in ntfs_runlists_merge()
577 while (srl[si].length && srl[si].lcn < LCN_HOLE) in ntfs_runlists_merge()
581 WARN_ON(!srl[si].length); in ntfs_runlists_merge()
627 ((drl[dins].vcn + drl[dins].length) <= /* End of hole */ in ntfs_runlists_merge()
628 (srl[send - 1].vcn + srl[send - 1].length))); in ntfs_runlists_merge()
631 if (finish && !drl[dins].length) in ntfs_runlists_merge()
633 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn)) in ntfs_runlists_merge()
654 for (ds = dend; drl[ds].length; ds++) in ntfs_runlists_merge()
687 drl[ds - 1].length; in ntfs_runlists_merge()
692 drl[ds].length = marker_vcn - drl[ds].vcn; in ntfs_runlists_merge()
701 drl[ds].length = (s64)0; in ntfs_runlists_merge()
765 attr_end = (u8 *)attr + le32_to_cpu(attr->length); in ntfs_mapping_pairs_decompress()
781 rl->length = vcn; in ntfs_mapping_pairs_decompress()
806 * Get the change in vcn, i.e. the run length in clusters. in ntfs_mapping_pairs_decompress()
808 * A negative run length doesn't make any sense, but hey, I in ntfs_mapping_pairs_decompress()
810 * length as a signed value so that's how it is... in ntfs_mapping_pairs_decompress()
818 } else { /* The length entry is compulsory. */ in ntfs_mapping_pairs_decompress()
819 ntfs_error(vol->sb, "Missing length entry in mapping pairs array."); in ntfs_mapping_pairs_decompress()
823 * Assume a negative length to indicate data corruption and in ntfs_mapping_pairs_decompress()
827 ntfs_error(vol->sb, "Invalid length in mapping pairs array."); in ntfs_mapping_pairs_decompress()
831 * Enter the current run length into the current runlist in ntfs_mapping_pairs_decompress()
834 rl[rlpos].length = deltaxcn; in ntfs_mapping_pairs_decompress()
836 * Increment the current vcn by the current run length. in ntfs_mapping_pairs_decompress()
886 if ((lcn != -1) && !rl[rlpos].length) { in ntfs_mapping_pairs_decompress()
897 if (rl[rlpos].length) in ntfs_mapping_pairs_decompress()
936 vcn += rl[rlpos].length = max_cluster - in ntfs_mapping_pairs_decompress()
953 rl[rlpos].length = (s64)0; in ntfs_mapping_pairs_decompress()
1015 for (i = 0; likely(rl[i].length); i++) { in ntfs_rl_vcn_to_lcn()
1049 while (likely(rl->length)) { in ntfs_rl_find_vcn_nolock()
1071 * number (lcn) or a specific run length.
1138 while (rl->length && first_vcn >= rl[1].vcn) in ntfs_get_size_for_mapping_pairs()
1140 if (unlikely((!rl->length && first_vcn > rl->vcn) || in ntfs_get_size_for_mapping_pairs()
1148 s64 delta, length = rl->length; in ntfs_get_size_for_mapping_pairs() local
1150 /* We know rl->length != 0 already. */ in ntfs_get_size_for_mapping_pairs()
1151 if (unlikely(length < 0 || rl->lcn < LCN_HOLE)) in ntfs_get_size_for_mapping_pairs()
1155 * run length. in ntfs_get_size_for_mapping_pairs()
1161 length = s1 - rl->vcn; in ntfs_get_size_for_mapping_pairs()
1165 /* Header byte + length. */ in ntfs_get_size_for_mapping_pairs()
1166 rls += 1 + ntfs_get_nr_significant_bytes(length - delta); in ntfs_get_size_for_mapping_pairs()
1185 for (; rl->length && !the_end; rl++) { in ntfs_get_size_for_mapping_pairs()
1186 s64 length = rl->length; in ntfs_get_size_for_mapping_pairs() local
1188 if (unlikely(length < 0 || rl->lcn < LCN_HOLE)) in ntfs_get_size_for_mapping_pairs()
1192 * run length. in ntfs_get_size_for_mapping_pairs()
1198 length = s1 - rl->vcn; in ntfs_get_size_for_mapping_pairs()
1201 /* Header byte + length. */ in ntfs_get_size_for_mapping_pairs()
1202 rls += 1 + ntfs_get_nr_significant_bytes(length); in ntfs_get_size_for_mapping_pairs()
1241 * a given logical cluster number (lcn) or a specific run length to the minimum
1346 while (rl->length && first_vcn >= rl[1].vcn) in ntfs_mapping_pairs_build()
1348 if (unlikely((!rl->length && first_vcn > rl->vcn) || in ntfs_mapping_pairs_build()
1359 s64 delta, length = rl->length; in ntfs_mapping_pairs_build() local
1361 /* We know rl->length != 0 already. */ in ntfs_mapping_pairs_build()
1362 if (unlikely(length < 0 || rl->lcn < LCN_HOLE)) in ntfs_mapping_pairs_build()
1366 * run length. in ntfs_mapping_pairs_build()
1372 length = s1 - rl->vcn; in ntfs_mapping_pairs_build()
1376 /* Write length. */ in ntfs_mapping_pairs_build()
1378 length - delta); in ntfs_mapping_pairs_build()
1409 for (; rl->length && !the_end; rl++) { in ntfs_mapping_pairs_build()
1410 s64 length = rl->length; in ntfs_mapping_pairs_build() local
1412 if (unlikely(length < 0 || rl->lcn < LCN_HOLE)) in ntfs_mapping_pairs_build()
1416 * run length. in ntfs_mapping_pairs_build()
1422 length = s1 - rl->vcn; in ntfs_mapping_pairs_build()
1425 /* Write length. */ in ntfs_mapping_pairs_build()
1427 length); in ntfs_mapping_pairs_build()
1445 de_cnt += rl->length; in ntfs_mapping_pairs_build()
1481 * @new_length: the new length of the runlist in VCNs
1484 * holding the runlist elements to a length of @new_length VCNs.
1517 while (likely(rl->length && new_length >= rl[1].vcn)) in ntfs_rl_truncate_nolock()
1523 if (rl->length) { in ntfs_rl_truncate_nolock()
1530 while (likely(trl->length)) in ntfs_rl_truncate_nolock()
1534 rl->length = new_length - rl->vcn; in ntfs_rl_truncate_nolock()
1540 if (rl->length) { in ntfs_rl_truncate_nolock()
1542 if (!rl->length) in ntfs_rl_truncate_nolock()
1545 rl->length = 0; in ntfs_rl_truncate_nolock()
1560 } else if (likely(/* !rl->length && */ new_length > rl->vcn)) { in ntfs_rl_truncate_nolock()
1568 (rl - 1)->length = new_length - (rl - 1)->vcn; in ntfs_rl_truncate_nolock()
1587 rl->length = new_length - rl->vcn; in ntfs_rl_truncate_nolock()
1590 rl->length = 0; in ntfs_rl_truncate_nolock()
1595 } else /* if (unlikely(!rl->length && new_length == rl->vcn)) */ { in ntfs_rl_truncate_nolock()
1616 for (rlc = rl; rlc->length; rlc++) in ntfs_rl_sparse()
1628 * ntfs_rl_get_compressed_size - calculate length of non sparse regions
1642 for (rlc = rl; rlc->length; rlc++) { in ntfs_rl_get_compressed_size()
1650 ret += rlc->length; in ntfs_rl_get_compressed_size()
1659 left_rle->lcn + left_rle->length == right_rle->lcn) in ntfs_rle_lcn_contiguous()
1669 if (rle->length > 0 && in ntfs_rle_contain()
1670 vcn >= rle->vcn && vcn < rle->vcn + rle->length) in ntfs_rle_contain()
1690 dst_rl[dst_cnt - 1].length == 0) || in ntfs_rl_insert_range()
1715 dst_rl_split.length = start_vcn - i_rl[0].vcn; in ntfs_rl_insert_range()
1719 i_rl[0].length -= dst_rl_split.length; in ntfs_rl_insert_range()
1720 i_rl[0].lcn += dst_rl_split.length; in ntfs_rl_insert_range()
1732 WARN_ON(dst_rle->vcn + dst_rle->length != src_rle->vcn); in ntfs_rl_insert_range()
1733 dst_rle->length += src_rle->length; in ntfs_rl_insert_range()
1742 dst_rle->length += src_rle->length; in ntfs_rl_insert_range()
1782 rl_3rd->vcn = rl->vcn + rl->length; in ntfs_rl_insert_range()
1783 if (rl_3rd->length <= 0) in ntfs_rl_insert_range()
1808 dst_rl[dst_cnt - 1].length == 0)) in ntfs_rl_punch_hole()
1812 dst_rl[dst_cnt - 2].vcn + dst_rl[dst_cnt - 2].length - 1); in ntfs_rl_punch_hole()
1828 end_split = e_rl->vcn + e_rl->length - 1 != end_vcn ? true : false; in ntfs_rl_punch_hole()
1852 (*punch_rl)[punch_cnt].length = 0; in ntfs_rl_punch_hole()
1872 new_rl[new_1st_cnt - 1].length = first_cnt; in ntfs_rl_punch_hole()
1875 (*punch_rl)[0].length -= first_cnt; in ntfs_rl_punch_hole()
1882 hole_rl[0].length = (s64)len; in ntfs_rl_punch_hole()
1895 new_rl[new_1st_cnt + 1].length -= first_cnt; in ntfs_rl_punch_hole()
1900 (*punch_rl)[punch_cnt - 1].length -= in ntfs_rl_punch_hole()
1901 new_rl[new_1st_cnt + 1].length; in ntfs_rl_punch_hole()
1903 (*punch_rl)[punch_cnt - 1].length = first_cnt; in ntfs_rl_punch_hole()
1913 s_rl->length += s_rl[1].length; in ntfs_rl_punch_hole()
1918 s_rl->length += s_rl[2].length; in ntfs_rl_punch_hole()
1925 s_rl->length += s_rl[1].length; in ntfs_rl_punch_hole()
1938 (*punch_rl)[punch_cnt - 1].length; in ntfs_rl_punch_hole()
1959 dst_rl[dst_cnt - 1].length == 0)) in ntfs_rl_collapse_range()
1979 end_split = e_rl->vcn + e_rl->length - 1 != end_vcn ? true : false; in ntfs_rl_collapse_range()
2001 (*punch_rl)[punch_cnt].length = 0; in ntfs_rl_collapse_range()
2020 new_rl[new_1st_cnt - 1].length = first_cnt; in ntfs_rl_collapse_range()
2023 (*punch_rl)[0].length -= first_cnt; in ntfs_rl_collapse_range()
2037 new_rl[new_1st_cnt].length -= first_cnt; in ntfs_rl_collapse_range()
2042 (*punch_rl)[punch_cnt - 1].length -= in ntfs_rl_collapse_range()
2043 new_rl[new_1st_cnt].length; in ntfs_rl_collapse_range()
2045 (*punch_rl)[punch_cnt - 1].length = first_cnt; in ntfs_rl_collapse_range()
2051 for (i = new_1st_cnt == 0 ? 1 : new_1st_cnt; new_rl[i].length; i++) in ntfs_rl_collapse_range()
2052 new_rl[i].vcn = new_rl[i - 1].vcn + new_rl[i - 1].length; in ntfs_rl_collapse_range()
2053 new_rl[i].vcn = new_rl[i - 1].vcn + new_rl[i - 1].length; in ntfs_rl_collapse_range()
2063 s_rl->length += s_rl[1].length; in ntfs_rl_collapse_range()
2076 (*punch_rl)[punch_cnt - 1].length; in ntfs_rl_collapse_range()