diff options
author | Dan Williams <dan.j.williams@intel.com> | 2015-05-30 12:35:36 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-06-24 21:24:10 -0400 |
commit | 0ba1c634892b3590779803a701bcb82e8c32cc7a (patch) | |
tree | c23d1c952ec837729700b5e3c34cdb42a073b055 /drivers/nvdimm/bus.c | |
parent | f524bf271a5cf12a44253194abcf8b6688ff5b9d (diff) |
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 <gregkh@linuxfoundation.org>
Cc: Neil Brown <neilb@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/bus.c')
-rw-r--r-- | drivers/nvdimm/bus.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |