Lines Matching refs:runlist

2  * runlist.c - Run list handling code. Originated from the Linux-NTFS project.
53 * ntfs_rl_mm - runlist memmove
70 * ntfs_rl_mc - runlist memory copy
90 * @rl: original runlist
91 * @old_size: number of runlist elements in the original runlist @rl
92 * @new_size: number of runlist elements we need space for
115 * Extend a runlist by some entry count
116 * The runlist may have to be reallocated
118 * Returns the reallocated runlist
120 * the runlist is left unchanged if the reallocation fails
144 ntfs_log_error("Cannot extend unmapped runlist");
153 * @dst: original runlist
154 * @src: new runlist to test for mergeability with @dst
189 * @dst: original, destination runlist
190 * @src: new runlist to merge with @dst
192 * Merge the two runlists, writing into the destination runlist @dst. The
194 * destination runlist.
202 * ntfs_rl_append - append a runlist after a given element
203 * @dst: original runlist to be worked on
205 * @src: runlist to be inserted into @dst
207 * @loc: append the new runlist @src after this element in @dst
209 * Append the runlist @src after element @loc in @dst. Merge the right end of
210 * the new runlist, if necessary. Adjust the size of the hole before the
211 * appended runlist.
213 * On success, return a pointer to the new, combined, runlist. Note, both
215 * the pointers for anything any more. (Strictly speaking the returned runlist
269 * ntfs_rl_insert - insert a runlist into another
270 * @dst: original runlist to be worked on
272 * @src: new runlist to be inserted
274 * @loc: insert the new runlist @src before this element in @dst
276 * Insert the runlist @src before element @loc in the runlist @dst. Merge the
277 * left end of the new runlist, if necessary. Adjust the size of the hole
278 * after the inserted runlist.
280 * On success, return a pointer to the new, combined, runlist. Note, both
282 * the pointers for anything any more. (Strictly speaking the returned runlist
327 * original runlist.
366 * ntfs_rl_replace - overwrite a runlist element with another runlist
367 * @dst: original runlist to be worked on
369 * @src: new runlist to be inserted
371 * @loc: index in runlist @dst to overwrite with @src
373 * Replace the runlist element @dst at @loc with @src. Merge the left and
374 * right ends of the inserted runlist, if necessary.
376 * On success, return a pointer to the new, combined, runlist. Note, both
378 * the pointers for anything any more. (Strictly speaking the returned runlist
453 * ntfs_rl_split - insert a runlist into the centre of a hole
454 * @dst: original runlist to be worked on
456 * @src: new runlist to be inserted
458 * @loc: index in runlist @dst at which to split and insert @src
460 * Split the runlist @dst at @loc into two and insert @new in between the two
464 * On success, return a pointer to the new, combined, runlist. Note, both
466 * the pointers for anything any more. (Strictly speaking the returned runlist
530 /* Complete the source runlist if necessary. */
532 /* Scan to the end of the source runlist. */
539 /* Insert start element at the front of the runlist. */
550 /* Skip any unmapped start element(s) in the source runlist. */
554 /* Can't have an entirely unmapped source runlist. */
557 ntfs_log_perror("%s: unmapped source runlist", __FUNCTION__);
653 * We need to create an unmapped runlist element in
662 /* Add an unmapped runlist element. */
701 ntfs_log_debug("Merged runlist:\n");
709 marker_vcn = ((runlist*)NULL)->lcn;
715 * @drl: original runlist to be worked on
716 * @srl: new runlist to be merged into @drl
719 * are sensible and can be merged. The runlist @srl must be either after the
720 * runlist @drl or completely within a hole (or unmapped region) in @drl.
731 * It can also be appended to the end of the runlist, which is just a variant
734 * On success, return a pointer to the new, combined, runlist. Note, both
736 * the pointers for anything any more. (Strictly speaking the returned runlist
741 * ENOMEM Not enough memory to allocate runlist array.
757 * ntfs_mapping_pairs_decompress - convert mapping pairs array to runlist
760 * @old_rl: optional runlist in which to insert @attr's runlist
762 * Decompress the attribute @attr's mapping pairs array into a runlist. On
763 * success, return the decompressed runlist.
765 * If @old_rl is not NULL, decompressed runlist is inserted into the
766 * appropriate place in @old_rl and the resultant, combined runlist is
773 * ENOMEM Not enough memory to allocate runlist array.
774 * EIO Corrupt runlist.
779 * new runlist disregarding the already existing one and then splicing the
781 * runlist if overlap present before returning NULL, with errno = ERANGE).
789 runlist_element *rl; /* The output runlist. */
792 int err, rlsize; /* Size of runlist buffer. */
793 u16 rlpos; /* Current runlist position in units of
816 /* Current position in runlist array. */
818 /* Allocate first 4kiB block and set current runlist size to 4kiB. */
848 /* Enter the current vcn into the current runlist element. */
877 * Enter the current run length into the current runlist
927 /* Enter the current lcn into the runlist element. */
930 /* Get to the next runlist element, skipping zero-sized holes */
940 * vcn in the runlist - 1, or something has gone badly wrong.
951 * If this is the base of runlist (if 'lowest_vcn' is 0), then
953 * number of clusters across all extents. If the runlist covers all
955 * the runlist with LCN_NOENT. Otherwise, we must terminate the runlist
967 * The runlist doesn't cover all the clusters, so there
980 * There are more VCNs in the runlist than expected, so
981 * the runlist is corrupt.
993 /* Setup terminating runlist element. */
996 /* If no existing runlist was specified, we are done. */
1036 * ntfs_rl_vcn_to_lcn - convert a vcn into a lcn given a runlist
1037 * @rl: runlist to use for conversion
1041 * cluster number (lcn) of a device using the runlist @rl to map vcns to their
1049 * -2 = LCN_RL_NOT_MAPPED This is part of the runlist which has not been
1050 * inserted into the runlist yet.
1061 * If rl is NULL, assume that we have found an unmapped runlist. The
1092 * @rl: runlist specifying where to read the data from
1093 * @pos: byte position within runlist @rl at which to begin the read
1098 * @b gathering the data as specified by the runlist @rl. The read begins at
1099 * offset @pos into the runlist @rl.
1121 ntfs_log_perror("Failed to read runlist [vol: %p rl: %p "
1182 * @rl: runlist entry specifying where to write the data to
1183 * @ofs: offset in file for runlist element indicated in @rl
1184 * @pos: byte position from runlist beginning at which to begin the write
1189 * scattering the data as specified by the runlist @rl. The write begins at
1190 * offset @pos into the runlist @rl. If a run is sparse then the related buffer
1210 ntfs_log_perror("Failed to write runlist [vol: %p rl: %p "
1309 * @rl: runlist for which to determine the size of the mapping pairs
1312 * Walk the runlist @rl and calculate the size in bytes of the mapping pairs
1313 * array corresponding to the runlist @rl, starting at vcn @start_vcn. This
1324 * EIO - The runlist is corrupt.
1348 /* Skip to runlist element containing @start_vcn. */
1382 /* Go to next runlist element. */
1428 * This is used when building the mapping pairs array of a runlist to compress
1459 * ntfs_mapping_pairs_build - build the mapping pairs array from a runlist
1463 * @rl: runlist for which to build the mapping pairs array
1467 * Create the mapping pairs array from the runlist @rl, starting at vcn
1486 * EIO - The runlist is corrupt.
1509 /* Skip to runlist element containing @start_vcn. */
1560 /* Go to next runlist element. */
1629 * ntfs_rl_truncate - truncate a runlist starting at a specified vcn
1630 * @arl: address of runlist to truncate
1633 * Truncate the runlist *@arl starting at vcn @start_vcn as well as the memory
1634 * buffer holding the runlist.
1638 * NOTE: @arl is the address of the runlist. We need the address so we can
1639 * modify the pointer to the runlist with the new, reallocated memory buffer.
1641 int ntfs_rl_truncate(runlist **arl, const VCN start_vcn)
1643 runlist *rl;
1660 ntfs_log_perror("Start_vcn lies outside front of runlist");
1673 ntfs_log_trace("Truncating already truncated runlist?\n");
1681 * If a run was partially truncated, make the following runlist
1682 * element a terminator instead of the truncated runlist
1697 * FIXME: Below code is broken, because runlist allocations must be
1712 * ntfs_rl_sparse - check whether runlist have sparse regions or not.
1713 * @rl: runlist to check
1717 int ntfs_rl_sparse(runlist *rl)
1719 runlist *rlc;
1731 ntfs_log_perror("%s: bad runlist", __FUNCTION__);
1742 * @rl: runlist to calculate for
1746 s64 ntfs_rl_get_compressed_size(ntfs_volume *vol, runlist *rl)
1748 runlist *rlc;
1761 ntfs_log_perror("%s: bad runlist", __FUNCTION__);
1783 * test_rl_dump_runlist - Runlist test: Display the contents of a runlist
1861 * test_rl_read_buffer - Runlist test: Read a file containing a runlist
2063 * test_rl_zero - Runlist test: Merge a zero-length runlist
2148 if (!test_rl_read_buffer("runlist-data/attr1.bin", (u8*) attr1, 1024))
2150 if (!test_rl_read_buffer("runlist-data/attr2.bin", (u8*) attr2, 1024))
2152 if (!test_rl_read_buffer("runlist-data/attr3.bin", (u8*) attr3, 1024))