fs/xfs/scrub/dirtree.h
Source file repositories/reference/linux-study-clean/fs/xfs/scrub/dirtree.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/scrub/dirtree.h- Extension
.h- Size
- 4858 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
- No C-style include directives detected by the generator.
Detected Declarations
struct xchk_dirpath_stepstruct xchk_dirpathstruct xchk_dirtree_outcomesstruct xchk_dirtreeenum xchk_dirpath_outcome
Annotated Snippet
struct xchk_dirpath_step {
/* Directory entry name associated with this parent link. */
xfblob_cookie name_cookie;
unsigned int name_len;
/* Handle of the parent directory. */
struct xfs_parent_rec pptr_rec;
};
enum xchk_dirpath_outcome {
XCHK_DIRPATH_SCANNING = 0, /* still being put together */
XCHK_DIRPATH_DELETE, /* delete this path */
XCHK_DIRPATH_CORRUPT, /* corruption detected in path */
XCHK_DIRPATH_LOOP, /* cycle detected further up */
XCHK_DIRPATH_STALE, /* path is stale */
XCHK_DIRPATH_OK, /* path reaches the root */
XREP_DIRPATH_DELETING, /* path is being deleted */
XREP_DIRPATH_DELETED, /* path has been deleted */
XREP_DIRPATH_ADOPTING, /* path is being adopted */
XREP_DIRPATH_ADOPTED, /* path has been adopted */
};
/*
* Each of these represents one parent pointer path out of the directory being
* scanned. These exist in-core, and hopefully there aren't more than a
* handful of them.
*/
struct xchk_dirpath {
struct list_head list;
/* Index of the first step in this path. */
xfarray_idx_t first_step;
/* Index of the second step in this path. */
xfarray_idx_t second_step;
/* Inodes seen while walking this path. */
struct xino_bitmap seen_inodes;
/* Number of steps in this path. */
unsigned int nr_steps;
/* Which path is this? */
unsigned int path_nr;
/* What did we conclude from following this path? */
enum xchk_dirpath_outcome outcome;
};
struct xchk_dirtree_outcomes {
/* Number of XCHK_DIRPATH_DELETE */
unsigned int bad;
/* Number of XCHK_DIRPATH_CORRUPT or XCHK_DIRPATH_LOOP */
unsigned int suspect;
/* Number of XCHK_DIRPATH_OK */
unsigned int good;
/* Directory needs to be added to lost+found */
bool needs_adoption;
};
struct xchk_dirtree {
struct xfs_scrub *sc;
/* Root inode that we're looking for. */
xfs_ino_t root_ino;
/*
* This is the inode that we're scanning. The live update hook can
* continue to be called after xchk_teardown drops sc->ip but before
* it calls buf_cleanup, so we keep a copy.
*/
xfs_ino_t scan_ino;
/*
* If we start deleting redundant paths to this subdirectory, this is
* the inode number of the surviving parent and the dotdot entry will
* be set to this value. If the value is NULLFSINO, then use @root_ino
* as a stand-in until the orphanage can adopt the subdirectory.
*/
xfs_ino_t parent_ino;
/* Scratch buffer for scanning pptr xattrs */
struct xfs_parent_rec pptr_rec;
struct xfs_da_args pptr_args;
/* Name buffer */
Annotation
- Detected declarations: `struct xchk_dirpath_step`, `struct xchk_dirpath`, `struct xchk_dirtree_outcomes`, `struct xchk_dirtree`, `enum xchk_dirpath_outcome`.
- 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.