summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache
diff options
context:
space:
mode:
authorEric Wheeler <git@linux.ewheeler.net>2016-10-23 18:19:20 -0700
committerJens Axboe <axboe@fb.com>2016-12-17 13:02:00 -0700
commitb8c0d911ac5285e6be8967713271a51bdc5a936a (patch)
treefbc7164e716fcbf45eec53d3d89c6abc853725fa /drivers/md/bcache
parentbe628be09563f8f6e81929efbd7cf3f45c344416 (diff)
downloadblackbird-op-linux-b8c0d911ac5285e6be8967713271a51bdc5a936a.tar.gz
blackbird-op-linux-b8c0d911ac5285e6be8967713271a51bdc5a936a.zip
bcache: partition support: add 16 minors per bcacheN device
Signed-off-by: Eric Wheeler <bcache@linux.ewheeler.net> Tested-by: Wido den Hollander <wido@widodh.nl>
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r--drivers/md/bcache/super.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index b33dd3bd104f..3a19cbc8b230 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -58,6 +58,7 @@ static wait_queue_head_t unregister_wait;
struct workqueue_struct *bcache_wq;
#define BTREE_MAX_PAGES (256 * 1024 / PAGE_SIZE)
+#define BCACHE_MINORS 16 /* partition support */
/* Superblock */
@@ -783,8 +784,10 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
if (minor < 0)
return minor;
+ minor *= BCACHE_MINORS;
+
if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio))) ||
- !(d->disk = alloc_disk(1))) {
+ !(d->disk = alloc_disk(BCACHE_MINORS))) {
ida_simple_remove(&bcache_minor, minor);
return -ENOMEM;
}
OpenPOWER on IntegriCloud