include/linux/t10-pi.h

Source file repositories/reference/linux-study-clean/include/linux/t10-pi.h

File Facts

System
Linux kernel
Corpus path
include/linux/t10-pi.h
Extension
.h
Size
1797 bytes
Lines
77
Domain
Core OS
Bucket
Core Kernel Interface
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 t10_pi_tuple {
	__be16 guard_tag;	/* Checksum */
	__be16 app_tag;		/* Opaque storage */
	__be32 ref_tag;		/* Target LBA or indirect LBA */
};

#define T10_PI_APP_ESCAPE cpu_to_be16(0xffff)
#define T10_PI_REF_ESCAPE cpu_to_be32(0xffffffff)

static inline u32 t10_pi_ref_tag(struct request *rq)
{
	return lower_32_bits(full_pi_ref_tag(rq));
}

struct crc64_pi_tuple {
	__be64 guard_tag;
	__be16 app_tag;
	__u8   ref_tag[6];
};

/**
 * lower_48_bits() - return bits 0-47 of a number
 * @n: the number we're accessing
 */
static inline u64 lower_48_bits(u64 n)
{
	return n & ((1ull << 48) - 1);
}

static inline u64 ext_pi_ref_tag(struct request *rq)
{
	return lower_48_bits(full_pi_ref_tag(rq));
}

#endif

Annotation

Implementation Notes