]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
New superblock fields for multiple cache devices
authorKent Overstreet <koverstreet@google.com>
Fri, 15 Apr 2011 20:22:09 +0000 (13:22 -0700)
committerKent Overstreet <koverstreet@google.com>
Fri, 15 Apr 2011 20:22:09 +0000 (13:22 -0700)
bcache.h
make-bcache.c

index 0054f7d8e7d00dc0ed1a04cbcedc9c481708bef1..3f94dcee140609af9ad75b9611f5475c0a03a3ff 100644 (file)
--- a/bcache.h
+++ b/bcache.h
@@ -18,8 +18,11 @@ struct cache_sb {
        uint64_t        nbuckets;       /* device size */
        uint64_t        btree_root;
        uint16_t        btree_level;
-       uint16_t        _pad[3];
+       uint16_t        nr_in_set;
+       uint16_t        nr_this_dev;
+       uint16_t        _pad[1];
        uint8_t         uuid[16];
+       uint8_t         set_uuid[16];
 };
 
 struct bucket_disk {
index adc90ac9e45655aaff45d56a100e48ed4502be88..b213f9e403c0ae674d027506004e65eedc894811 100644 (file)
@@ -76,6 +76,7 @@ int main(int argc, char **argv)
        struct cache_sb sb = { .block_size = 8, .bucket_size = 0 };
 
        uuid_generate(sb.uuid);
+       uuid_generate(sb.set_uuid);
 
        while ((c = getopt(argc, argv, "CBU:w:b:")) != -1)
                switch (c) {
@@ -129,6 +130,7 @@ int main(int argc, char **argv)
        memcpy(sb.magic, bcache_magic, 16);
        sb.version = backingdev ? CACHE_BACKING_DEVICE : 0;
        sb.nbuckets = nblocks / sb.bucket_size;
+       sb.nr_in_set = 1;
        uuid_unparse(sb.uuid, uuid);
 
        do