fs/xfs/scrub/btree.h

Source file repositories/reference/linux-study-clean/fs/xfs/scrub/btree.h

File Facts

System
Linux kernel
Corpus path
fs/xfs/scrub/btree.h
Extension
.h
Size
1922 bytes
Lines
71
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct xchk_btree_key {
	union xfs_btree_key		key;
	bool				valid;
};

struct xchk_btree {
	/* caller-provided scrub state */
	struct xfs_scrub		*sc;
	struct xfs_btree_cur		*cur;
	xchk_btree_rec_fn		scrub_rec;
	const struct xfs_owner_info	*oinfo;
	void				*private;

	/* internal scrub state */
	bool				lastrec_valid;
	union xfs_btree_rec		lastrec;
	struct list_head		to_check;

	/* this element must come last! */
	struct xchk_btree_key		lastkey[];
};

/*
 * Calculate the size of a xchk_btree structure.  There are nlevels-1 slots for
 * keys because we track leaf records separately in lastrec.
 */
static inline size_t
xchk_btree_sizeof(unsigned int nlevels)
{
	return struct_size_t(struct xchk_btree, lastkey, nlevels - 1);
}

int xchk_btree(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
		xchk_btree_rec_fn scrub_fn, const struct xfs_owner_info *oinfo,
		void *private);

#endif /* __XFS_SCRUB_BTREE_H__ */

Annotation

Implementation Notes