fs/ntfs/attrib.h
Source file repositories/reference/linux-study-clean/fs/ntfs/attrib.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ntfs/attrib.h- Extension
.h- Size
- 7270 bytes
- Lines
- 169
- 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
ntfs.hdir.h
Detected Declarations
struct ntfs_attr_search_ctxfunction ntfs_attr_size
Annotated Snippet
struct ntfs_attr_search_ctx {
struct mft_record *mrec;
bool mapped_mrec;
struct attr_record *attr;
bool is_first;
struct ntfs_inode *ntfs_ino;
struct attr_list_entry *al_entry;
struct ntfs_inode *base_ntfs_ino;
struct mft_record *base_mrec;
bool mapped_base_mrec;
struct attr_record *base_attr;
};
enum { /* ways of processing holes when expanding */
HOLES_NO,
HOLES_OK,
};
int ntfs_map_runlist_nolock(struct ntfs_inode *ni, s64 vcn,
struct ntfs_attr_search_ctx *ctx);
int ntfs_map_runlist(struct ntfs_inode *ni, s64 vcn);
s64 ntfs_attr_vcn_to_lcn_nolock(struct ntfs_inode *ni, const s64 vcn,
const bool write_locked);
struct runlist_element *ntfs_attr_find_vcn_nolock(struct ntfs_inode *ni,
const s64 vcn, struct ntfs_attr_search_ctx *ctx);
struct runlist_element *__ntfs_attr_find_vcn_nolock(struct runlist *runlist,
const s64 vcn);
int ntfs_attr_map_whole_runlist(struct ntfs_inode *ni);
int ntfs_attr_lookup(const __le32 type, const __le16 *name,
const u32 name_len, const u32 ic,
const s64 lowest_vcn, const u8 *val, const u32 val_len,
struct ntfs_attr_search_ctx *ctx);
bool ntfs_attr_list_entry_is_valid(const struct attr_list_entry *ale,
const u8 *al_end);
bool ntfs_attr_list_is_valid(const u8 *al_start, s64 size);
int load_attribute_list(struct ntfs_inode *base_ni,
u8 *al_start, const s64 size);
static inline s64 ntfs_attr_size(const struct attr_record *a)
{
if (!a->non_resident)
return (s64)le32_to_cpu(a->data.resident.value_length);
return le64_to_cpu(a->data.non_resident.data_size);
}
void ntfs_attr_reinit_search_ctx(struct ntfs_attr_search_ctx *ctx);
struct ntfs_attr_search_ctx *ntfs_attr_get_search_ctx(struct ntfs_inode *ni,
struct mft_record *mrec);
void ntfs_attr_put_search_ctx(struct ntfs_attr_search_ctx *ctx);
int ntfs_attr_size_bounds_check(const struct ntfs_volume *vol,
const __le32 type, const s64 size);
int ntfs_attr_can_be_resident(const struct ntfs_volume *vol,
const __le32 type);
int ntfs_attr_map_cluster(struct ntfs_inode *ni, s64 vcn_start, s64 *lcn_start,
s64 *lcn_count, s64 max_clu_count, bool *balloc, bool update_mp, bool skip_holes);
int ntfs_attr_record_resize(struct mft_record *m, struct attr_record *a, u32 new_size);
int ntfs_resident_attr_value_resize(struct mft_record *m, struct attr_record *a,
const u32 new_size);
int ntfs_attr_make_non_resident(struct ntfs_inode *ni, const u32 data_size);
int ntfs_attr_set(struct ntfs_inode *ni, const s64 ofs, const s64 cnt,
const u8 val);
int ntfs_attr_set_initialized_size(struct ntfs_inode *ni, loff_t new_size);
int ntfs_attr_open(struct ntfs_inode *ni, const __le32 type,
__le16 *name, u32 name_len);
void ntfs_attr_close(struct ntfs_inode *n);
int ntfs_attr_fallocate(struct ntfs_inode *ni, loff_t start, loff_t byte_len, bool keep_size);
int ntfs_non_resident_attr_insert_range(struct ntfs_inode *ni, s64 start_vcn, s64 len);
int ntfs_non_resident_attr_collapse_range(struct ntfs_inode *ni, s64 start_vcn, s64 len);
int ntfs_non_resident_attr_punch_hole(struct ntfs_inode *ni, s64 start_vcn, s64 len);
int __ntfs_attr_truncate_vfs(struct ntfs_inode *ni, const s64 newsize,
const s64 i_size);
int ntfs_attr_expand(struct ntfs_inode *ni, const s64 newsize, const s64 prealloc_size);
int ntfs_attr_truncate_i(struct ntfs_inode *ni, const s64 newsize, unsigned int holes);
int ntfs_attr_truncate(struct ntfs_inode *ni, const s64 newsize);
int ntfs_attr_rm(struct ntfs_inode *ni);
int ntfs_attr_exist(struct ntfs_inode *ni, const __le32 type, __le16 *name,
u32 name_len);
int ntfs_attr_remove(struct ntfs_inode *ni, const __le32 type, __le16 *name,
u32 name_len);
int ntfs_attr_record_rm(struct ntfs_attr_search_ctx *ctx);
int ntfs_attr_record_move_to(struct ntfs_attr_search_ctx *ctx, struct ntfs_inode *ni);
int ntfs_attr_add(struct ntfs_inode *ni, __le32 type,
__le16 *name, u8 name_len, u8 *val, s64 size);
int ntfs_attr_record_move_away(struct ntfs_attr_search_ctx *ctx, int extra);
char *ntfs_attr_name_get(const struct ntfs_volume *vol, const __le16 *uname,
const int uname_len);
void ntfs_attr_name_free(unsigned char **name);
void *ntfs_attr_readall(struct ntfs_inode *ni, const __le32 type,
__le16 *name, u32 name_len, s64 *data_size);
Annotation
- Immediate include surface: `ntfs.h`, `dir.h`.
- Detected declarations: `struct ntfs_attr_search_ctx`, `function ntfs_attr_size`.
- 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.