fs/xfs/libxfs/xfs_errortag.h

Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_errortag.h

File Facts

System
Linux kernel
Corpus path
fs/xfs/libxfs/xfs_errortag.h
Extension
.h
Size
6015 bytes
Lines
144
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

#if !defined(__XFS_ERRORTAG_H_) || defined(XFS_ERRTAG)
#define __XFS_ERRORTAG_H_

/*
 * There are two ways to use this header file.  The first way is to #include it
 * bare, which will define all the XFS_ERRTAG_* error injection knobs for use
 * with the XFS_TEST_ERROR macro.  The second way is to enclose the #include
 * with a #define for an XFS_ERRTAG macro, in which case the header will define
 " an XFS_ERRTAGS macro that expands to invoke that XFS_ERRTAG macro for each
 * defined error injection knob.
 */

/*
 * These are the actual error injection tags.  The numbers should be consecutive
 * because arrays are sized based on the maximum.
 */
#define XFS_ERRTAG_NOERROR				0
#define XFS_ERRTAG_IFLUSH_1				1
#define XFS_ERRTAG_IFLUSH_2				2
#define XFS_ERRTAG_IFLUSH_3				3
#define XFS_ERRTAG_IFLUSH_4				4
#define XFS_ERRTAG_IFLUSH_5				5
#define XFS_ERRTAG_IFLUSH_6				6
#define XFS_ERRTAG_DA_READ_BUF				7
#define XFS_ERRTAG_BTREE_CHECK_LBLOCK			8
#define XFS_ERRTAG_BTREE_CHECK_SBLOCK			9
#define XFS_ERRTAG_ALLOC_READ_AGF			10
#define XFS_ERRTAG_IALLOC_READ_AGI			11
#define XFS_ERRTAG_ITOBP_INOTOBP			12
#define XFS_ERRTAG_IUNLINK				13
#define XFS_ERRTAG_IUNLINK_REMOVE			14
#define XFS_ERRTAG_DIR_INO_VALIDATE			15
#define XFS_ERRTAG_BULKSTAT_READ_CHUNK			16
#define XFS_ERRTAG_IODONE_IOERR				17
#define XFS_ERRTAG_STRATREAD_IOERR			18
#define XFS_ERRTAG_STRATCMPL_IOERR			19
#define XFS_ERRTAG_DIOWRITE_IOERR			20
#define XFS_ERRTAG_BMAPIFORMAT				21
#define XFS_ERRTAG_FREE_EXTENT				22
#define XFS_ERRTAG_RMAP_FINISH_ONE			23
#define XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE		24
#define XFS_ERRTAG_REFCOUNT_FINISH_ONE			25
#define XFS_ERRTAG_BMAP_FINISH_ONE			26
#define XFS_ERRTAG_AG_RESV_CRITICAL			27

/*
 * Drop-writes support removed because write error handling cannot trash
 * pre-existing delalloc extents in any useful way anymore. We retain the
 * definition so that we can reject it as an invalid value in
 * xfs_errortag_add().
 */
#define XFS_ERRTAG_DROP_WRITES				28
#define XFS_ERRTAG_LOG_BAD_CRC				29
#define XFS_ERRTAG_LOG_ITEM_PIN				30
#define XFS_ERRTAG_BUF_LRU_REF				31
#define XFS_ERRTAG_FORCE_SCRUB_REPAIR			32
#define XFS_ERRTAG_FORCE_SUMMARY_RECALC			33
#define XFS_ERRTAG_IUNLINK_FALLBACK			34
#define XFS_ERRTAG_BUF_IOERROR				35
#define XFS_ERRTAG_REDUCE_MAX_IEXTENTS			36
#define XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT		37
#define XFS_ERRTAG_AG_RESV_FAIL				38
#define XFS_ERRTAG_LARP					39
#define XFS_ERRTAG_DA_LEAF_SPLIT			40
#define XFS_ERRTAG_ATTR_LEAF_TO_NODE			41
#define XFS_ERRTAG_WB_DELAY_MS				42
#define XFS_ERRTAG_WRITE_DELAY_MS			43
#define XFS_ERRTAG_EXCHMAPS_FINISH_ONE			44
#define XFS_ERRTAG_METAFILE_RESV_CRITICAL		45
#define XFS_ERRTAG_FORCE_ZERO_RANGE			46
#define XFS_ERRTAG_ZONE_RESET				47
#define XFS_ERRTAG_MAX					48

/*
 * Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
 */
#define XFS_RANDOM_DEFAULT				100

/*
 * Table of errror injection knobs.  The parameters to the XFS_ERRTAG macro are:
 *   1. The XFS_ERRTAG_ flag but without the prefix;
 *   2. The name of the sysfs knob; and
 *   3. The default value for the knob.
 */
#ifdef XFS_ERRTAG
# undef XFS_ERRTAGS
# define XFS_ERRTAGS \
XFS_ERRTAG(NOERROR,		noerror,		XFS_RANDOM_DEFAULT) \
XFS_ERRTAG(IFLUSH_1,		iflush1,		XFS_RANDOM_DEFAULT) \
XFS_ERRTAG(IFLUSH_2,		iflush2,		XFS_RANDOM_DEFAULT) \

Annotation

Implementation Notes