fs/xfs/libxfs/xfs_attr_sf.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_attr_sf.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_attr_sf.h- Extension
.h- Size
- 1706 bytes
- Lines
- 59
- 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
- No C-style include directives detected by the generator.
Detected Declarations
function xfs_attr_sf_entsize_bynamefunction xfs_attr_sf_entsizefunction xfs_attr_sf_firstentryfunction xfs_attr_sf_nextentryfunction xfs_attr_sf_endptr
Annotated Snippet
#ifndef __XFS_ATTR_SF_H__
#define __XFS_ATTR_SF_H__
/*
* We generate this then sort it, attr_list() must return things in hash-order.
*/
typedef struct xfs_attr_sf_sort {
uint8_t entno; /* entry number in original list */
uint8_t namelen; /* length of name value (no null) */
uint8_t valuelen; /* length of value */
uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */
xfs_dahash_t hash; /* this entry's hash value */
unsigned char *name; /* name value, pointer into buffer */
void *value;
} xfs_attr_sf_sort_t;
#define XFS_ATTR_SF_ENTSIZE_MAX /* max space for name&value */ \
((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
/* space name/value uses */
static inline int xfs_attr_sf_entsize_byname(uint8_t nlen, uint8_t vlen)
{
return sizeof(struct xfs_attr_sf_entry) + nlen + vlen;
}
/* space an entry uses */
static inline int xfs_attr_sf_entsize(struct xfs_attr_sf_entry *sfep)
{
return struct_size(sfep, nameval, sfep->namelen + sfep->valuelen);
}
/* first entry in the SF attr fork */
static inline struct xfs_attr_sf_entry *
xfs_attr_sf_firstentry(struct xfs_attr_sf_hdr *hdr)
{
return (struct xfs_attr_sf_entry *)(hdr + 1);
}
/* next entry after sfep */
static inline struct xfs_attr_sf_entry *
xfs_attr_sf_nextentry(struct xfs_attr_sf_entry *sfep)
{
return (void *)sfep + xfs_attr_sf_entsize(sfep);
}
/* pointer to the space after the last entry, e.g. for adding a new one */
static inline struct xfs_attr_sf_entry *
xfs_attr_sf_endptr(struct xfs_attr_sf_hdr *sf)
{
return (void *)sf + be16_to_cpu(sf->totsize);
}
#endif /* __XFS_ATTR_SF_H__ */
Annotation
- Detected declarations: `function xfs_attr_sf_entsize_byname`, `function xfs_attr_sf_entsize`, `function xfs_attr_sf_firstentry`, `function xfs_attr_sf_nextentry`, `function xfs_attr_sf_endptr`.
- 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.