libnvme(2)
β¨ NAME β¨
struct nvme_ns_mgmt_host_sw_specified β Namespace management Host Software Specified Fields π
okay so bestie, this is a page straight out of the libnvme(2) API manual, and we're about to vibe-check a struct. It's the block of host-software-specified fields you hand over when you're doing namespace management. No cap, it's mostly __u8 rsvd padding with some absolute icons hiding in between. Let's get into it π«Ά
πΈ SYNOPSIS πΈ
struct nvme_ns_mgmt_host_sw_specified {
__le64 nsze;
__le64 ncap;
__u8 rsvd16[10];
__u8 flbas;
__u8 rsvd27[2];
__u8 dps;
__u8 nmic;
__u8 rsvd31[61];
__le32 anagrpid;
__u8 rsvd96[4];
__le16 nvmsetid;
__le16 endgid;
__u8 rsvd104[280];
__le64 lbstm;
__le16 nphndls;
__u8 rsvd394[105];
union {
__u8 rsvd499[13];
struct {
__u8 znsco;
__le32 rar;
__le32 ror;
__le32 rnumzrwa;
} zns;
};
__le16 phndl[128];
__u8 rsvd768[3328];
};
π Members π
nszeβ Namespace Size. It's the total size of the namespace measured in logical blocks, and the number of logical blocks is based on the formatted LBA size. so like, the LBA size is doing the math here, not us β¨ncapβ Namespace Capacity. The max number of logical blocks that may be allocated in the namespace at any point in time. Same deal: the count is based on the formatted LBA size.rsvd16β Reserved. π nothing to see here bestieflbasβ Formatted LBA Size, seeenum nvme_id_ns_flbas.rsvd27β Reserved.dpsβ End-to-end Data Protection Type Settings, seeenum nvme_id_ns_dps.nmicβ Namespace Multi-path I/O and Namespace Sharing Capabilities, seeenum nvme_id_ns_nmic.rsvd31β Reserved.anagrpidβ ANA Group Identifier. It tells you the ANA Group Identifier of the ANA group that this namespace is a member of. main character namespace energy πrsvd96β Reserved.nvmsetidβ NVM Set Identifier. Points at the NVM Set this namespace is associated with.endgidβ Endurance Group Identifier. Points at the Endurance Group this namespace is associated with.rsvd104β Reserved.lbstmβ Logical Block Storage Tag Mask. It identifies the mask for the Storage Tag field for the protection information.nphndlsβ Number of Placement Handles. It specifies how many Placement Handles are included in the Placement Handle List.rsvd394β Reserved.{unnamed_union}β anonymous. yeah, it's an unnamed union, it's giving mysterious π¦rsvd499β Reserved for I/O Command Sets that extend this specification.znsβrsvd499( Zoned Namespace Command Set specific field ). This one is a nestedstructof its own, and its members are:znscorar(a__le32)ror(a__le32)rnumzrwa(a__le32)
phndlβ Placement Handle Associated RUH. This field specifies the Reclaim Unit Handle Identifier to be associated with the Placement Handle value. β οΈ Heads up: if the Flexible Data Placement capability is not supported or not enabled in the specified Endurance Group, then the controller shall ignore this field. lowkey important, don't skip it fr frrsvd768β Reserved.
note bestie: all those rsvd* names are literally the reserved byte-range markers β the number is just where they sit in the struct. We keep them exactly as written, no renaming, periodt π
that's the whole struct, every single byte accounted for, no notes skipped, no fields merged π this page came bundled with the libnvme(2) API Manual, struct nvme_ns_mgmt_host_sw_specified edition, dated July 2026 β love that for us, stay hydrated and always check your nphndls before you flex your placement handles πβ¨π
π¦ where this page comes from
- ubuntu stonking: libnvme-dev 1.16.2-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms