Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145541730
D15162.1778155388.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
D15162.1778155388.diff
View Options
Index: head/sys/dev/nvme/nvme_ns.c
===================================================================
--- head/sys/dev/nvme/nvme_ns.c
+++ head/sys/dev/nvme/nvme_ns.c
@@ -494,7 +494,9 @@
nvme_ns_construct(struct nvme_namespace *ns, uint32_t id,
struct nvme_controller *ctrlr)
{
+ struct make_dev_args md_args;
struct nvme_completion_poll_status status;
+ int res;
int unit;
uint16_t oncs;
uint8_t dsm;
@@ -590,15 +592,20 @@
*/
unit = device_get_unit(ctrlr->dev) * NVME_MAX_NAMESPACES + ns->id - 1;
- ns->cdev = make_dev_credf(0, &nvme_ns_cdevsw, unit,
- NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d",
+ make_dev_args_init(&md_args);
+ md_args.mda_devsw = &nvme_ns_cdevsw;
+ md_args.mda_unit = unit;
+ md_args.mda_mode = 0600;
+ res = make_dev_s(&md_args, &ns->cdev, "nvme%dns%d",
device_get_unit(ctrlr->dev), ns->id);
+ if (res != 0)
+ return (ENXIO);
+
#ifdef NVME_UNMAPPED_BIO_SUPPORT
ns->cdev->si_flags |= SI_UNMAPPED;
#endif
- if (ns->cdev != NULL)
- ns->cdev->si_drv1 = ns;
+ ns->cdev->si_drv1 = ns;
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 7, 12:03 PM (11 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28589562
Default Alt Text
D15162.1778155388.diff (1 KB)
Attached To
Mode
D15162: switch nvme driver from make_dev_credf to make_dev_s
Attached
Detach File
Event Timeline
Log In to Comment