Source
16
16
#include <linux/vmalloc.h>
17
17
#include <linux/uaccess.h>
18
18
#include <linux/module.h>
19
19
#include <linux/blkdev.h>
20
20
#include <linux/fcntl.h>
21
21
#include <linux/async.h>
22
22
#include <linux/genhd.h>
23
23
#include <linux/ndctl.h>
24
24
#include <linux/sched.h>
25
25
#include <linux/slab.h>
26
+
#include <linux/cpu.h>
26
27
#include <linux/fs.h>
27
28
#include <linux/io.h>
28
29
#include <linux/mm.h>
29
30
#include <linux/nd.h>
30
31
#include "nd-core.h"
31
32
#include "nd.h"
32
33
#include "pfn.h"
33
34
34
35
int nvdimm_major;
35
36
static int nvdimm_bus_major;
527
528
/*
528
529
* Ensure that region devices always have their NUMA node set as
529
530
* early as possible. This way we are able to make certain that
530
531
* any memory associated with the creation and the creation
531
532
* itself of the region is associated with the correct node.
532
533
*/
533
534
if (is_nd_region(dev))
534
535
set_dev_node(dev, to_nd_region(dev)->numa_node);
535
536
536
537
dev->bus = &nvdimm_bus_type;
537
-
if (dev->parent)
538
+
if (dev->parent) {
538
539
get_device(dev->parent);
540
+
if (dev_to_node(dev) == NUMA_NO_NODE)
541
+
set_dev_node(dev, dev_to_node(dev->parent));
542
+
}
539
543
get_device(dev);
540
-
async_schedule_domain(nd_async_device_register, dev,
541
-
&nd_async_domain);
544
+
545
+
async_schedule_dev_domain(nd_async_device_register, dev,
546
+
&nd_async_domain);
542
547
}
543
548
544
549
void nd_device_register(struct device *dev)
545
550
{
546
551
device_initialize(dev);
547
552
__nd_device_register(dev);
548
553
}
549
554
EXPORT_SYMBOL(nd_device_register);
550
555
551
556
void nd_device_unregister(struct device *dev, enum nd_async_mode mode)