New API: ntfs_rl_truncate().

(Logical change 1.58)
edge.strict_endians
cantab.net!aia21 2002-12-26 20:36:52 +00:00
parent c9ca9fd9b7
commit 1dd01bf3c7
2 changed files with 19 additions and 1 deletions

View File

@ -63,5 +63,7 @@ extern runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol,
extern int ntfs_mapping_pairs_build(const ntfs_volume *vol, s8 *dst,
const int dst_len, const runlist_element *rl);
extern int ntfs_rl_truncate(runlist_element *rl, const VCN start_vcn);
#endif /* defined _NTFS_RUNLIST_H */

View File

@ -1106,7 +1106,7 @@ rl_err_out:
*
* Create the mapping pairs array from the runlist @rl and save the array in
* @dst. @dst_len is the size of @dst in bytes and it should be at least equal
* to the value obtained by calling ntfs_get_size_for_mapping_pairs(@rl).
* to the value obtained by calling ntfs_get_size_for_mapping_pairs().
*
* Return 0 on success or when @rl is NULL. On error, return -1 with errno set
* to the error code. The following error codes are defined:
@ -1174,3 +1174,19 @@ err_out:
return -1;
}
/**
* ntfs_rl_truncate - truncate a runlist starting at a specified vcn
* @rl: runlist to truncate
* @start_vcn: first vcn which should be cut off
*
* Truncate the runlist @rl starting at vcn @start_vcn as well as the memory
* buffer holding the runlist.
*
* Return 0 on success and -1 on error with errno set to the error code.
*/
int ntfs_rl_truncate(runlist_element *rl, const VCN start_vcn)
{
errno = ENOTSUP;
return -1;
}