Lines Matching defs:src

20 static inline void ntfs_rl_mm(runlist_element *base, int dst, int src,
23 if (likely((dst != src) && (size > 0)))
24 memmove(base + dst, base + src, size * sizeof(*base));
34 runlist_element *srcbase, int src, int size)
37 memcpy(dstbase + dst, srcbase + src, size * sizeof(*dstbase));
131 * @src: new runlist to test for mergeability with @dst
136 * It is up to the caller to serialize access to the runlists @dst and @src.
142 runlist_element *src)
145 BUG_ON(!src);
148 if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED))
151 if ((dst->vcn + dst->length) != src->vcn)
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))
167 * @src: new runlist to merge with @dst
173 * It is up to the caller to serialize access to the runlists @dst and @src.
175 static inline void __ntfs_rl_merge(runlist_element *dst, runlist_element *src)
177 dst->length += src->length;
184 * @src: runlist to be inserted into @dst
185 * @ssize: number of elements in @src (excluding end marker)
186 * @loc: append the new runlist @src after this element in @dst
188 * Append the runlist @src after element @loc in @dst. Merge the right end of
192 * It is up to the caller to serialize access to the runlists @dst and @src.
195 * runlists @dst and @src are deallocated before returning so you cannot use
205 int dsize, runlist_element *src, int ssize, int loc)
207 bool right = false; /* Right end of @src needs merging. */
211 BUG_ON(!src);
215 right = ntfs_are_rl_mergeable(src + ssize - 1, dst + loc + 1);
217 /* Space required: @dst size + @src size, less one if we merged. */
228 __ntfs_rl_merge(src + ssize - 1, dst + loc + 1);
230 /* First run after the @src runs that have been inserted. */
233 /* Move the tail of @dst out of the way, then copy in @src. */
235 ntfs_rl_mc(dst, loc + 1, src, 0, ssize);
251 * @src: new runlist to be inserted
252 * @ssize: number of elements in @src (excluding end marker)
253 * @loc: insert the new runlist @src before this element in @dst
255 * Insert the runlist @src before element @loc in the runlist @dst. Merge the
259 * It is up to the caller to serialize access to the runlists @dst and @src.
262 * runlists @dst and @src are deallocated before returning so you cannot use
272 int dsize, runlist_element *src, int ssize, int loc)
274 bool left = false; /* Left end of @src needs merging. */
275 bool disc = false; /* Discontinuity between @dst and @src. */
279 BUG_ON(!src);
282 * disc => Discontinuity between the end of @dst and the start of @src.
286 disc = (src[0].vcn > 0);
290 left = ntfs_are_rl_mergeable(dst + loc - 1, src);
294 merged_length += src->length;
296 disc = (src[0].vcn > dst[loc - 1].vcn + merged_length);
299 * Space required: @dst size + @src size, less one if we merged, plus
310 __ntfs_rl_merge(dst + loc - 1, src);
312 * First run after the @src runs that have been inserted.
314 * runs in @src. However, if @left, then the first run in @src has
315 * been merged with one in @dst. And if @disc, then @dst and @src do
320 /* Move the tail of @dst out of the way, then copy in @src. */
322 ntfs_rl_mc(dst, loc + disc, src, left, ssize - left);
348 * @src: new runlist to be inserted
349 * @ssize: number of elements in @src (excluding end marker)
350 * @loc: index in runlist @dst to overwrite with @src
352 * Replace the runlist element @dst at @loc with @src. Merge the left and
355 * It is up to the caller to serialize access to the runlists @dst and @src.
358 * runlists @dst and @src are deallocated before returning so you cannot use
368 int dsize, runlist_element *src, int ssize, int loc)
371 bool left = false; /* Left end of @src needs merging. */
372 bool right = false; /* Right end of @src needs merging. */
377 BUG_ON(!src);
381 right = ntfs_are_rl_mergeable(src + ssize - 1, dst + loc + 1);
383 left = ntfs_are_rl_mergeable(dst + loc - 1, src);
401 __ntfs_rl_merge(src + ssize - 1, dst + loc + 1);
403 __ntfs_rl_merge(dst + loc - 1, src);
406 * to make space for the runs to be copied from @src, i.e. the first
410 * already merged into @src.
414 * First run after the @src runs that have been inserted, i.e. where
417 * runs in @src. However, if @left, then the first run in @src has
422 /* Move the tail of @dst out of the way, then copy in @src. */
424 ntfs_rl_mc(dst, loc, src, left, ssize - left);
436 * @src: new runlist to be inserted
437 * @ssize: number of elements in @src (excluding end marker)
438 * @loc: index in runlist @dst at which to split and insert @src
444 * It is up to the caller to serialize access to the runlists @dst and @src.
447 * runlists @dst and @src are deallocated before returning so you cannot use
457 runlist_element *src, int ssize, int loc)
460 BUG_ON(!src);
462 /* Space required: @dst size + @src size + one new hole. */
471 /* Move the tail of @dst out of the way, then copy in @src. */
473 ntfs_rl_mc(dst, loc + 1, src, 0, ssize);
475 /* Adjust the size of the holes either size of @src. */
532 ntfs_debug("src:");