.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "NTFS_GET_SIZE_FOR_MAPPING_PAIRS" "9" "09 October 2005" "" ""
.SH NAME
ntfs_get_size_for_mapping_pairs \- get bytes needed for mapping pairs array
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int ntfs_get_size_for_mapping_pairs (const ntfs_volume * \fIvol\fB, const runlist_element * \fIrl\fB, const VCN \fIfirst_vcn\fB, const VCN \fIlast_vcn\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIvol\fB\fR
ntfs volume (needed for the ntfs version)
.TP
\fB\fIrl\fB\fR
locked runlist to determine the size of the mapping pairs of
.TP
\fB\fIfirst_vcn\fB\fR
first vcn which to include in the mapping pairs array
.TP
\fB\fIlast_vcn\fB\fR
last vcn which to include in the mapping pairs array
.SH "DESCRIPTION"
.PP
Walk the locked runlist \fIrl\fR and calculate the size in bytes of the mapping
pairs array corresponding to the runlist \fIrl\fR, starting at vcn \fIfirst_vcn\fR and
finishing with vcn \fIlast_vcn\fR\&.
.PP
A \fIlast_vcn\fR of -1 means end of runlist and in that case the size of the
mapping pairs array corresponding to the runlist starting at vcn \fIfirst_vcn\fR
and finishing at the end of the runlist is determined.
.PP
This for example allows us to allocate a buffer of the right size when
building the mapping pairs array.
.PP
If \fIrl\fR is NULL, just return 1 (for the single terminator byte).
.PP
Return the calculated size in bytes on success. On error, return -errno.
.SH "THE FOLLOWING ERROR CODES ARE DEFINED"
.PP
-EINVAL - Run list contains unmapped elements. Make sure to only pass
fully mapped runlists to this function.
-EIO - The runlist is corrupt.
.SH "LOCKING"
.PP
\fIrl\fR must be locked on entry (either for reading or writing), it
remains locked throughout, and is left locked upon return.