Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148527570
D43596.id133360.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43596.id133360.diff
View Options
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -911,18 +911,15 @@
else if (maxio > maxphys)
maxio = maxphys; /* for safety */
disk->d_maxsize = maxio;
- flbas_fmt = (nsd->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) &
- NVME_NS_DATA_FLBAS_FORMAT_MASK;
- lbads = (nsd->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) &
- NVME_NS_DATA_LBAF_LBADS_MASK;
+ flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsd->flbas);
+ lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsd->lbaf[flbas_fmt]);
disk->d_sectorsize = 1 << lbads;
disk->d_mediasize = (off_t)(disk->d_sectorsize * nsd->nsze);
disk->d_delmaxsize = disk->d_mediasize;
disk->d_flags = DISKFLAG_DIRECT_COMPLETION;
if (nvme_ctrlr_has_dataset_mgmt(cd))
disk->d_flags |= DISKFLAG_CANDELETE;
- vwc_present = (cd->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) &
- NVME_CTRLR_DATA_VWC_PRESENT_MASK;
+ vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc);
if (vwc_present)
disk->d_flags |= DISKFLAG_CANFLUSHCACHE;
if ((cpi.hba_misc & PIM_UNMAPPED) != 0) {
@@ -945,8 +942,8 @@
disk->d_hba_subdevice = cpi.hba_subdevice;
snprintf(disk->d_attachment, sizeof(disk->d_attachment),
"%s%d", cpi.dev_name, cpi.unit_number);
- if (((nsd->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) &
- NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0 && nsd->npwg != 0)
+ if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, nsd->nsfeat) != 0 &&
+ nsd->npwg != 0)
disk->d_stripesize = ((nsd->npwg + 1) * disk->d_sectorsize);
else
disk->d_stripesize = nsd->noiob * disk->d_sectorsize;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 19, 12:00 PM (18 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29962866
Default Alt Text
D43596.id133360.diff (1 KB)
Attached To
Mode
D43596: nda: Use the NVMEV macro instead of expanded versions
Attached
Detach File
Event Timeline
Log In to Comment