forked from dmdedup/dmdedup3.19
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdm-dedup-cbt.c
784 lines (617 loc) · 16.9 KB
/
dm-dedup-cbt.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
/*
* Copyright (C) 2012-2014 Vasily Tarasov
* Copyright (C) 2012-2014 Geoff Kuenning
* Copyright (C) 2012-2014 Sonam Mandal
* Copyright (C) 2012-2014 Karthikeyani Palanisami
* Copyright (C) 2012-2014 Philip Shilane
* Copyright (C) 2012-2014 Sagar Trehan
* Copyright (C) 2012-2014 Erez Zadok
*
* This file is released under the GPL.
*/
#include <linux/errno.h>
#include "persistent-data/dm-btree.h"
#include "persistent-data/dm-space-map.h"
#include "persistent-data/dm-space-map-disk.h"
#include "persistent-data/dm-block-manager.h"
#include "persistent-data/dm-transaction-manager.h"
#include "dm-dedup-cbt.h"
#include "dm-dedup-backend.h"
#include "dm-dedup-kvstore.h"
#define EMPTY_ENTRY -5
#define DELETED_ENTRY -6
#define UINT32_MAX (4294967295U)
#define METADATA_BSIZE 4096
#define METADATA_CACHESIZE 64 /* currently block manager ignores this value */
#define METADATA_MAXLOCKS 5
#define METADATA_SUPERBLOCK_LOCATION 0
#define PRIVATE_DATA_SIZE 16
struct metadata {
struct dm_block_manager *meta_bm;
struct dm_transaction_manager *tm;
struct dm_space_map *data_sm;
struct dm_space_map *meta_sm;
/*
* XXX: Currently we support only one linear and one sparse KVS.
*/
struct kvstore_cbt *kvs_linear;
struct kvstore_cbt *kvs_sparse;
uint8_t private_data[PRIVATE_DATA_SIZE];
};
struct kvstore_cbt {
struct kvstore ckvs;
uint32_t entry_size; /* for sparse only */
struct dm_btree_info info;
uint64_t root;
};
#define SPACE_MAP_ROOT_SIZE 128
struct metadata_superblock {
__le32 csum; /* Checksum of superblock except for this field. */
__le32 flags; /* General purpose flags. Not used. */
__le64 blocknr; /* This block number, dm_block_t. */
__u8 uuid[16]; /* UUID of device (Not used) */
__le64 magic; /* Magic number to check against */
__le32 version; /* Metadata root version */
__u8 metadata_space_map_root[SPACE_MAP_ROOT_SIZE];/* Metadata space
map */
__u8 data_space_map_root[SPACE_MAP_ROOT_SIZE]; /* Data space map */
__le64 lbn_pbn_root; /* lbn pbn btree root. */
__le64 hash_pbn_root; /* hash pbn btree root. */
__le32 data_block_size; /* In bytes */
__le32 metadata_block_size; /* In bytes */
__u8 private_data[PRIVATE_DATA_SIZE]; /* Dmdedup counters */
__le64 metadata_nr_blocks;/* Number of metadata blocks used. */
} __packed;
static int __begin_transaction(struct metadata *md)
{
int r;
struct metadata_superblock *disk_super;
struct dm_block *sblock;
r = dm_bm_read_lock(md->meta_bm, METADATA_SUPERBLOCK_LOCATION,
NULL, &sblock);
if (r)
return r;
disk_super = dm_block_data(sblock);
if (md->kvs_linear)
md->kvs_linear->root = le64_to_cpu(disk_super->lbn_pbn_root);
if (md->kvs_sparse)
md->kvs_sparse->root = le64_to_cpu(disk_super->hash_pbn_root);
memcpy(md->private_data, disk_super->private_data, PRIVATE_DATA_SIZE);
dm_bm_unlock(sblock);
return r;
}
static int __commit_transaction(struct metadata *md)
{
int r = 0;
size_t metadata_len, data_len;
struct metadata_superblock *disk_super;
struct dm_block *sblock;
BUILD_BUG_ON(sizeof(struct metadata_superblock) > 512);
r = dm_sm_commit(md->data_sm);
if (r < 0)
goto out;
r = dm_tm_pre_commit(md->tm);
if (r < 0)
goto out;
r = dm_sm_root_size(md->meta_sm, &metadata_len);
if (r < 0)
goto out;
r = dm_sm_root_size(md->data_sm, &data_len);
if (r < 0)
goto out;
r = dm_bm_write_lock(md->meta_bm, METADATA_SUPERBLOCK_LOCATION,
NULL, &sblock);
if (r)
goto out;
disk_super = dm_block_data(sblock);
if (md->kvs_linear)
disk_super->lbn_pbn_root = cpu_to_le64(md->kvs_linear->root);
if (md->kvs_sparse)
disk_super->hash_pbn_root = cpu_to_le64(md->kvs_sparse->root);
r = dm_sm_copy_root(md->meta_sm,
&disk_super->metadata_space_map_root, metadata_len);
if (r < 0)
goto out_locked;
r = dm_sm_copy_root(md->data_sm, &disk_super->data_space_map_root,
data_len);
if (r < 0)
goto out_locked;
memcpy(disk_super->private_data, md->private_data, PRIVATE_DATA_SIZE);
r = dm_tm_commit(md->tm, sblock);
out:
return r;
out_locked:
dm_bm_unlock(sblock);
return r;
}
static int write_initial_superblock(struct metadata *md)
{
int r;
size_t meta_len, data_len;
struct dm_block *sblock;
struct metadata_superblock *disk_super;
r = dm_sm_root_size(md->meta_sm, &meta_len);
if (r < 0)
return r;
r = dm_sm_root_size(md->data_sm, &data_len);
if (r < 0)
return r;
r = dm_sm_commit(md->data_sm);
if (r < 0)
return r;
r = dm_tm_pre_commit(md->tm);
if (r < 0)
return r;
r = dm_bm_write_lock_zero(md->meta_bm, METADATA_SUPERBLOCK_LOCATION,
NULL, &sblock);
if (r < 0)
return r;
disk_super = dm_block_data(sblock);
r = dm_sm_copy_root(md->meta_sm, &disk_super->metadata_space_map_root,
meta_len);
if (r < 0)
goto bad_locked;
r = dm_sm_copy_root(md->data_sm, &disk_super->data_space_map_root,
data_len);
if (r < 0)
goto bad_locked;
return dm_tm_commit(md->tm, sblock);
bad_locked:
dm_bm_unlock(sblock);
return r;
}
static int superblock_all_zeroes(struct dm_block_manager *bm, bool *result)
{
int r;
unsigned i;
struct dm_block *b;
__le64 *data_le, zero = cpu_to_le64(0);
unsigned sb_block_size = dm_bm_block_size(bm) / sizeof(__le64);
/*
* We can't use a validator here - it may be all zeroes.
*/
r = dm_bm_read_lock(bm, METADATA_SUPERBLOCK_LOCATION, NULL, &b);
if (r)
return r;
data_le = dm_block_data(b);
*result = true;
for (i = 0; i < sb_block_size; i++) {
if (data_le[i] != zero) {
*result = false;
break;
}
}
return dm_bm_unlock(b);
}
static struct metadata *init_meta_cowbtree(void *input_param, bool *unformatted)
{
int ret;
struct metadata *md;
struct dm_block_manager *meta_bm;
struct dm_space_map *meta_sm;
struct dm_space_map *data_sm = NULL;
struct dm_transaction_manager *tm;
struct init_param_cowbtree *p =
(struct init_param_cowbtree *)input_param;
DMINFO("Initializing COWBTREE backend");
md = kzalloc(sizeof(*md), GFP_NOIO);
if (!md)
return ERR_PTR(-ENOMEM);
meta_bm = dm_block_manager_create(p->metadata_bdev, METADATA_BSIZE,
METADATA_CACHESIZE, METADATA_MAXLOCKS);
if (IS_ERR(meta_bm)) {
md = (struct metadata *)meta_bm;
goto badbm;
}
ret = superblock_all_zeroes(meta_bm, unformatted);
if (ret) {
md = ERR_PTR(ret);
goto badtm;
}
if (!*unformatted) {
struct dm_block *sblock;
struct metadata_superblock *disk_super;
md->meta_bm = meta_bm;
ret = dm_bm_read_lock(meta_bm, METADATA_SUPERBLOCK_LOCATION,
NULL, &sblock);
if (ret < 0) {
DMERR("could not read_lock superblock");
/* XXX: handle error */
}
disk_super = dm_block_data(sblock);
ret = dm_tm_open_with_sm(meta_bm, METADATA_SUPERBLOCK_LOCATION,
disk_super->metadata_space_map_root,
sizeof(disk_super->metadata_space_map_root),
&md->tm, &md->meta_sm);
if (ret < 0) {
DMERR("could not open_with_sm superblock");
/* XXX: handle error */
}
md->data_sm = dm_sm_disk_open(md->tm, disk_super->data_space_map_root,
sizeof(disk_super->data_space_map_root));
if (IS_ERR(md->data_sm)) {
DMERR("dm_disk_open failed");
/*XXX: handle error */
}
dm_bm_unlock(sblock);
goto begin_trans;
}
ret = dm_tm_create_with_sm(meta_bm, METADATA_SUPERBLOCK_LOCATION,
&tm, &meta_sm);
if (ret < 0) {
md = ERR_PTR(ret);
goto badtm;
}
data_sm = dm_sm_disk_create(tm, p->blocks);
if (IS_ERR(data_sm)) {
md = (struct metadata *)data_sm;
goto badsm;
}
md->meta_bm = meta_bm;
md->tm = tm;
md->meta_sm = meta_sm;
md->data_sm = data_sm;
ret = write_initial_superblock(md);
if (ret < 0) {
md = ERR_PTR(ret);
goto badwritesuper;
}
begin_trans:
ret = __begin_transaction(md);
if (ret < 0) {
md = ERR_PTR(ret);
goto badwritesuper;
}
md->kvs_linear = NULL;
md->kvs_sparse = NULL;
return md;
badwritesuper:
dm_sm_destroy(data_sm);
badsm:
dm_tm_destroy(tm);
dm_sm_destroy(meta_sm);
badtm:
dm_block_manager_destroy(meta_bm);
badbm:
kfree(md);
return md;
}
static void exit_meta_cowbtree(struct metadata *md)
{
int ret;
ret = __commit_transaction(md);
if (ret < 0)
DMWARN("%s: __commit_transaction() failed, error = %d.",
__func__, ret);
dm_sm_destroy(md->data_sm);
dm_tm_destroy(md->tm);
dm_sm_destroy(md->meta_sm);
dm_block_manager_destroy(md->meta_bm);
kfree(md->kvs_linear);
kfree(md->kvs_sparse);
kfree(md);
}
static int flush_meta_cowbtree(struct metadata *md)
{
int r;
r = __commit_transaction(md);
if (r < 0)
return r;
r = __begin_transaction(md);
return r;
}
/********************************************************
* Space Management Functions *
********************************************************/
static int alloc_data_block_cowbtree(struct metadata *md, uint64_t *blockn)
{
return dm_sm_new_block(md->data_sm, blockn);
}
static int inc_refcount_cowbtree(struct metadata *md, uint64_t blockn)
{
return dm_sm_inc_block(md->data_sm, blockn);
}
static int dec_refcount_cowbtree(struct metadata *md, uint64_t blockn)
{
return dm_sm_dec_block(md->data_sm, blockn);
}
static int get_refcount_cowbtree(struct metadata *md, uint64_t blockn)
{
uint32_t refcount;
int r;
r = dm_sm_get_count(md->data_sm, blockn, &refcount);
if (r < 0)
return r;
return (int)refcount;
}
/*********************************************************
* Linear KVS Functions *
*********************************************************/
static int kvs_delete_linear_cowbtree(struct kvstore *kvs,
void *key, int32_t ksize)
{
int r;
struct kvstore_cbt *kvcbt = NULL;
kvcbt = container_of(kvs, struct kvstore_cbt, ckvs);
if (ksize != kvs->ksize)
return -EINVAL;
r = dm_btree_remove(&(kvcbt->info), kvcbt->root, key, &(kvcbt->root));
if (r == -ENODATA)
return -ENODEV;
else if (r >= 0)
return 0;
return r;
}
/*
* 0 - not found
* 1 - found
* < 0 - error on lookup
*/
static int kvs_lookup_linear_cowbtree(struct kvstore *kvs, void *key,
int32_t ksize, void *value, int32_t *vsize)
{
int r;
struct kvstore_cbt *kvcbt = NULL;
kvcbt = container_of(kvs, struct kvstore_cbt, ckvs);
if (ksize != kvs->ksize)
return -EINVAL;
r = dm_btree_lookup(&(kvcbt->info), kvcbt->root, key, value);
if (r == -ENODATA)
return 0;
else if (r >= 0)
return 1;
else
return r;
}
static int kvs_insert_linear_cowbtree(struct kvstore *kvs, void *key,
int32_t ksize, void *value,
int32_t vsize)
{
int inserted;
struct kvstore_cbt *kvcbt = NULL;
kvcbt = container_of(kvs, struct kvstore_cbt, ckvs);
if (ksize != kvs->ksize)
return -EINVAL;
if (vsize != kvs->vsize)
return -EINVAL;
__dm_bless_for_disk(value);
return dm_btree_insert_notify(&(kvcbt->info), kvcbt->root, key,
value, &(kvcbt->root), &inserted);
}
static struct kvstore * kvs_create_linear_cowbtree(struct metadata *md,
uint32_t ksize, uint32_t vsize, uint32_t kmax,
bool unformatted)
{
struct kvstore_cbt *kvs;
int r;
if (!vsize || !ksize)
return ERR_PTR(-ENOTSUPP);
/* Currently only 64bit keys are supported */
if (ksize != 8)
return ERR_PTR(-ENOTSUPP);
/* We do not support two or more KVSs at the moment */
if (md->kvs_linear)
return ERR_PTR(-EBUSY);
kvs = kmalloc(sizeof(*kvs), GFP_NOIO);
if (!kvs)
return ERR_PTR(-ENOMEM);
kvs->ckvs.ksize = ksize;
kvs->ckvs.vsize = vsize;
kvs->info.tm = md->tm;
kvs->info.levels = 1;
kvs->info.value_type.context = NULL;
kvs->info.value_type.size = vsize;
kvs->info.value_type.inc = NULL;
kvs->info.value_type.dec = NULL;
kvs->info.value_type.equal = NULL;
if (!unformatted) {
kvs->ckvs.kvs_insert = kvs_insert_linear_cowbtree;
kvs->ckvs.kvs_lookup = kvs_lookup_linear_cowbtree;
kvs->ckvs.kvs_delete = kvs_delete_linear_cowbtree;
kvs->ckvs.kvs_iterate = NULL;
md->kvs_linear = kvs;
__begin_transaction(md);
} else {
r = dm_btree_empty(&(kvs->info), &(kvs->root));
if (r < 0) {
kvs = ERR_PTR(r);
goto badtree;
}
/* I think this should be moved below the 4 lines below */
flush_meta_cowbtree(md);
kvs->ckvs.kvs_insert = kvs_insert_linear_cowbtree;
kvs->ckvs.kvs_lookup = kvs_lookup_linear_cowbtree;
kvs->ckvs.kvs_delete = kvs_delete_linear_cowbtree;
kvs->ckvs.kvs_iterate = NULL;
md->kvs_linear = kvs;
}
return &(kvs->ckvs);
badtree:
kfree(kvs);
return (struct kvstore *) kvs;
}
/********************************************************
* Sparse KVS Functions *
********************************************************/
static int kvs_delete_sparse_cowbtree(struct kvstore *kvs,
void *key, int32_t ksize)
{
char *entry;
uint64_t key_val;
int r;
struct kvstore_cbt *kvcbt = NULL;
kvcbt = container_of(kvs, struct kvstore_cbt, ckvs);
if (ksize != kvs->ksize)
return -EINVAL;
entry = kmalloc(kvcbt->entry_size, GFP_NOIO);
if (!entry)
return -ENOMEM;
key_val = (*(uint64_t *)key);
repeat:
r = dm_btree_lookup(&(kvcbt->info), kvcbt->root, &key_val, entry);
if (r == -ENODATA)
return -ENODEV;
else if (r >= 0) {
if (!memcmp(entry, key, ksize)) {
r = dm_btree_remove(&(kvcbt->info),
kvcbt->root, &key_val, &(kvcbt->root));
kfree(entry);
return r;
}
key_val++;
goto repeat;
} else {
kfree(entry);
return r;
}
}
/*
* 0 - not found
* 1 - found
* < 0 - error on lookup
*/
static int kvs_lookup_sparse_cowbtree(struct kvstore *kvs, void *key,
int32_t ksize, void *value, int32_t *vsize)
{
char *entry;
uint64_t key_val;
int r;
struct kvstore_cbt *kvcbt = NULL;
kvcbt = container_of(kvs, struct kvstore_cbt, ckvs);
if (ksize != kvs->ksize)
return -EINVAL;
entry = kmalloc(kvcbt->entry_size, GFP_NOIO);
if (!entry)
return -ENOMEM;
key_val = (*(uint64_t *)key);
repeat:
r = dm_btree_lookup(&(kvcbt->info), kvcbt->root, &key_val, entry);
if (r == -ENODATA) {
kfree(entry);
return 0;
} else if (r >= 0) {
if (!memcmp(entry, key, ksize)) {
memcpy(value, entry + ksize, kvs->vsize);
kfree(entry);
return 1;
}
key_val++;
goto repeat;
} else {
kfree(entry);
return r;
}
}
static int kvs_insert_sparse_cowbtree(struct kvstore *kvs, void *key,
int32_t ksize, void *value,
int32_t vsize)
{
char *entry;
uint64_t key_val;
int r;
struct kvstore_cbt *kvcbt = NULL;
kvcbt = container_of(kvs, struct kvstore_cbt, ckvs);
if (ksize != kvs->ksize)
return -EINVAL;
if (vsize != kvs->vsize)
return -EINVAL;
entry = kmalloc(kvcbt->entry_size, GFP_NOIO);
if (!entry)
return -ENOMEM;
key_val = (*(uint64_t *)key);
repeat:
r = dm_btree_lookup(&(kvcbt->info), kvcbt->root, &key_val, entry);
if (r == -ENODATA) {
memcpy(entry, key, ksize);
memcpy(entry + ksize, value, vsize);
__dm_bless_for_disk(&key_val);
r = dm_btree_insert(&(kvcbt->info), kvcbt->root, &key_val,
entry, &(kvcbt->root));
kfree(entry);
return r;
} else if (r >= 0) {
key_val++;
goto repeat;
} else {
kfree(entry);
return r;
}
}
static struct kvstore *kvs_create_sparse_cowbtree(struct metadata *md,
uint32_t ksize, uint32_t vsize, uint32_t knummax,
bool unformatted)
{
struct kvstore_cbt *kvs;
int r;
if (!vsize || !ksize)
return ERR_PTR(-ENOTSUPP);
/* We do not support two or more KVSs at the moment */
if (md->kvs_sparse)
return ERR_PTR(-EBUSY);
kvs = kmalloc(sizeof(*kvs), GFP_NOIO);
if (!kvs)
return ERR_PTR(-ENOMEM);
kvs->ckvs.vsize = vsize;
kvs->ckvs.ksize = ksize;
kvs->entry_size = vsize + ksize;
kvs->info.tm = md->tm;
kvs->info.levels = 1;
kvs->info.value_type.context = NULL;
kvs->info.value_type.size = kvs->entry_size;
kvs->info.value_type.inc = NULL;
kvs->info.value_type.dec = NULL;
kvs->info.value_type.equal = NULL;
if (!unformatted) {
kvs->ckvs.kvs_insert = kvs_insert_sparse_cowbtree;
kvs->ckvs.kvs_lookup = kvs_lookup_sparse_cowbtree;
kvs->ckvs.kvs_delete = kvs_delete_sparse_cowbtree;
kvs->ckvs.kvs_iterate = NULL;
md->kvs_sparse = kvs;
__begin_transaction(md);
} else {
r = dm_btree_empty(&(kvs->info), &(kvs->root));
if (r < 0) {
kvs = ERR_PTR(r);
goto badtree;
}
/* I think this should be moved below the 4 lines below */
flush_meta_cowbtree(md);
kvs->ckvs.kvs_insert = kvs_insert_sparse_cowbtree;
kvs->ckvs.kvs_lookup = kvs_lookup_sparse_cowbtree;
kvs->ckvs.kvs_delete = kvs_delete_sparse_cowbtree;
kvs->ckvs.kvs_iterate = NULL;
md->kvs_sparse = kvs;
}
return &(kvs->ckvs);
badtree:
kfree(kvs);
return (struct kvstore *) kvs;
}
int get_private_data_cowbtree(struct metadata *md, void **data, uint32_t size)
{
if(size > sizeof(md->private_data))
return -1;
memcpy(*data, md->private_data, size);
return 0;
}
int set_private_data_cowbtree(struct metadata *md, void *data, uint32_t size)
{
if(size > sizeof(md->private_data))
return -1;
memcpy(md->private_data, data, size);
return 0;
}
struct metadata_ops metadata_ops_cowbtree = {
.init_meta = init_meta_cowbtree,
.exit_meta = exit_meta_cowbtree,
.kvs_create_linear = kvs_create_linear_cowbtree,
.kvs_create_sparse = kvs_create_sparse_cowbtree,
.alloc_data_block = alloc_data_block_cowbtree,
.inc_refcount = inc_refcount_cowbtree,
.dec_refcount = dec_refcount_cowbtree,
.get_refcount = get_refcount_cowbtree,
.flush_meta = flush_meta_cowbtree,
.flush_bufio_cache = NULL,
.get_private_data = get_private_data_cowbtree,
.set_private_data = set_private_data_cowbtree,
};