blob: cb8d2ccbb6c6e7223aa0f806d45546c56421de7e [file] [log] [blame]
Kent Overstreetcafe5632013-03-23 16:11:31 -07001
2#ifndef _BCACHE_UTIL_H
3#define _BCACHE_UTIL_H
4
Kent Overstreet9a02b7e2013-12-20 17:24:46 -08005#include <linux/blkdev.h>
Kent Overstreetcafe5632013-03-23 16:11:31 -07006#include <linux/errno.h>
7#include <linux/kernel.h>
Ingo Molnare6017572017-02-01 16:36:40 +01008#include <linux/sched/clock.h>
Kent Overstreetcafe5632013-03-23 16:11:31 -07009#include <linux/llist.h>
10#include <linux/ratelimit.h>
11#include <linux/vmalloc.h>
12#include <linux/workqueue.h>
13
14#include "closure.h"
15
16#define PAGE_SECTORS (PAGE_SIZE / 512)
17
18struct closure;
19
Kent Overstreet280481d2013-10-24 16:36:03 -070020#ifdef CONFIG_BCACHE_DEBUG
Kent Overstreetcafe5632013-03-23 16:11:31 -070021
Kent Overstreetdc9d98d2013-12-17 23:47:33 -080022#define EBUG_ON(cond) BUG_ON(cond)
Kent Overstreetcafe5632013-03-23 16:11:31 -070023#define atomic_dec_bug(v) BUG_ON(atomic_dec_return(v) < 0)
24#define atomic_inc_bug(v, i) BUG_ON(atomic_inc_return(v) <= i)
25
Kent Overstreet280481d2013-10-24 16:36:03 -070026#else /* DEBUG */
Kent Overstreetcafe5632013-03-23 16:11:31 -070027
Kent Overstreetdc9d98d2013-12-17 23:47:33 -080028#define EBUG_ON(cond) do { if (cond); } while (0)
Kent Overstreetcafe5632013-03-23 16:11:31 -070029#define atomic_dec_bug(v) atomic_dec(v)
30#define atomic_inc_bug(v, i) atomic_inc(v)
31
32#endif
33
Kent Overstreetcafe5632013-03-23 16:11:31 -070034#define DECLARE_HEAP(type, name) \
35 struct { \
36 size_t size, used; \
37 type *data; \
38 } name
39
40#define init_heap(heap, _size, gfp) \
41({ \
42 size_t _bytes; \
43 (heap)->used = 0; \
44 (heap)->size = (_size); \
45 _bytes = (heap)->size * sizeof(*(heap)->data); \
Michal Hocko752ade62017-05-08 15:57:27 -070046 (heap)->data = kvmalloc(_bytes, (gfp) & GFP_KERNEL); \
Kent Overstreetcafe5632013-03-23 16:11:31 -070047 (heap)->data; \
48})
49
50#define free_heap(heap) \
51do { \
Pekka Enberg958b4332015-06-30 14:59:30 -070052 kvfree((heap)->data); \
Kent Overstreetcafe5632013-03-23 16:11:31 -070053 (heap)->data = NULL; \
54} while (0)
55
56#define heap_swap(h, i, j) swap((h)->data[i], (h)->data[j])
57
58#define heap_sift(h, i, cmp) \
59do { \
60 size_t _r, _j = i; \
61 \
62 for (; _j * 2 + 1 < (h)->used; _j = _r) { \
63 _r = _j * 2 + 1; \
64 if (_r + 1 < (h)->used && \
65 cmp((h)->data[_r], (h)->data[_r + 1])) \
66 _r++; \
67 \
68 if (cmp((h)->data[_r], (h)->data[_j])) \
69 break; \
70 heap_swap(h, _r, _j); \
71 } \
72} while (0)
73
74#define heap_sift_down(h, i, cmp) \
75do { \
76 while (i) { \
77 size_t p = (i - 1) / 2; \
78 if (cmp((h)->data[i], (h)->data[p])) \
79 break; \
80 heap_swap(h, i, p); \
81 i = p; \
82 } \
83} while (0)
84
85#define heap_add(h, d, cmp) \
86({ \
87 bool _r = !heap_full(h); \
88 if (_r) { \
89 size_t _i = (h)->used++; \
90 (h)->data[_i] = d; \
91 \
92 heap_sift_down(h, _i, cmp); \
93 heap_sift(h, _i, cmp); \
94 } \
95 _r; \
96})
97
98#define heap_pop(h, d, cmp) \
99({ \
100 bool _r = (h)->used; \
101 if (_r) { \
102 (d) = (h)->data[0]; \
103 (h)->used--; \
104 heap_swap(h, 0, (h)->used); \
105 heap_sift(h, 0, cmp); \
106 } \
107 _r; \
108})
109
Nicholas Swenson97d11a62013-10-23 17:35:26 -0700110#define heap_peek(h) ((h)->used ? (h)->data[0] : NULL)
Kent Overstreetcafe5632013-03-23 16:11:31 -0700111
112#define heap_full(h) ((h)->used == (h)->size)
113
114#define DECLARE_FIFO(type, name) \
115 struct { \
116 size_t front, back, size, mask; \
117 type *data; \
118 } name
119
120#define fifo_for_each(c, fifo, iter) \
121 for (iter = (fifo)->front; \
122 c = (fifo)->data[iter], iter != (fifo)->back; \
123 iter = (iter + 1) & (fifo)->mask)
124
125#define __init_fifo(fifo, gfp) \
126({ \
127 size_t _allocated_size, _bytes; \
128 BUG_ON(!(fifo)->size); \
129 \
130 _allocated_size = roundup_pow_of_two((fifo)->size + 1); \
131 _bytes = _allocated_size * sizeof(*(fifo)->data); \
132 \
133 (fifo)->mask = _allocated_size - 1; \
134 (fifo)->front = (fifo)->back = 0; \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700135 \
Michal Hocko752ade62017-05-08 15:57:27 -0700136 (fifo)->data = kvmalloc(_bytes, (gfp) & GFP_KERNEL); \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700137 (fifo)->data; \
138})
139
140#define init_fifo_exact(fifo, _size, gfp) \
141({ \
142 (fifo)->size = (_size); \
143 __init_fifo(fifo, gfp); \
144})
145
146#define init_fifo(fifo, _size, gfp) \
147({ \
148 (fifo)->size = (_size); \
149 if ((fifo)->size > 4) \
150 (fifo)->size = roundup_pow_of_two((fifo)->size) - 1; \
151 __init_fifo(fifo, gfp); \
152})
153
154#define free_fifo(fifo) \
155do { \
Pekka Enberg958b4332015-06-30 14:59:30 -0700156 kvfree((fifo)->data); \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700157 (fifo)->data = NULL; \
158} while (0)
159
160#define fifo_used(fifo) (((fifo)->back - (fifo)->front) & (fifo)->mask)
161#define fifo_free(fifo) ((fifo)->size - fifo_used(fifo))
162
163#define fifo_empty(fifo) (!fifo_used(fifo))
164#define fifo_full(fifo) (!fifo_free(fifo))
165
166#define fifo_front(fifo) ((fifo)->data[(fifo)->front])
167#define fifo_back(fifo) \
168 ((fifo)->data[((fifo)->back - 1) & (fifo)->mask])
169
170#define fifo_idx(fifo, p) (((p) - &fifo_front(fifo)) & (fifo)->mask)
171
172#define fifo_push_back(fifo, i) \
173({ \
174 bool _r = !fifo_full((fifo)); \
175 if (_r) { \
176 (fifo)->data[(fifo)->back++] = (i); \
177 (fifo)->back &= (fifo)->mask; \
178 } \
179 _r; \
180})
181
182#define fifo_pop_front(fifo, i) \
183({ \
184 bool _r = !fifo_empty((fifo)); \
185 if (_r) { \
186 (i) = (fifo)->data[(fifo)->front++]; \
187 (fifo)->front &= (fifo)->mask; \
188 } \
189 _r; \
190})
191
192#define fifo_push_front(fifo, i) \
193({ \
194 bool _r = !fifo_full((fifo)); \
195 if (_r) { \
196 --(fifo)->front; \
197 (fifo)->front &= (fifo)->mask; \
198 (fifo)->data[(fifo)->front] = (i); \
199 } \
200 _r; \
201})
202
203#define fifo_pop_back(fifo, i) \
204({ \
205 bool _r = !fifo_empty((fifo)); \
206 if (_r) { \
207 --(fifo)->back; \
208 (fifo)->back &= (fifo)->mask; \
209 (i) = (fifo)->data[(fifo)->back] \
210 } \
211 _r; \
212})
213
214#define fifo_push(fifo, i) fifo_push_back(fifo, (i))
215#define fifo_pop(fifo, i) fifo_pop_front(fifo, (i))
216
217#define fifo_swap(l, r) \
218do { \
219 swap((l)->front, (r)->front); \
220 swap((l)->back, (r)->back); \
221 swap((l)->size, (r)->size); \
222 swap((l)->mask, (r)->mask); \
223 swap((l)->data, (r)->data); \
224} while (0)
225
226#define fifo_move(dest, src) \
227do { \
228 typeof(*((dest)->data)) _t; \
229 while (!fifo_full(dest) && \
230 fifo_pop(src, _t)) \
231 fifo_push(dest, _t); \
232} while (0)
233
234/*
235 * Simple array based allocator - preallocates a number of elements and you can
236 * never allocate more than that, also has no locking.
237 *
238 * Handy because if you know you only need a fixed number of elements you don't
239 * have to worry about memory allocation failure, and sometimes a mempool isn't
240 * what you want.
241 *
242 * We treat the free elements as entries in a singly linked list, and the
243 * freelist as a stack - allocating and freeing push and pop off the freelist.
244 */
245
246#define DECLARE_ARRAY_ALLOCATOR(type, name, size) \
247 struct { \
248 type *freelist; \
249 type data[size]; \
250 } name
251
252#define array_alloc(array) \
253({ \
254 typeof((array)->freelist) _ret = (array)->freelist; \
255 \
256 if (_ret) \
257 (array)->freelist = *((typeof((array)->freelist) *) _ret);\
258 \
259 _ret; \
260})
261
262#define array_free(array, ptr) \
263do { \
264 typeof((array)->freelist) _ptr = ptr; \
265 \
266 *((typeof((array)->freelist) *) _ptr) = (array)->freelist; \
267 (array)->freelist = _ptr; \
268} while (0)
269
270#define array_allocator_init(array) \
271do { \
272 typeof((array)->freelist) _i; \
273 \
274 BUILD_BUG_ON(sizeof((array)->data[0]) < sizeof(void *)); \
275 (array)->freelist = NULL; \
276 \
277 for (_i = (array)->data; \
278 _i < (array)->data + ARRAY_SIZE((array)->data); \
279 _i++) \
280 array_free(array, _i); \
281} while (0)
282
283#define array_freelist_empty(array) ((array)->freelist == NULL)
284
285#define ANYSINT_MAX(t) \
286 ((((t) 1 << (sizeof(t) * 8 - 2)) - (t) 1) * (t) 2 + (t) 1)
287
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600288int bch_strtoint_h(const char *, int *);
289int bch_strtouint_h(const char *, unsigned int *);
290int bch_strtoll_h(const char *, long long *);
291int bch_strtoull_h(const char *, unsigned long long *);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700292
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600293static inline int bch_strtol_h(const char *cp, long *res)
Kent Overstreetcafe5632013-03-23 16:11:31 -0700294{
295#if BITS_PER_LONG == 32
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600296 return bch_strtoint_h(cp, (int *) res);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700297#else
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600298 return bch_strtoll_h(cp, (long long *) res);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700299#endif
300}
301
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600302static inline int bch_strtoul_h(const char *cp, long *res)
Kent Overstreetcafe5632013-03-23 16:11:31 -0700303{
304#if BITS_PER_LONG == 32
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600305 return bch_strtouint_h(cp, (unsigned int *) res);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700306#else
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600307 return bch_strtoull_h(cp, (unsigned long long *) res);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700308#endif
309}
310
311#define strtoi_h(cp, res) \
312 (__builtin_types_compatible_p(typeof(*res), int) \
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600313 ? bch_strtoint_h(cp, (void *) res) \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700314 : __builtin_types_compatible_p(typeof(*res), long) \
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600315 ? bch_strtol_h(cp, (void *) res) \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700316 : __builtin_types_compatible_p(typeof(*res), long long) \
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600317 ? bch_strtoll_h(cp, (void *) res) \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700318 : __builtin_types_compatible_p(typeof(*res), unsigned int) \
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600319 ? bch_strtouint_h(cp, (void *) res) \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700320 : __builtin_types_compatible_p(typeof(*res), unsigned long) \
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600321 ? bch_strtoul_h(cp, (void *) res) \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700322 : __builtin_types_compatible_p(typeof(*res), unsigned long long)\
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600323 ? bch_strtoull_h(cp, (void *) res) : -EINVAL)
Kent Overstreetcafe5632013-03-23 16:11:31 -0700324
325#define strtoul_safe(cp, var) \
326({ \
327 unsigned long _v; \
328 int _r = kstrtoul(cp, 10, &_v); \
329 if (!_r) \
330 var = _v; \
331 _r; \
332})
333
334#define strtoul_safe_clamp(cp, var, min, max) \
335({ \
336 unsigned long _v; \
337 int _r = kstrtoul(cp, 10, &_v); \
338 if (!_r) \
339 var = clamp_t(typeof(var), _v, min, max); \
340 _r; \
341})
342
343#define snprint(buf, size, var) \
344 snprintf(buf, size, \
345 __builtin_types_compatible_p(typeof(var), int) \
346 ? "%i\n" : \
347 __builtin_types_compatible_p(typeof(var), unsigned) \
348 ? "%u\n" : \
349 __builtin_types_compatible_p(typeof(var), long) \
350 ? "%li\n" : \
351 __builtin_types_compatible_p(typeof(var), unsigned long)\
352 ? "%lu\n" : \
353 __builtin_types_compatible_p(typeof(var), int64_t) \
354 ? "%lli\n" : \
355 __builtin_types_compatible_p(typeof(var), uint64_t) \
356 ? "%llu\n" : \
357 __builtin_types_compatible_p(typeof(var), const char *) \
358 ? "%s\n" : "%i\n", var)
359
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600360ssize_t bch_hprint(char *buf, int64_t v);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700361
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600362bool bch_is_zero(const char *p, size_t n);
363int bch_parse_uuid(const char *s, char *uuid);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700364
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600365ssize_t bch_snprint_string_list(char *buf, size_t size, const char * const list[],
Kent Overstreetcafe5632013-03-23 16:11:31 -0700366 size_t selected);
367
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600368ssize_t bch_read_string_list(const char *buf, const char * const list[]);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700369
370struct time_stats {
Kent Overstreet65d22e92013-07-31 00:03:54 -0700371 spinlock_t lock;
Kent Overstreetcafe5632013-03-23 16:11:31 -0700372 /*
373 * all fields are in nanoseconds, averages are ewmas stored left shifted
374 * by 8
375 */
376 uint64_t max_duration;
377 uint64_t average_duration;
378 uint64_t average_frequency;
379 uint64_t last;
380};
381
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600382void bch_time_stats_update(struct time_stats *stats, uint64_t time);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700383
Kent Overstreet9a02b7e2013-12-20 17:24:46 -0800384static inline unsigned local_clock_us(void)
385{
386 return local_clock() >> 10;
387}
388
Kent Overstreetcafe5632013-03-23 16:11:31 -0700389#define NSEC_PER_ns 1L
390#define NSEC_PER_us NSEC_PER_USEC
391#define NSEC_PER_ms NSEC_PER_MSEC
392#define NSEC_PER_sec NSEC_PER_SEC
393
394#define __print_time_stat(stats, name, stat, units) \
395 sysfs_print(name ## _ ## stat ## _ ## units, \
396 div_u64((stats)->stat >> 8, NSEC_PER_ ## units))
397
398#define sysfs_print_time_stats(stats, name, \
399 frequency_units, \
400 duration_units) \
401do { \
402 __print_time_stat(stats, name, \
403 average_frequency, frequency_units); \
404 __print_time_stat(stats, name, \
405 average_duration, duration_units); \
Surbhi Palande5b25aba2014-04-17 12:07:04 -0700406 sysfs_print(name ## _ ##max_duration ## _ ## duration_units, \
407 div_u64((stats)->max_duration, NSEC_PER_ ## duration_units));\
Kent Overstreetcafe5632013-03-23 16:11:31 -0700408 \
409 sysfs_print(name ## _last_ ## frequency_units, (stats)->last \
410 ? div_s64(local_clock() - (stats)->last, \
411 NSEC_PER_ ## frequency_units) \
412 : -1LL); \
413} while (0)
414
415#define sysfs_time_stats_attribute(name, \
416 frequency_units, \
417 duration_units) \
418read_attribute(name ## _average_frequency_ ## frequency_units); \
419read_attribute(name ## _average_duration_ ## duration_units); \
420read_attribute(name ## _max_duration_ ## duration_units); \
421read_attribute(name ## _last_ ## frequency_units)
422
423#define sysfs_time_stats_attribute_list(name, \
424 frequency_units, \
425 duration_units) \
426&sysfs_ ## name ## _average_frequency_ ## frequency_units, \
427&sysfs_ ## name ## _average_duration_ ## duration_units, \
428&sysfs_ ## name ## _max_duration_ ## duration_units, \
429&sysfs_ ## name ## _last_ ## frequency_units,
430
431#define ewma_add(ewma, val, weight, factor) \
432({ \
433 (ewma) *= (weight) - 1; \
434 (ewma) += (val) << factor; \
435 (ewma) /= (weight); \
436 (ewma) >> factor; \
437})
438
Kent Overstreetc2a4f312013-09-23 23:17:31 -0700439struct bch_ratelimit {
440 /* Next time we want to do some work, in nanoseconds */
Kent Overstreetcafe5632013-03-23 16:11:31 -0700441 uint64_t next;
Kent Overstreetc2a4f312013-09-23 23:17:31 -0700442
443 /*
444 * Rate at which we want to do work, in units per nanosecond
445 * The units here correspond to the units passed to bch_next_delay()
446 */
Kent Overstreetcafe5632013-03-23 16:11:31 -0700447 unsigned rate;
448};
449
Kent Overstreetc2a4f312013-09-23 23:17:31 -0700450static inline void bch_ratelimit_reset(struct bch_ratelimit *d)
Kent Overstreetcafe5632013-03-23 16:11:31 -0700451{
452 d->next = local_clock();
453}
454
Kent Overstreetc2a4f312013-09-23 23:17:31 -0700455uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700456
457#define __DIV_SAFE(n, d, zero) \
458({ \
459 typeof(n) _n = (n); \
460 typeof(d) _d = (d); \
461 _d ? _n / _d : zero; \
462})
463
464#define DIV_SAFE(n, d) __DIV_SAFE(n, d, 0)
465
466#define container_of_or_null(ptr, type, member) \
467({ \
468 typeof(ptr) _ptr = ptr; \
469 _ptr ? container_of(_ptr, type, member) : NULL; \
470})
471
472#define RB_INSERT(root, new, member, cmp) \
473({ \
474 __label__ dup; \
475 struct rb_node **n = &(root)->rb_node, *parent = NULL; \
476 typeof(new) this; \
477 int res, ret = -1; \
478 \
479 while (*n) { \
480 parent = *n; \
481 this = container_of(*n, typeof(*(new)), member); \
482 res = cmp(new, this); \
483 if (!res) \
484 goto dup; \
485 n = res < 0 \
486 ? &(*n)->rb_left \
487 : &(*n)->rb_right; \
488 } \
489 \
490 rb_link_node(&(new)->member, parent, n); \
491 rb_insert_color(&(new)->member, root); \
492 ret = 0; \
493dup: \
494 ret; \
495})
496
497#define RB_SEARCH(root, search, member, cmp) \
498({ \
499 struct rb_node *n = (root)->rb_node; \
500 typeof(&(search)) this, ret = NULL; \
501 int res; \
502 \
503 while (n) { \
504 this = container_of(n, typeof(search), member); \
505 res = cmp(&(search), this); \
506 if (!res) { \
507 ret = this; \
508 break; \
509 } \
510 n = res < 0 \
511 ? n->rb_left \
512 : n->rb_right; \
513 } \
514 ret; \
515})
516
517#define RB_GREATER(root, search, member, cmp) \
518({ \
519 struct rb_node *n = (root)->rb_node; \
520 typeof(&(search)) this, ret = NULL; \
521 int res; \
522 \
523 while (n) { \
524 this = container_of(n, typeof(search), member); \
525 res = cmp(&(search), this); \
526 if (res < 0) { \
527 ret = this; \
528 n = n->rb_left; \
529 } else \
530 n = n->rb_right; \
531 } \
532 ret; \
533})
534
535#define RB_FIRST(root, type, member) \
536 container_of_or_null(rb_first(root), type, member)
537
538#define RB_LAST(root, type, member) \
539 container_of_or_null(rb_last(root), type, member)
540
541#define RB_NEXT(ptr, member) \
542 container_of_or_null(rb_next(&(ptr)->member), typeof(*ptr), member)
543
544#define RB_PREV(ptr, member) \
545 container_of_or_null(rb_prev(&(ptr)->member), typeof(*ptr), member)
546
547/* Does linear interpolation between powers of two */
548static inline unsigned fract_exp_two(unsigned x, unsigned fract_bits)
549{
550 unsigned fract = x & ~(~0 << fract_bits);
551
552 x >>= fract_bits;
553 x = 1 << x;
554 x += (x * fract) >> fract_bits;
555
556 return x;
557}
558
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600559void bch_bio_map(struct bio *bio, void *base);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700560
Kent Overstreetcafe5632013-03-23 16:11:31 -0700561static inline sector_t bdev_sectors(struct block_device *bdev)
562{
563 return bdev->bd_inode->i_size >> 9;
564}
565
Kent Overstreet749b61d2013-11-23 23:11:25 -0800566#define closure_bio_submit(bio, cl) \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700567do { \
568 closure_get(cl); \
Kent Overstreet749b61d2013-11-23 23:11:25 -0800569 generic_make_request(bio); \
Kent Overstreetcafe5632013-03-23 16:11:31 -0700570} while (0)
571
Kent Overstreet169ef1c2013-03-28 12:50:55 -0600572uint64_t bch_crc64_update(uint64_t, const void *, size_t);
573uint64_t bch_crc64(const void *, size_t);
Kent Overstreetcafe5632013-03-23 16:11:31 -0700574
575#endif /* _BCACHE_UTIL_H */