/linux-4.4.14/drivers/nvdimm/ |
D | claim.c | 22 struct nd_namespace_common *ndns = *_ndns; in __nd_detach_ndns() local 24 dev_WARN_ONCE(dev, !mutex_is_locked(&ndns->dev.mutex) in __nd_detach_ndns() 25 || ndns->claim != dev, in __nd_detach_ndns() 27 ndns->claim = NULL; in __nd_detach_ndns() 29 put_device(&ndns->dev); in __nd_detach_ndns() 35 struct nd_namespace_common *ndns = *_ndns; in nd_detach_ndns() local 37 if (!ndns) in nd_detach_ndns() 39 get_device(&ndns->dev); in nd_detach_ndns() 40 device_lock(&ndns->dev); in nd_detach_ndns() 42 device_unlock(&ndns->dev); in nd_detach_ndns() [all …]
|
D | pmem.c | 36 struct nd_namespace_common *ndns; member 167 struct nd_namespace_common *ndns, struct pmem_device *pmem) in pmem_attach_disk() argument 194 nvdimm_namespace_disk_name(ndns, disk->disk_name); in pmem_attach_disk() 205 static int pmem_rw_bytes(struct nd_namespace_common *ndns, in pmem_rw_bytes() argument 208 struct pmem_device *pmem = dev_get_drvdata(ndns->claim); in pmem_rw_bytes() 211 dev_WARN_ONCE(&ndns->dev, 1, "request out of range\n"); in pmem_rw_bytes() 229 struct nd_namespace_common *ndns = nd_pfn->ndns; in nd_pfn_init() local 245 if (nvdimm_namespace_capacity(ndns) < ND_PFN_ALIGN in nd_pfn_init() 282 rc = nvdimm_write_bytes(ndns, SZ_4K, pfn_sb, sizeof(*pfn_sb)); in nd_pfn_init() 293 static int nvdimm_namespace_detach_pfn(struct nd_namespace_common *ndns) in nvdimm_namespace_detach_pfn() argument [all …]
|
D | pfn_devs.c | 30 nd_detach_ndns(&nd_pfn->dev, &nd_pfn->ndns); in nd_pfn_release() 139 rc = sprintf(buf, "%s\n", nd_pfn->ndns in namespace_show() 140 ? dev_name(&nd_pfn->ndns->dev) : ""); in namespace_show() 153 rc = nd_namespace_store(dev, &nd_pfn->ndns, buf, len); in namespace_store() 183 struct nd_namespace_common *ndns) in __nd_pfn_create() argument 212 if (ndns && !__nd_attach_ndns(&nd_pfn->dev, ndns, &nd_pfn->ndns)) { in __nd_pfn_create() 213 dev_dbg(&ndns->dev, "%s failed, already claimed by %s\n", in __nd_pfn_create() 214 __func__, dev_name(ndns->claim)); in __nd_pfn_create() 233 struct nd_namespace_common *ndns = nd_pfn->ndns; in nd_pfn_validate() local 238 if (!pfn_sb || !ndns) in nd_pfn_validate() [all …]
|
D | btt_devs.c | 30 nd_detach_ndns(&nd_btt->dev, &nd_btt->ndns); in nd_btt_release() 119 rc = sprintf(buf, "%s\n", nd_btt->ndns in namespace_show() 120 ? dev_name(&nd_btt->ndns->dev) : ""); in namespace_show() 133 rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len); in namespace_store() 163 struct nd_namespace_common *ndns) in __nd_btt_create() argument 188 if (ndns && !__nd_attach_ndns(&nd_btt->dev, ndns, &nd_btt->ndns)) { in __nd_btt_create() 189 dev_dbg(&ndns->dev, "%s failed, already claimed by %s\n", in __nd_btt_create() 190 __func__, dev_name(ndns->claim)); in __nd_btt_create() 227 const u8 *parent_uuid = nd_dev_to_uuid(&nd_btt->ndns->dev); in nd_btt_arena_is_valid() 252 struct nd_namespace_common *ndns, struct btt_sb *btt_sb) in __nd_btt_probe() argument [all …]
|
D | blk.c | 214 static int nd_blk_rw_bytes(struct nd_namespace_common *ndns, in nd_blk_rw_bytes() argument 217 struct nd_blk_device *blk_dev = dev_get_drvdata(ndns->claim); in nd_blk_rw_bytes() 225 dev_WARN_ONCE(&ndns->dev, 1, "request out of range\n"); in nd_blk_rw_bytes() 240 static int nd_blk_attach_disk(struct nd_namespace_common *ndns, in nd_blk_attach_disk() argument 266 disk->driverfs_dev = &ndns->dev; in nd_blk_attach_disk() 273 nvdimm_namespace_disk_name(ndns, disk->disk_name); in nd_blk_attach_disk() 295 struct nd_namespace_common *ndns; in nd_blk_probe() local 300 ndns = nvdimm_namespace_common_probe(dev); in nd_blk_probe() 301 if (IS_ERR(ndns)) in nd_blk_probe() 302 return PTR_ERR(ndns); in nd_blk_probe() [all …]
|
D | nd.h | 139 struct nd_namespace_common *ndns; member 159 struct nd_namespace_common *ndns; member 196 int nd_btt_probe(struct nd_namespace_common *ndns, void *drvdata); 200 static inline int nd_btt_probe(struct nd_namespace_common *ndns, void *drvdata) in nd_btt_probe() argument 218 int nd_pfn_probe(struct nd_namespace_common *ndns, void *drvdata); 223 static inline int nd_pfn_probe(struct nd_namespace_common *ndns, void *drvdata) in nd_pfn_probe() argument 259 resource_size_t nvdimm_namespace_capacity(struct nd_namespace_common *ndns); 261 int nvdimm_namespace_attach_btt(struct nd_namespace_common *ndns); 262 int nvdimm_namespace_detach_btt(struct nd_namespace_common *ndns); 263 const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns,
|
D | namespace_devs.c | 154 const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, in nvdimm_namespace_disk_name() argument 157 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name() 160 if (ndns->claim) { in nvdimm_namespace_disk_name() 161 if (is_nd_btt(ndns->claim)) in nvdimm_namespace_disk_name() 163 else if (is_nd_pfn(ndns->claim)) in nvdimm_namespace_disk_name() 166 dev_WARN_ONCE(&ndns->dev, 1, in nvdimm_namespace_disk_name() 168 dev_name(ndns->claim)); in nvdimm_namespace_disk_name() 171 if (is_namespace_pmem(&ndns->dev) || is_namespace_io(&ndns->dev)) { in nvdimm_namespace_disk_name() 172 if (!suffix && pmem_should_map_pages(&ndns->dev)) in nvdimm_namespace_disk_name() 175 } else if (is_namespace_blk(&ndns->dev)) { in nvdimm_namespace_disk_name() [all …]
|
D | btt.c | 40 struct nd_namespace_common *ndns = nd_btt->ndns; in arena_read_bytes() local 44 return nvdimm_read_bytes(ndns, offset, buf, n); in arena_read_bytes() 51 struct nd_namespace_common *ndns = nd_btt->ndns; in arena_write_bytes() local 55 return nvdimm_write_bytes(ndns, offset, buf, n); in arena_write_bytes() 737 const u8 *parent_uuid = nd_dev_to_uuid(&nd_btt->ndns->dev); in btt_arena_write_layout() 1234 struct nd_namespace_common *ndns = nd_btt->ndns; in btt_blk_init() local 1247 nvdimm_namespace_disk_name(ndns, btt->btt_disk->disk_name); in btt_blk_init() 1387 int nvdimm_namespace_attach_btt(struct nd_namespace_common *ndns) in nvdimm_namespace_attach_btt() argument 1389 struct nd_btt *nd_btt = to_nd_btt(ndns->claim); in nvdimm_namespace_attach_btt() 1394 if (!nd_btt->uuid || !nd_btt->ndns || !nd_btt->lbasize) in nvdimm_namespace_attach_btt() [all …]
|
D | nd-core.h | 82 resource_size_t __nvdimm_namespace_capacity(struct nd_namespace_common *ndns);
|
D | region_devs.c | 429 if (nd_region->ns_seed == &nd_btt->ndns->dev && in nd_region_notify_driver_action()
|
/linux-4.4.14/include/linux/ |
D | nd.h | 119 static inline int nvdimm_read_bytes(struct nd_namespace_common *ndns, in nvdimm_read_bytes() argument 122 return ndns->rw_bytes(ndns, offset, buf, size, READ); in nvdimm_read_bytes() 137 static inline int nvdimm_write_bytes(struct nd_namespace_common *ndns, in nvdimm_write_bytes() argument 140 return ndns->rw_bytes(ndns, offset, buf, size, WRITE); in nvdimm_write_bytes()
|
/linux-4.4.14/Documentation/nvdimm/ |
D | nvdimm.txt | 667 struct ndctl_namespace *ndns; 669 ndctl_namespace_foreach(region, ndns) 670 if (ndctl_namespace_get_id(ndns) == id) 671 return ndns; 686 struct ndctl_namespace *ndns, 694 ndctl_namespace_set_alt_name(ndns, devname); 696 ndctl_namespace_set_uuid(ndns, paramaters->uuid); 697 ndctl_namespace_set_size(ndns, paramaters->size); 700 ndctl_namespace_set_sector_size(ndns, parameters->lbasize); 701 ndctl_namespace_enable(ndns); [all …]
|