From 0ba1c634892b3590779803a701bcb82e8c32cc7a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 30 May 2015 12:35:36 -0400 Subject: libnvdimm: write blk label set After 'uuid', 'size', 'sector_size', and optionally 'alt_name' have been set to valid values the labels on the dimm can be updated. The difference with the pmem case is that blk namespaces are limited to one dimm and can cover discontiguous ranges in dpa space. Also, after allocating label slots, it is useful for userspace to know how many slots are left. Export this information in sysfs. Cc: Greg KH Cc: Neil Brown Acked-by: Christoph Hellwig Signed-off-by: Dan Williams --- drivers/nvdimm/bus.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/nvdimm/bus.c') diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index fddc3f2a8f80..ca802702440e 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -155,6 +155,10 @@ static void nd_async_device_unregister(void *d, async_cookie_t cookie) { struct device *dev = d; + /* flush bus operations before delete */ + nvdimm_bus_lock(dev); + nvdimm_bus_unlock(dev); + device_unregister(dev); put_device(dev); } -- cgit v1.2.3