Lines Matching refs:nd_btt
29 return &arena->nd_btt->dev; in to_dev()
32 static u64 adjust_initial_offset(struct nd_btt *nd_btt, u64 offset) in adjust_initial_offset() argument
34 return offset + nd_btt->initial_offset; in adjust_initial_offset()
40 struct nd_btt *nd_btt = arena->nd_btt; in arena_read_bytes() local
41 struct nd_namespace_common *ndns = nd_btt->ndns; in arena_read_bytes()
44 offset = adjust_initial_offset(nd_btt, offset); in arena_read_bytes()
51 struct nd_btt *nd_btt = arena->nd_btt; in arena_write_bytes() local
52 struct nd_namespace_common *ndns = nd_btt->ndns; in arena_write_bytes()
55 offset = adjust_initial_offset(nd_btt, offset); in arena_write_bytes()
260 btt->debugfs_dir = debugfs_create_dir(dev_name(&btt->nd_btt->dev), in btt_debugfs_init()
755 arena->nd_btt = btt->nd_btt; in alloc_arena()
768 arena->version_major = btt->nd_btt->version_major; in alloc_arena()
769 arena->version_minor = btt->nd_btt->version_minor; in alloc_arena()
873 if (!nd_btt_arena_is_valid(btt->nd_btt, super)) { in discover_arenas()
974 struct nd_btt *nd_btt = arena->nd_btt; in btt_arena_write_layout() local
975 const uuid_t *parent_uuid = nd_dev_to_uuid(&nd_btt->ndns->dev); in btt_arena_write_layout()
990 export_uuid(super->uuid, nd_btt->uuid); in btt_arena_write_layout()
1301 u64 nsoff = adjust_initial_offset(arena->nd_btt, in btt_is_badblock()
1461 dev_err_ratelimited(&btt->nd_btt->dev, in btt_submit_bio()
1470 dev_err(&btt->nd_btt->dev, in btt_submit_bio()
1517 struct nd_btt *nd_btt = btt->nd_btt; in btt_blk_init() local
1518 struct nd_namespace_common *ndns = nd_btt->ndns; in btt_blk_init()
1541 rc = device_add_disk(&btt->nd_btt->dev, btt->btt_disk, NULL); in btt_blk_init()
1545 btt->nd_btt->size = btt->nlba * (u64)btt->sector_size; in btt_blk_init()
1578 static struct btt *btt_init(struct nd_btt *nd_btt, unsigned long long rawsize, in btt_init() argument
1585 struct device *dev = &nd_btt->dev; in btt_init()
1591 btt->nd_btt = nd_btt; in btt_init()
1598 nsio = to_nd_namespace_io(&nd_btt->ndns->dev); in btt_init()
1661 struct nd_btt *nd_btt = to_nd_btt(ndns->claim); in nvdimm_namespace_attach_btt() local
1668 if (!nd_btt->uuid || !nd_btt->ndns || !nd_btt->lbasize) { in nvdimm_namespace_attach_btt()
1669 dev_dbg(&nd_btt->dev, "incomplete btt configuration\n"); in nvdimm_namespace_attach_btt()
1673 btt_sb = devm_kzalloc(&nd_btt->dev, sizeof(*btt_sb), GFP_KERNEL); in nvdimm_namespace_attach_btt()
1678 rc = devm_namespace_enable(&nd_btt->dev, ndns, size); in nvdimm_namespace_attach_btt()
1688 nd_btt_version(nd_btt, ndns, btt_sb); in nvdimm_namespace_attach_btt()
1690 rawsize = size - nd_btt->initial_offset; in nvdimm_namespace_attach_btt()
1692 dev_dbg(&nd_btt->dev, "%s must be at least %ld bytes\n", in nvdimm_namespace_attach_btt()
1694 ARENA_MIN_SIZE + nd_btt->initial_offset); in nvdimm_namespace_attach_btt()
1697 nd_region = to_nd_region(nd_btt->dev.parent); in nvdimm_namespace_attach_btt()
1698 btt = btt_init(nd_btt, rawsize, nd_btt->lbasize, nd_btt->uuid, in nvdimm_namespace_attach_btt()
1702 nd_btt->btt = btt; in nvdimm_namespace_attach_btt()
1708 int nvdimm_namespace_detach_btt(struct nd_btt *nd_btt) in nvdimm_namespace_detach_btt() argument
1710 struct btt *btt = nd_btt->btt; in nvdimm_namespace_detach_btt()
1713 nd_btt->btt = NULL; in nvdimm_namespace_detach_btt()