Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144498016
D43606.1775005624.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43606.1775005624.diff
View Options
diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c
--- a/sbin/nvmecontrol/ns.c
+++ b/sbin/nvmecontrol/ns.c
@@ -579,14 +579,12 @@
/* Default to the first format, whatever it is. */
nsdata.flbas = 0;
if (create_opt.lbaf != NONE) {
- nsdata.flbas |= (create_opt.lbaf &
- NVME_NS_DATA_FLBAS_FORMAT_MASK)
- << NVME_NS_DATA_FLBAS_FORMAT_SHIFT;
+ nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_FORMAT,
+ create_opt.lbaf);
}
if (create_opt.mset != NONE) {
- nsdata.flbas |= (create_opt.mset &
- NVME_NS_DATA_FLBAS_EXTENDED_MASK)
- << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT;
+ nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_EXTENDED,
+ create_opt.mset);
}
}
if (create_opt.dps != NONE) {
@@ -595,22 +593,19 @@
/* Default to protection disabled. */
nsdata.dps = 0;
if (create_opt.pi != NONE) {
- nsdata.dps |= (create_opt.pi &
- NVME_NS_DATA_DPS_MD_START_MASK)
- << NVME_NS_DATA_DPS_MD_START_SHIFT;
+ nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_MD_START,
+ create_opt.pi);
}
if (create_opt.pil != NONE) {
- nsdata.dps |= (create_opt.pil &
- NVME_NS_DATA_DPS_PIT_MASK)
- << NVME_NS_DATA_DPS_PIT_SHIFT;
+ nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_PIT,
+ create_opt.pil);
}
}
if (create_opt.nmic != NONE) {
nsdata.nmic = create_opt.nmic;
} else {
/* Allow namespaces sharing if Multi-Path I/O is supported. */
- nsdata.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK <<
- NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0;
+ nsdata.nmic = NVMEF(NVME_NS_DATA_NMIC_MAY_BE_SHARED, !!cd.mic);
}
nvme_namespace_data_swapbytes(&nsdata);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 1, 1:07 AM (4 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28237195
Default Alt Text
D43606.1775005624.diff (1 KB)
Attached To
Mode
D43606: nvmecontrol: Use NVMEF macro to construct fields
Attached
Detach File
Event Timeline
Log In to Comment