fs/xfs/libxfs/xfs_parent.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_parent.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_parent.h- Extension
.h- Size
- 3260 bytes
- Lines
- 111
- 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
struct xfs_parent_argsfunction xfs_parent_rec_initfunction xfs_inode_to_parent_recfunction xfs_parent_startfunction xfs_parent_finish
Annotated Snippet
struct xfs_parent_args {
struct xfs_parent_rec rec;
struct xfs_parent_rec new_rec;
struct xfs_da_args args;
};
/*
* Start a parent pointer update by allocating the context object we need to
* perform a parent pointer update.
*/
static inline int
xfs_parent_start(
struct xfs_mount *mp,
struct xfs_parent_args **ppargsp)
{
if (!xfs_has_parent(mp)) {
*ppargsp = NULL;
return 0;
}
*ppargsp = kmem_cache_zalloc(xfs_parent_args_cache, GFP_KERNEL);
if (!*ppargsp)
return -ENOMEM;
return 0;
}
/* Finish a parent pointer update by freeing the context object. */
static inline void
xfs_parent_finish(
struct xfs_mount *mp,
struct xfs_parent_args *ppargs)
{
if (ppargs)
kmem_cache_free(xfs_parent_args_cache, ppargs);
}
int xfs_parent_addname(struct xfs_trans *tp, struct xfs_parent_args *ppargs,
struct xfs_inode *dp, const struct xfs_name *parent_name,
struct xfs_inode *child);
int xfs_parent_removename(struct xfs_trans *tp, struct xfs_parent_args *ppargs,
struct xfs_inode *dp, const struct xfs_name *parent_name,
struct xfs_inode *child);
int xfs_parent_replacename(struct xfs_trans *tp,
struct xfs_parent_args *ppargs,
struct xfs_inode *old_dp, const struct xfs_name *old_name,
struct xfs_inode *new_dp, const struct xfs_name *new_name,
struct xfs_inode *child);
int xfs_parent_from_attr(struct xfs_mount *mp, unsigned int attr_flags,
const unsigned char *name, unsigned int namelen,
const void *value, unsigned int valuelen,
xfs_ino_t *parent_ino, uint32_t *parent_gen);
/* Repair functions */
int xfs_parent_lookup(struct xfs_trans *tp, struct xfs_inode *ip,
const struct xfs_name *name, struct xfs_parent_rec *pptr,
struct xfs_da_args *scratch);
int xfs_parent_set(struct xfs_inode *ip, xfs_ino_t owner,
const struct xfs_name *name, struct xfs_parent_rec *pptr,
struct xfs_da_args *scratch);
int xfs_parent_unset(struct xfs_inode *ip, xfs_ino_t owner,
const struct xfs_name *name, struct xfs_parent_rec *pptr,
struct xfs_da_args *scratch);
#endif /* __XFS_PARENT_H__ */
Annotation
- Detected declarations: `struct xfs_parent_args`, `function xfs_parent_rec_init`, `function xfs_inode_to_parent_rec`, `function xfs_parent_start`, `function xfs_parent_finish`.
- 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.