diff options
author | Vishal Verma <vishal.l.verma@intel.com> | 2016-05-27 14:43:45 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-06-17 19:23:23 -0400 |
commit | 0aefa05420c0e81eec2496b28a1b5d6e7783cb23 (patch) | |
tree | 6119ee49bd3c9d6bdfae2bffb890b891b312c203 | |
parent | f02716db951c5e01acf48df9fe815007674fecff (diff) |
libnvdimm, btt: update the usage section in Documentation
Section 5 about BTT's in kernel usage was quite obsolete,
replace it with a simple 'Usage' section that describes how
to set up a BTT namespace using the 'ndctl' utility.
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | Documentation/nvdimm/btt.txt | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/Documentation/nvdimm/btt.txt b/Documentation/nvdimm/btt.txt index b91443f577dc..e293fb664924 100644 --- a/Documentation/nvdimm/btt.txt +++ b/Documentation/nvdimm/btt.txt | |||
@@ -256,28 +256,18 @@ If any of these error conditions are encountered, the arena is put into a read | |||
256 | only state using a flag in the info block. | 256 | only state using a flag in the info block. |
257 | 257 | ||
258 | 258 | ||
259 | 5. In-kernel usage | 259 | 5. Usage |
260 | ================== | 260 | ======== |
261 | 261 | ||
262 | Any block driver that supports byte granularity IO to the storage may register | 262 | The BTT can be set up on any disk (namespace) exposed by the libnvdimm subsystem |
263 | with the BTT. It will have to provide the rw_bytes interface in its | 263 | (pmem, or blk mode). The easiest way to set up such a namespace is using the |
264 | block_device_operations struct: | 264 | 'ndctl' utility [1]: |
265 | 265 | ||
266 | int (*rw_bytes)(struct gendisk *, void *, size_t, off_t, int rw); | 266 | For example, the ndctl command line to setup a btt with a 4k sector size is: |
267 | 267 | ||
268 | It may register with the BTT after it adds its own gendisk, using btt_init: | 268 | ndctl create-namespace -f -e namespace0.0 -m sector -l 4k |
269 | 269 | ||
270 | struct btt *btt_init(struct gendisk *disk, unsigned long long rawsize, | 270 | See ndctl create-namespace --help for more options. |
271 | u32 lbasize, u8 uuid[], int maxlane); | ||
272 | 271 | ||
273 | note that maxlane is the maximum amount of concurrency the driver wishes to | 272 | [1]: https://github.com/pmem/ndctl |
274 | allow the BTT to use. | ||
275 | |||
276 | The BTT 'disk' appears as a stacked block device that grabs the underlying block | ||
277 | device in the O_EXCL mode. | ||
278 | |||
279 | When the driver wishes to remove the backing disk, it should similarly call | ||
280 | btt_fini using the same struct btt* handle that was provided to it by btt_init. | ||
281 | |||
282 | void btt_fini(struct btt *btt); | ||
283 | 273 | ||