include/linux/bio-integrity.h
Source file repositories/reference/linux-study-clean/include/linux/bio-integrity.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/bio-integrity.h- Extension
.h- Size
- 4322 bytes
- Lines
- 155
- 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.
- 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
linux/bio.h
Detected Declarations
struct bio_integrity_payloadenum bip_flagsfunction bip_for_each_vecfunction bio_integrity_flaggedfunction bip_get_seedfunction bip_set_seedfunction bio_integrity_map_userfunction bio_integrity_map_iterfunction bio_integrity_unmap_userfunction bio_integrity_advancefunction bio_integrity_allocfunction bio_integrity_add_page
Annotated Snippet
struct bio_integrity_payload {
struct bvec_iter bip_iter;
unsigned short bip_vcnt; /* # of integrity bio_vecs */
unsigned short bip_max_vcnt; /* integrity bio_vec slots */
unsigned short bip_flags; /* control flags */
u16 app_tag; /* application tag value */
struct bio_vec *bip_vec;
};
#define BIP_CLONE_FLAGS (BIP_MAPPED_INTEGRITY | BIP_IP_CHECKSUM | \
BIP_CHECK_GUARD | BIP_CHECK_REFTAG | BIP_CHECK_APPTAG)
#ifdef CONFIG_BLK_DEV_INTEGRITY
#define bip_for_each_vec(bvl, bip, iter) \
for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter)
#define bio_for_each_integrity_vec(_bvl, _bio, _iter) \
for_each_bio(_bio) \
bip_for_each_vec(_bvl, _bio->bi_integrity, _iter)
static inline struct bio_integrity_payload *bio_integrity(struct bio *bio)
{
if (bio->bi_opf & REQ_INTEGRITY)
return bio->bi_integrity;
return NULL;
}
static inline bool bio_integrity_flagged(struct bio *bio, enum bip_flags flag)
{
struct bio_integrity_payload *bip = bio_integrity(bio);
if (bip)
return bip->bip_flags & flag;
return false;
}
static inline sector_t bip_get_seed(struct bio_integrity_payload *bip)
{
return bip->bip_iter.bi_sector;
}
static inline void bip_set_seed(struct bio_integrity_payload *bip,
sector_t seed)
{
bip->bip_iter.bi_sector = seed;
}
void bio_integrity_init(struct bio *bio, struct bio_integrity_payload *bip,
struct bio_vec *bvecs, unsigned int nr_vecs);
struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, gfp_t gfp,
unsigned int nr);
int bio_integrity_add_page(struct bio *bio, struct page *page, unsigned int len,
unsigned int offset);
int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter);
int bio_integrity_map_iter(struct bio *bio, struct uio_meta *meta);
void bio_integrity_unmap_user(struct bio *bio);
void bio_integrity_prep(struct bio *bio, unsigned int action);
void bio_integrity_advance(struct bio *bio, unsigned int bytes_done);
void bio_integrity_trim(struct bio *bio);
int bio_integrity_clone(struct bio *bio, struct bio *bio_src, gfp_t gfp_mask);
#else /* CONFIG_BLK_DEV_INTEGRITY */
static inline struct bio_integrity_payload *bio_integrity(struct bio *bio)
{
return NULL;
}
static inline int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter)
{
return -EINVAL;
}
static inline int bio_integrity_map_iter(struct bio *bio, struct uio_meta *meta)
{
return -EINVAL;
}
static inline void bio_integrity_unmap_user(struct bio *bio)
{
}
static inline void bio_integrity_prep(struct bio *bio, unsigned int action)
{
}
Annotation
- Immediate include surface: `linux/bio.h`.
- Detected declarations: `struct bio_integrity_payload`, `enum bip_flags`, `function bip_for_each_vec`, `function bio_integrity_flagged`, `function bip_get_seed`, `function bip_set_seed`, `function bio_integrity_map_user`, `function bio_integrity_map_iter`, `function bio_integrity_unmap_user`, `function bio_integrity_advance`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.