• Home
  • Raw
  • Download

Lines Matching refs:dst

20 static inline void ntfs_rl_mm(runlist_element *base, int dst, int src,  in ntfs_rl_mm()  argument
23 if (likely((dst != src) && (size > 0))) in ntfs_rl_mm()
24 memmove(base + dst, base + src, size * sizeof(*base)); in ntfs_rl_mm()
33 static inline void ntfs_rl_mc(runlist_element *dstbase, int dst, in ntfs_rl_mc() argument
37 memcpy(dstbase + dst, srcbase + src, size * sizeof(*dstbase)); in ntfs_rl_mc()
141 static inline bool ntfs_are_rl_mergeable(runlist_element *dst, in ntfs_are_rl_mergeable() argument
144 BUG_ON(!dst); in ntfs_are_rl_mergeable()
148 if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED)) in ntfs_are_rl_mergeable()
151 if ((dst->vcn + dst->length) != src->vcn) in ntfs_are_rl_mergeable()
154 if ((dst->lcn >= 0) && (src->lcn >= 0) && in ntfs_are_rl_mergeable()
155 ((dst->lcn + dst->length) == src->lcn)) in ntfs_are_rl_mergeable()
158 if ((dst->lcn == LCN_HOLE) && (src->lcn == LCN_HOLE)) in ntfs_are_rl_mergeable()
175 static inline void __ntfs_rl_merge(runlist_element *dst, runlist_element *src) in __ntfs_rl_merge() argument
177 dst->length += src->length; in __ntfs_rl_merge()
204 static inline runlist_element *ntfs_rl_append(runlist_element *dst, in ntfs_rl_append() argument
210 BUG_ON(!dst); in ntfs_rl_append()
215 right = ntfs_are_rl_mergeable(src + ssize - 1, dst + loc + 1); in ntfs_rl_append()
218 dst = ntfs_rl_realloc(dst, dsize, dsize + ssize - right); in ntfs_rl_append()
219 if (IS_ERR(dst)) in ntfs_rl_append()
220 return dst; in ntfs_rl_append()
228 __ntfs_rl_merge(src + ssize - 1, dst + loc + 1); in ntfs_rl_append()
234 ntfs_rl_mm(dst, marker, loc + 1 + right, dsize - (loc + 1 + right)); in ntfs_rl_append()
235 ntfs_rl_mc(dst, loc + 1, src, 0, ssize); in ntfs_rl_append()
238 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn; in ntfs_rl_append()
241 if (dst[marker].lcn == LCN_ENOENT) in ntfs_rl_append()
242 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; in ntfs_rl_append()
244 return dst; in ntfs_rl_append()
271 static inline runlist_element *ntfs_rl_insert(runlist_element *dst, in ntfs_rl_insert() argument
278 BUG_ON(!dst); in ntfs_rl_insert()
290 left = ntfs_are_rl_mergeable(dst + loc - 1, src); in ntfs_rl_insert()
292 merged_length = dst[loc - 1].length; in ntfs_rl_insert()
296 disc = (src[0].vcn > dst[loc - 1].vcn + merged_length); in ntfs_rl_insert()
302 dst = ntfs_rl_realloc(dst, dsize, dsize + ssize - left + disc); in ntfs_rl_insert()
303 if (IS_ERR(dst)) in ntfs_rl_insert()
304 return dst; in ntfs_rl_insert()
310 __ntfs_rl_merge(dst + loc - 1, src); in ntfs_rl_insert()
321 ntfs_rl_mm(dst, marker, loc, dsize - loc); in ntfs_rl_insert()
322 ntfs_rl_mc(dst, loc + disc, src, left, ssize - left); in ntfs_rl_insert()
325 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; in ntfs_rl_insert()
327 if (dst[marker].lcn == LCN_HOLE || dst[marker].lcn == LCN_RL_NOT_MAPPED) in ntfs_rl_insert()
328 dst[marker].length = dst[marker + 1].vcn - dst[marker].vcn; in ntfs_rl_insert()
333 dst[loc].vcn = dst[loc - 1].vcn + dst[loc - 1].length; in ntfs_rl_insert()
334 dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn; in ntfs_rl_insert()
336 dst[loc].vcn = 0; in ntfs_rl_insert()
337 dst[loc].length = dst[loc + 1].vcn; in ntfs_rl_insert()
339 dst[loc].lcn = LCN_RL_NOT_MAPPED; in ntfs_rl_insert()
341 return dst; in ntfs_rl_insert()
367 static inline runlist_element *ntfs_rl_replace(runlist_element *dst, in ntfs_rl_replace() argument
376 BUG_ON(!dst); in ntfs_rl_replace()
381 right = ntfs_are_rl_mergeable(src + ssize - 1, dst + loc + 1); in ntfs_rl_replace()
383 left = ntfs_are_rl_mergeable(dst + loc - 1, src); in ntfs_rl_replace()
390 dst = ntfs_rl_realloc(dst, dsize, dsize + delta); in ntfs_rl_replace()
391 if (IS_ERR(dst)) in ntfs_rl_replace()
392 return dst; in ntfs_rl_replace()
401 __ntfs_rl_merge(src + ssize - 1, dst + loc + 1); in ntfs_rl_replace()
403 __ntfs_rl_merge(dst + loc - 1, src); in ntfs_rl_replace()
423 ntfs_rl_mm(dst, marker, tail, dsize - tail); in ntfs_rl_replace()
424 ntfs_rl_mc(dst, loc, src, left, ssize - left); in ntfs_rl_replace()
427 if (dsize - tail > 0 && dst[marker].lcn == LCN_ENOENT) in ntfs_rl_replace()
428 dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; in ntfs_rl_replace()
429 return dst; in ntfs_rl_replace()
456 static inline runlist_element *ntfs_rl_split(runlist_element *dst, int dsize, in ntfs_rl_split() argument
459 BUG_ON(!dst); in ntfs_rl_split()
463 dst = ntfs_rl_realloc(dst, dsize, dsize + ssize + 1); in ntfs_rl_split()
464 if (IS_ERR(dst)) in ntfs_rl_split()
465 return dst; in ntfs_rl_split()
472 ntfs_rl_mm(dst, loc + 1 + ssize, loc, dsize - loc); in ntfs_rl_split()
473 ntfs_rl_mc(dst, loc + 1, src, 0, ssize); in ntfs_rl_split()
476 dst[loc].length = dst[loc+1].vcn - dst[loc].vcn; in ntfs_rl_split()
477 dst[loc+ssize+1].vcn = dst[loc+ssize].vcn + dst[loc+ssize].length; in ntfs_rl_split()
478 dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn; in ntfs_rl_split()
480 return dst; in ntfs_rl_split()
1238 static inline int ntfs_write_significant_bytes(s8 *dst, const s8 *dst_max, in ntfs_write_significant_bytes() argument
1247 if (unlikely(dst > dst_max)) in ntfs_write_significant_bytes()
1249 *dst++ = l & 0xffll; in ntfs_write_significant_bytes()
1256 if (unlikely(dst > dst_max)) in ntfs_write_significant_bytes()
1259 *dst = (s8)-1; in ntfs_write_significant_bytes()
1261 if (unlikely(dst > dst_max)) in ntfs_write_significant_bytes()
1264 *dst = (s8)0; in ntfs_write_significant_bytes()
1309 int ntfs_mapping_pairs_build(const ntfs_volume *vol, s8 *dst, in ntfs_mapping_pairs_build() argument
1329 *dst = 0; in ntfs_mapping_pairs_build()
1342 dst_max = dst + dst_len - 1; in ntfs_mapping_pairs_build()
1363 len_len = ntfs_write_significant_bytes(dst + 1, dst_max, in ntfs_mapping_pairs_build()
1381 lcn_len = ntfs_write_significant_bytes(dst + 1 + in ntfs_mapping_pairs_build()
1387 dst_next = dst + len_len + lcn_len + 1; in ntfs_mapping_pairs_build()
1391 *dst = lcn_len << 4 | len_len; in ntfs_mapping_pairs_build()
1393 dst = dst_next; in ntfs_mapping_pairs_build()
1414 len_len = ntfs_write_significant_bytes(dst + 1, dst_max, in ntfs_mapping_pairs_build()
1429 lcn_len = ntfs_write_significant_bytes(dst + 1 + in ntfs_mapping_pairs_build()
1436 dst_next = dst + len_len + lcn_len + 1; in ntfs_mapping_pairs_build()
1440 *dst = lcn_len << 4 | len_len; in ntfs_mapping_pairs_build()
1442 dst = dst_next; in ntfs_mapping_pairs_build()
1451 *dst = 0; in ntfs_mapping_pairs_build()