runlist_element * ntfs_rl_replace (runlist_element * dst, int dsize, runlist_element * src, int ssize, int loc);
Replace the runlist element dst at loc with src. Merge the left and right ends of the inserted runlist, if necessary.
It is up to the caller to serialize access to the runlists dst and src.
On success, return a pointer to the new, combined, runlist. Note, both runlists dst and src are deallocated before returning so you cannot use the pointers for anything any more. (Strictly speaking the returned runlist may be the same as dst but this is irrelevant.)
On error, return -errno. Both runlists are left unmodified. The following
-ENOMEM - Not enough memory to allocate runlist array. -EINVAL - Invalid parameters were passed in.