Searched refs:nd_btt (Results 1 - 8 of 8) sorted by relevance

/linux-4.4.14/drivers/nvdimm/
H A Dbtt_devs.c27 struct nd_btt *nd_btt = to_nd_btt(dev); nd_btt_release() local
30 nd_detach_ndns(&nd_btt->dev, &nd_btt->ndns); nd_btt_release()
31 ida_simple_remove(&nd_region->btt_ida, nd_btt->id); nd_btt_release()
32 kfree(nd_btt->uuid); nd_btt_release()
33 kfree(nd_btt); nd_btt_release()
37 .name = "nd_btt",
47 struct nd_btt *to_nd_btt(struct device *dev) to_nd_btt()
49 struct nd_btt *nd_btt = container_of(dev, struct nd_btt, dev); to_nd_btt() local
52 return nd_btt; to_nd_btt()
62 struct nd_btt *nd_btt = to_nd_btt(dev); sector_size_show() local
64 return nd_sector_size_show(nd_btt->lbasize, btt_lbasize_supported, buf); sector_size_show()
70 struct nd_btt *nd_btt = to_nd_btt(dev); sector_size_store() local
75 rc = nd_sector_size_store(dev, buf, &nd_btt->lbasize, sector_size_store()
89 struct nd_btt *nd_btt = to_nd_btt(dev); uuid_show() local
91 if (nd_btt->uuid) uuid_show()
92 return sprintf(buf, "%pUb\n", nd_btt->uuid); uuid_show()
99 struct nd_btt *nd_btt = to_nd_btt(dev); uuid_store() local
103 rc = nd_uuid_store(dev, &nd_btt->uuid, buf, len); uuid_store()
115 struct nd_btt *nd_btt = to_nd_btt(dev); namespace_show() local
119 rc = sprintf(buf, "%s\n", nd_btt->ndns namespace_show()
120 ? dev_name(&nd_btt->ndns->dev) : ""); namespace_show()
128 struct nd_btt *nd_btt = to_nd_btt(dev); namespace_store() local
133 rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len); namespace_store()
165 struct nd_btt *nd_btt; __nd_btt_create() local
168 nd_btt = kzalloc(sizeof(*nd_btt), GFP_KERNEL); __nd_btt_create()
169 if (!nd_btt) __nd_btt_create()
172 nd_btt->id = ida_simple_get(&nd_region->btt_ida, 0, 0, GFP_KERNEL); __nd_btt_create()
173 if (nd_btt->id < 0) { __nd_btt_create()
174 kfree(nd_btt); __nd_btt_create()
178 nd_btt->lbasize = lbasize; __nd_btt_create()
181 nd_btt->uuid = uuid; __nd_btt_create()
182 dev = &nd_btt->dev; __nd_btt_create()
183 dev_set_name(dev, "btt%d.%d", nd_region->id, nd_btt->id); __nd_btt_create()
187 device_initialize(&nd_btt->dev); __nd_btt_create()
188 if (ndns && !__nd_attach_ndns(&nd_btt->dev, ndns, &nd_btt->ndns)) { __nd_btt_create()
215 * @nd_btt: device with BTT geometry and backing device info
225 bool nd_btt_arena_is_valid(struct nd_btt *nd_btt, struct btt_sb *super) nd_btt_arena_is_valid() argument
227 const u8 *parent_uuid = nd_dev_to_uuid(&nd_btt->ndns->dev); nd_btt_arena_is_valid()
245 dev_info(&nd_btt->dev, "Found arena with an error flag\n"); nd_btt_arena_is_valid()
251 static int __nd_btt_probe(struct nd_btt *nd_btt, __nd_btt_probe() argument
254 if (!btt_sb || !ndns || !nd_btt) __nd_btt_probe()
263 if (!nd_btt_arena_is_valid(nd_btt, btt_sb)) __nd_btt_probe()
266 nd_btt->lbasize = le32_to_cpu(btt_sb->external_lbasize); __nd_btt_probe()
267 nd_btt->uuid = kmemdup(btt_sb->uuid, 16, GFP_KERNEL); __nd_btt_probe()
268 if (!nd_btt->uuid) __nd_btt_probe()
271 __nd_device_register(&nd_btt->dev); __nd_btt_probe()
298 struct nd_btt *nd_btt = to_nd_btt(dev); nd_btt_probe() local
300 __nd_detach_ndns(dev, &nd_btt->ndns); nd_btt_probe()
H A DMakefile3 obj-$(CONFIG_ND_BTT) += nd_btt.o
9 nd_btt-y := btt.o
H A Dbtt.c39 struct nd_btt *nd_btt = arena->nd_btt; arena_read_bytes() local
40 struct nd_namespace_common *ndns = nd_btt->ndns; arena_read_bytes()
50 struct nd_btt *nd_btt = arena->nd_btt; arena_write_bytes() local
51 struct nd_namespace_common *ndns = nd_btt->ndns; arena_write_bytes()
241 btt->debugfs_dir = debugfs_create_dir(dev_name(&btt->nd_btt->dev), btt_debugfs_init()
297 return &arena->nd_btt->dev; to_dev()
529 arena->nd_btt = btt->nd_btt; alloc_arena()
642 if (!nd_btt_arena_is_valid(btt->nd_btt, super)) { discover_arenas()
736 struct nd_btt *nd_btt = arena->nd_btt; btt_arena_write_layout() local
737 const u8 *parent_uuid = nd_dev_to_uuid(&nd_btt->ndns->dev); btt_arena_write_layout()
752 memcpy(super->uuid, nd_btt->uuid, 16); btt_arena_write_layout()
1188 dev_info(&btt->nd_btt->dev, bio_for_each_segment()
1233 struct nd_btt *nd_btt = btt->nd_btt; btt_blk_init() local
1234 struct nd_namespace_common *ndns = nd_btt->ndns; btt_blk_init()
1248 btt->btt_disk->driverfs_dev = &btt->nd_btt->dev; btt_blk_init()
1290 * @nd_btt: device with BTT geometry and backing device info
1305 static struct btt *btt_init(struct nd_btt *nd_btt, unsigned long long rawsize, btt_init() argument
1310 struct device *dev = &nd_btt->dev; btt_init()
1316 btt->nd_btt = nd_btt; btt_init()
1389 struct nd_btt *nd_btt = to_nd_btt(ndns->claim); nvdimm_namespace_attach_btt() local
1394 if (!nd_btt->uuid || !nd_btt->ndns || !nd_btt->lbasize) nvdimm_namespace_attach_btt()
1401 nd_region = to_nd_region(nd_btt->dev.parent); nvdimm_namespace_attach_btt()
1402 btt = btt_init(nd_btt, rawsize, nd_btt->lbasize, nd_btt->uuid, nvdimm_namespace_attach_btt()
1406 nd_btt->btt = btt; nvdimm_namespace_attach_btt()
1414 struct nd_btt *nd_btt = to_nd_btt(ndns->claim); nvdimm_namespace_detach_btt() local
1415 struct btt *btt = nd_btt->btt; nvdimm_namespace_detach_btt()
1418 nd_btt->btt = NULL; nvdimm_namespace_detach_btt()
H A Dbtt.h116 * @nd_btt: Pointer to parent nd_btt structure.
145 struct nd_btt *nd_btt; member in struct:arena_info
158 * @nd_btt: Parent nd_btt struct
175 struct nd_btt *nd_btt; member in struct:btt
186 bool nd_btt_arena_is_valid(struct nd_btt *nd_btt, struct btt_sb *super);
H A Dclaim.c101 struct nd_btt *nd_btt = to_nd_btt(dev); nd_detach_and_reset() local
103 nd_btt->lbasize = 0; nd_detach_and_reset()
104 kfree(nd_btt->uuid); nd_detach_and_reset()
105 nd_btt->uuid = NULL; nd_detach_and_reset()
H A Dnd.h137 struct nd_btt { struct
187 struct nd_btt *to_nd_btt(struct device *dev);
H A Dnamespace_devs.c93 struct nd_btt *nd_btt = to_nd_btt(dev); is_uuid_busy() local
95 uuid2 = nd_btt->uuid; is_uuid_busy()
1343 struct nd_btt *nd_btt = is_nd_btt(dev) ? to_nd_btt(dev) : NULL; nvdimm_namespace_common_probe() local
1348 if (nd_btt || nd_pfn) { nvdimm_namespace_common_probe()
1351 if (nd_btt) { nvdimm_namespace_common_probe()
1352 host = &nd_btt->dev; nvdimm_namespace_common_probe()
1353 ndns = nd_btt->ndns; nvdimm_namespace_common_probe()
H A Dregion_devs.c423 struct nd_btt *nd_btt = to_nd_btt(dev); nd_region_notify_driver_action() local
429 if (nd_region->ns_seed == &nd_btt->ndns->dev && nd_region_notify_driver_action()

Completed in 145 milliseconds