fs/ntfs/runlist.h
Source file repositories/reference/linux-study-clean/fs/ntfs/runlist.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ntfs/runlist.h- Extension
.h- Size
- 3472 bytes
- Lines
- 98
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
volume.h
Detected Declarations
struct runlist_elementstruct runlistfunction ntfs_init_runlist
Annotated Snippet
struct runlist_element {
s64 vcn;
s64 lcn;
s64 length;
};
/*
* runlist - in memory vcn to lcn mapping array including a read/write lock
* @rl: pointer to an array of runlist elements
* @lock: read/write spinlock for serializing access to @rl
* @rl_hint: hint/cache pointing to the last accessed runlist element
*/
struct runlist {
struct runlist_element *rl;
struct rw_semaphore lock;
size_t count;
int rl_hint;
};
static inline void ntfs_init_runlist(struct runlist *rl)
{
rl->rl = NULL;
init_rwsem(&rl->lock);
rl->count = 0;
rl->rl_hint = -1;
}
enum {
LCN_DELALLOC = -1,
LCN_HOLE = -2,
LCN_RL_NOT_MAPPED = -3,
LCN_ENOENT = -4,
LCN_ENOMEM = -5,
LCN_EIO = -6,
LCN_EINVAL = -7,
};
struct runlist_element *ntfs_runlists_merge(struct runlist *d_runlist,
struct runlist_element *srl, size_t s_rl_count,
size_t *new_rl_count);
struct runlist_element *ntfs_mapping_pairs_decompress(const struct ntfs_volume *vol,
const struct attr_record *attr, struct runlist *old_runlist,
size_t *new_rl_count);
s64 ntfs_rl_vcn_to_lcn(const struct runlist_element *rl, const s64 vcn);
struct runlist_element *ntfs_rl_find_vcn_nolock(struct runlist_element *rl, const s64 vcn);
int ntfs_get_size_for_mapping_pairs(const struct ntfs_volume *vol,
const struct runlist_element *rl, const s64 first_vcn,
const s64 last_vcn, int max_mp_size);
int ntfs_mapping_pairs_build(const struct ntfs_volume *vol, s8 *dst,
const int dst_len, const struct runlist_element *rl,
const s64 first_vcn, const s64 last_vcn, s64 *const stop_vcn,
struct runlist_element **stop_rl, unsigned int *de_cluster_count);
int ntfs_rl_truncate_nolock(const struct ntfs_volume *vol,
struct runlist *const runlist, const s64 new_length);
int ntfs_rl_sparse(struct runlist_element *rl);
s64 ntfs_rl_get_compressed_size(struct ntfs_volume *vol, struct runlist_element *rl);
struct runlist_element *ntfs_rl_insert_range(struct runlist_element *dst_rl, int dst_cnt,
struct runlist_element *src_rl, int src_cnt, size_t *new_cnt);
struct runlist_element *ntfs_rl_punch_hole(struct runlist_element *dst_rl, int dst_cnt,
s64 start_vcn, s64 len, struct runlist_element **punch_rl,
size_t *new_rl_cnt);
struct runlist_element *ntfs_rl_collapse_range(struct runlist_element *dst_rl, int dst_cnt,
s64 start_vcn, s64 len, struct runlist_element **punch_rl,
size_t *new_rl_cnt);
struct runlist_element *ntfs_rl_realloc(struct runlist_element *rl, int old_size,
int new_size);
#endif /* _LINUX_NTFS_RUNLIST_H */
Annotation
- Immediate include surface: `volume.h`.
- Detected declarations: `struct runlist_element`, `struct runlist`, `function ntfs_init_runlist`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.