Lines Matching refs:runlist
25 * ntfs_map_runlist_nolock - map (a part of) a runlist of an ntfs inode
26 * @ni: ntfs inode for which to map (part of) a runlist
27 * @vcn: map runlist part containing this vcn
30 * Map the part of a runlist containing the @vcn of the ntfs inode @ni.
34 * runlist fragments and allows their mapping. If you do not have the mft
51 * of bounds of the runlist.
53 * Note the runlist can be NULL after this function returns if @vcn is zero and
54 * the attribute has zero allocated size, i.e. there simply is no runlist.
63 * Locking: - The runlist described by @ni must be locked for writing on entry
64 * and is locked on return. Note the runlist will be modified.
83 ntfs_debug("Mapping runlist part containing vcn 0x%llx.",
117 * map the runlist below, so there is definitely no need to get
165 * we then try to map the already mapped runlist fragment and
173 rl = ntfs_mapping_pairs_decompress(ni->vol, a, ni->runlist.rl);
177 ni->runlist.rl = rl;
270 * ntfs_map_runlist - map (a part of) a runlist of an ntfs inode
271 * @ni: ntfs inode for which to map (part of) a runlist
272 * @vcn: map runlist part containing this vcn
274 * Map the part of a runlist containing the @vcn of the ntfs inode @ni.
278 * of bounds of the runlist.
280 * Locking: - The runlist must be unlocked on entry and is unlocked on return.
281 * - This function takes the runlist lock for writing and may modify
282 * the runlist.
288 down_write(&ni->runlist.lock);
290 if (likely(ntfs_rl_vcn_to_lcn(ni->runlist.rl, vcn) <=
293 up_write(&ni->runlist.lock);
299 * @ni: ntfs inode of the attribute whose runlist to search
301 * @write_locked: true if the runlist is locked for writing
303 * Find the virtual cluster number @vcn in the runlist of the ntfs attribute
310 * If @write_locked is true the caller has locked the runlist for writing and
318 * LCN_ENOENT There is no such vcn in the runlist, i.e. @vcn is out of bounds.
319 * LCN_ENOMEM Not enough memory to map runlist.
320 * LCN_EIO Critical error (runlist/file is corrupt, i/o error, etc).
322 * Locking: - The runlist must be locked on entry and is left locked on return.
323 * - If @write_locked is 'false', i.e. the runlist is locked for reading,
325 * the runlist still being the same when this function returns.
340 if (!ni->runlist.rl) {
349 /* Convert vcn to lcn. If that fails map the runlist and retry once. */
350 lcn = ntfs_rl_vcn_to_lcn(ni->runlist.rl, vcn);
362 up_read(&ni->runlist.lock);
363 down_write(&ni->runlist.lock);
364 if (unlikely(ntfs_rl_vcn_to_lcn(ni->runlist.rl, vcn) !=
366 up_write(&ni->runlist.lock);
367 down_read(&ni->runlist.lock);
373 up_write(&ni->runlist.lock);
374 down_read(&ni->runlist.lock);
394 * ntfs_attr_find_vcn_nolock - find a vcn in the runlist of an ntfs inode
395 * @ni: ntfs inode describing the runlist to search
399 * Find the virtual cluster number @vcn in the runlist described by the ntfs
400 * inode @ni and return the address of the runlist element containing the @vcn.
407 * runlist fragments and allows their mapping. If you do not have the mft
421 * Note you need to distinguish between the lcn of the returned runlist element
425 * Return the runlist element containing the @vcn on success and
431 * -ENOENT - No such vcn in the runlist, i.e. @vcn is out of bounds.
432 * -ENOMEM - Not enough memory to map runlist.
433 * -EIO - Critical error (runlist/file is corrupt, i/o error, etc).
442 * Locking: - The runlist described by @ni must be locked for writing on entry
443 * and is locked on return. Note the runlist may be modified when
444 * needed runlist fragments need to be mapped.
463 if (!ni->runlist.rl) {
472 rl = ni->runlist.rl;
500 * The @vcn is in an unmapped region, map the runlist
707 * @runlist: runlist of the attribute list
712 * Walk the runlist @runlist and load all clusters from it copying them into
720 int load_attribute_list(ntfs_volume *vol, runlist *runlist, u8 *al_start,
735 if (!vol || !runlist || !al || size <= 0 || initialized_size < 0 ||
745 down_read(&runlist->lock);
746 rl = runlist->rl;
748 ntfs_error(sb, "Cannot read attribute list since runlist is "
752 /* Read all clusters specified by the runlist one run at a time. */
790 up_read(&runlist->lock);
1617 down_write(&ni->runlist.lock);
1722 ni->runlist.rl = rl;
1757 up_write(&ni->runlist.lock);
1834 ni->runlist.rl = NULL;
1835 up_write(&ni->runlist.lock);
1903 * Locking: This function takes the runlist lock of @ni for writing as well as
1998 * We will be modifying both the runlist (if non-resident) and the mft
2001 down_write(&ni->runlist.lock);
2086 up_write(&ni->runlist.lock);
2182 rl = ni->runlist.rl;
2184 /* Seek to the end of the runlist. */
2190 (rl->lcn == LCN_ENOENT && rl > ni->runlist.rl &&
2194 rl = ntfs_mapping_pairs_decompress(vol, a, ni->runlist.rl);
2201 "mapping of a runlist "
2210 ni->runlist.rl = rl;
2211 /* Seek to the end of the runlist. */
2216 * We now know the runlist of the last extent is mapped and @rl is at
2217 * the end of the runlist. We want to begin allocating clusters
2223 while (rl->lcn < 0 && rl > ni->runlist.rl)
2245 rl = ntfs_runlists_merge(ni->runlist.rl, rl2);
2251 "because the runlist merge failed "
2266 ni->runlist.rl = rl;
2269 /* Find the runlist element with which the attribute extent starts. */
2381 up_write(&ni->runlist.lock);
2417 up_write(&ni->runlist.lock);
2438 * If the runlist truncation fails and/or the search context is no
2443 if (ntfs_rl_truncate_nolock(vol, &ni->runlist, ll) || IS_ERR(m)) {
2447 "truncate attribute runlist");
2477 up_write(&ni->runlist.lock);