block/partitions/aix.c
Source file repositories/reference/linux-study-clean/block/partitions/aix.c
File Facts
- System
- Linux kernel
- Corpus path
block/partitions/aix.c- Extension
.c- Size
- 6358 bytes
- Lines
- 287
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: implementation source
- Status
- source implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
check.h
Detected Declarations
struct lvm_recstruct vgdastruct lvdstruct lvnamestruct ppestruct pvdstruct lv_infofunction read_lbafunction alloc_pvdfunction alloc_lvnfunction aix_partition
Annotated Snippet
struct lvm_rec {
char lvm_id[4]; /* "_LVM" */
char reserved4[16];
__be32 lvmarea_len;
__be32 vgda_len;
__be32 vgda_psn[2];
char reserved36[10];
__be16 pp_size; /* log2(pp_size) */
char reserved46[12];
__be16 version;
};
struct vgda {
__be32 secs;
__be32 usec;
char reserved8[16];
__be16 numlvs;
__be16 maxlvs;
__be16 pp_size;
__be16 numpvs;
__be16 total_vgdas;
__be16 vgda_size;
};
struct lvd {
__be16 lv_ix;
__be16 res2;
__be16 res4;
__be16 maxsize;
__be16 lv_state;
__be16 mirror;
__be16 mirror_policy;
__be16 num_lps;
__be16 res10[8];
};
struct lvname {
char name[64];
};
struct ppe {
__be16 lv_ix;
unsigned short res2;
unsigned short res4;
__be16 lp_ix;
unsigned short res8[12];
};
struct pvd {
char reserved0[16];
__be16 pp_count;
char reserved18[2];
__be32 psn_part1;
char reserved24[8];
struct ppe ppe[1016];
};
#define LVM_MAXLVS 256
/**
* read_lba(): Read bytes from disk, starting at given LBA
* @state
* @lba
* @buffer
* @count
*
* Description: Reads @count bytes from @state->disk into @buffer.
* Returns number of bytes read on success, 0 on error.
*/
static size_t read_lba(struct parsed_partitions *state, u64 lba, u8 *buffer,
size_t count)
{
size_t totalreadcount = 0;
if (!buffer || lba + count / 512 > get_capacity(state->disk) - 1ULL)
return 0;
while (count) {
int copied = 512;
Sector sect;
unsigned char *data = read_part_sector(state, lba++, §);
if (!data)
break;
if (copied > count)
copied = count;
memcpy(buffer, data, copied);
put_dev_sector(sect);
buffer += copied;
totalreadcount += copied;
count -= copied;
Annotation
- Immediate include surface: `check.h`.
- Detected declarations: `struct lvm_rec`, `struct vgda`, `struct lvd`, `struct lvname`, `struct ppe`, `struct pvd`, `struct lv_info`, `function read_lba`, `function alloc_pvd`, `function alloc_lvn`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- 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.