Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcache: Don't export utility code, prefix with bch_

Signed-off-by: Kent Overstreet <koverstreet@google.com>
Cc: linux-bcache@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Kent Overstreet and committed by
Jens Axboe
169ef1cf 0b6ef416

+89 -101
+1 -1
drivers/md/bcache/bcache.h
··· 1033 1033 * jset: The checksum is _always_ the first 8 bytes of these structs 1034 1034 */ 1035 1035 #define csum_set(i) \ 1036 - crc64(((void *) (i)) + sizeof(uint64_t), \ 1036 + bch_crc64(((void *) (i)) + sizeof(uint64_t), \ 1037 1037 ((void *) end(i)) - (((void *) (i)) + sizeof(uint64_t))) 1038 1038 1039 1039 /* Error handling macros */
+2 -2
drivers/md/bcache/bset.c
··· 1026 1026 1027 1027 if (!start) { 1028 1028 spin_lock(&b->c->sort_time_lock); 1029 - time_stats_update(&b->c->sort_time, start_time); 1029 + bch_time_stats_update(&b->c->sort_time, start_time); 1030 1030 spin_unlock(&b->c->sort_time_lock); 1031 1031 } 1032 1032 } ··· 1076 1076 btree_mergesort(b, new->sets->data, &iter, false, true); 1077 1077 1078 1078 spin_lock(&b->c->sort_time_lock); 1079 - time_stats_update(&b->c->sort_time, start_time); 1079 + bch_time_stats_update(&b->c->sort_time, start_time); 1080 1080 spin_unlock(&b->c->sort_time_lock); 1081 1081 1082 1082 bkey_copy_key(&new->key, &b->key);
+9 -9
drivers/md/bcache/btree.c
··· 129 129 uint64_t crc = b->key.ptr[0]; 130 130 void *data = (void *) i + 8, *end = end(i); 131 131 132 - crc = crc64_update(crc, data, end - data); 132 + crc = bch_crc64_update(crc, data, end - data); 133 133 return crc ^ 0xffffffffffffffff; 134 134 } 135 135 ··· 231 231 mutex_unlock(&b->c->fill_lock); 232 232 233 233 spin_lock(&b->c->btree_read_time_lock); 234 - time_stats_update(&b->c->btree_read_time, b->io_start_time); 234 + bch_time_stats_update(&b->c->btree_read_time, b->io_start_time); 235 235 spin_unlock(&b->c->btree_read_time_lock); 236 236 237 237 smp_wmb(); /* read_done is our write lock */ ··· 259 259 b->bio->bi_rw = REQ_META|READ_SYNC; 260 260 b->bio->bi_size = KEY_SIZE(&b->key) << 9; 261 261 262 - bio_map(b->bio, b->sets[0].data); 262 + bch_bio_map(b->bio, b->sets[0].data); 263 263 264 264 pr_debug("%s", pbtree(b)); 265 265 trace_bcache_btree_read(b->bio); ··· 327 327 btree_bio_init(b); 328 328 b->bio->bi_rw = REQ_META|WRITE_SYNC; 329 329 b->bio->bi_size = set_blocks(i, b->c) * block_bytes(b->c); 330 - bio_map(b->bio, i); 330 + bch_bio_map(b->bio, i); 331 331 332 332 bkey_copy(&k.key, &b->key); 333 333 SET_PTR_OFFSET(&k.key, 0, PTR_OFFSET(&k.key, 0) + bset_offset(b, i)); 334 334 335 - if (!bio_alloc_pages(b->bio, GFP_NOIO)) { 335 + if (!bch_bio_alloc_pages(b->bio, GFP_NOIO)) { 336 336 int j; 337 337 struct bio_vec *bv; 338 338 void *base = (void *) ((unsigned long) i & ~(PAGE_SIZE - 1)); ··· 347 347 continue_at(cl, btree_write_done, NULL); 348 348 } else { 349 349 b->bio->bi_vcnt = 0; 350 - bio_map(b->bio, i); 350 + bch_bio_map(b->bio, i); 351 351 352 352 trace_bcache_btree_write(b->bio); 353 353 bch_submit_bbio(b->bio, b->c, &k.key, 0); ··· 815 815 void bch_cannibalize_unlock(struct cache_set *c, struct closure *cl) 816 816 { 817 817 if (c->try_harder == cl) { 818 - time_stats_update(&c->try_harder_time, c->try_harder_start); 818 + bch_time_stats_update(&c->try_harder_time, c->try_harder_start); 819 819 c->try_harder = NULL; 820 820 __closure_wake_up(&c->try_wait); 821 821 } ··· 1536 1536 1537 1537 available = bch_btree_gc_finish(c); 1538 1538 1539 - time_stats_update(&c->btree_gc_time, start_time); 1539 + bch_time_stats_update(&c->btree_gc_time, start_time); 1540 1540 1541 1541 stats.key_bytes *= sizeof(uint64_t); 1542 1542 stats.dirty <<= 9; ··· 2007 2007 rw_unlock(true, n1); 2008 2008 btree_node_free(b, op); 2009 2009 2010 - time_stats_update(&b->c->btree_split_time, start_time); 2010 + bch_time_stats_update(&b->c->btree_split_time, start_time); 2011 2011 2012 2012 return 0; 2013 2013 err_free2:
+1 -1
drivers/md/bcache/debug.c
··· 200 200 if (!check) 201 201 return; 202 202 203 - if (bio_alloc_pages(check, GFP_NOIO)) 203 + if (bch_bio_alloc_pages(check, GFP_NOIO)) 204 204 goto out_put; 205 205 206 206 check->bi_rw = READ_SYNC;
+2 -2
drivers/md/bcache/journal.c
··· 54 54 55 55 bio->bi_end_io = journal_read_endio; 56 56 bio->bi_private = &op->cl; 57 - bio_map(bio, data); 57 + bch_bio_map(bio, data); 58 58 59 59 closure_bio_submit(bio, &op->cl, ca); 60 60 closure_sync(&op->cl); ··· 621 621 622 622 bio->bi_end_io = journal_write_endio; 623 623 bio->bi_private = w; 624 - bio_map(bio, w->data); 624 + bch_bio_map(bio, w->data); 625 625 626 626 trace_bcache_journal_write(bio); 627 627 bio_list_add(&list, bio);
+2 -2
drivers/md/bcache/movinggc.c
··· 85 85 PAGE_SECTORS); 86 86 bio->bi_private = &io->s.cl; 87 87 bio->bi_io_vec = bio->bi_inline_vecs; 88 - bio_map(bio, NULL); 88 + bch_bio_map(bio, NULL); 89 89 } 90 90 91 91 static void write_moving(struct closure *cl) ··· 159 159 bio->bi_rw = READ; 160 160 bio->bi_end_io = read_moving_endio; 161 161 162 - if (bio_alloc_pages(bio, GFP_KERNEL)) 162 + if (bch_bio_alloc_pages(bio, GFP_KERNEL)) 163 163 goto err; 164 164 165 165 pr_debug("%s", pkey(&w->key));
+7 -7
drivers/md/bcache/request.c
··· 58 58 char __user *buf, size_t nbytes, loff_t *ppos) 59 59 { 60 60 char tmp[1024]; 61 - int len = snprint_string_list(tmp, PAGE_SIZE, bch_cache_modes, 62 - cgroup_to_bcache(cgrp)->cache_mode + 1); 61 + int len = bch_snprint_string_list(tmp, PAGE_SIZE, bch_cache_modes, 62 + cgroup_to_bcache(cgrp)->cache_mode + 1); 63 63 64 64 if (len < 0) 65 65 return len; ··· 70 70 static int cache_mode_write(struct cgroup *cgrp, struct cftype *cft, 71 71 const char *buf) 72 72 { 73 - int v = read_string_list(buf, bch_cache_modes); 73 + int v = bch_read_string_list(buf, bch_cache_modes); 74 74 if (v < 0) 75 75 return v; 76 76 ··· 205 205 206 206 bio_for_each_segment(bv, bio, i) { 207 207 void *d = kmap(bv->bv_page) + bv->bv_offset; 208 - csum = crc64_update(csum, d, bv->bv_len); 208 + csum = bch_crc64_update(csum, d, bv->bv_len); 209 209 kunmap(bv->bv_page); 210 210 } 211 211 ··· 835 835 s->op.cache_bio->bi_sector = s->cache_miss->bi_sector; 836 836 s->op.cache_bio->bi_bdev = s->cache_miss->bi_bdev; 837 837 s->op.cache_bio->bi_size = s->cache_bio_sectors << 9; 838 - bio_map(s->op.cache_bio, NULL); 838 + bch_bio_map(s->op.cache_bio, NULL); 839 839 840 840 src = bio_iovec(s->op.cache_bio); 841 841 dst = bio_iovec(s->cache_miss); ··· 962 962 if (!bch_btree_insert_check_key(b, &s->op, s->op.cache_bio)) 963 963 goto out_put; 964 964 965 - bio_map(s->op.cache_bio, NULL); 966 - if (bio_alloc_pages(s->op.cache_bio, __GFP_NOWARN|GFP_NOIO)) 965 + bch_bio_map(s->op.cache_bio, NULL); 966 + if (bch_bio_alloc_pages(s->op.cache_bio, __GFP_NOWARN|GFP_NOIO)) 967 967 goto out_put; 968 968 969 969 s->cache_miss = miss;
+9 -9
drivers/md/bcache/super.c
··· 142 142 goto err; 143 143 144 144 err = "Bad UUID"; 145 - if (is_zero(sb->uuid, 16)) 145 + if (bch_is_zero(sb->uuid, 16)) 146 146 goto err; 147 147 148 148 err = "Unsupported superblock version"; ··· 170 170 goto out; 171 171 172 172 err = "Bad UUID"; 173 - if (is_zero(sb->set_uuid, 16)) 173 + if (bch_is_zero(sb->set_uuid, 16)) 174 174 goto err; 175 175 176 176 err = "Bad cache device number in set"; ··· 218 218 bio->bi_sector = SB_SECTOR; 219 219 bio->bi_rw = REQ_SYNC|REQ_META; 220 220 bio->bi_size = SB_SIZE; 221 - bio_map(bio, NULL); 221 + bch_bio_map(bio, NULL); 222 222 223 223 out->offset = cpu_to_le64(sb->offset); 224 224 out->version = cpu_to_le64(sb->version); ··· 332 332 333 333 bio->bi_end_io = uuid_endio; 334 334 bio->bi_private = cl; 335 - bio_map(bio, c->uuids); 335 + bch_bio_map(bio, c->uuids); 336 336 337 337 bch_submit_bbio(bio, c, k, i); 338 338 ··· 344 344 pkey(&c->uuid_bucket)); 345 345 346 346 for (u = c->uuids; u < c->uuids + c->nr_uuids; u++) 347 - if (!is_zero(u->uuid, 16)) 347 + if (!bch_is_zero(u->uuid, 16)) 348 348 pr_debug("Slot %zi: %pU: %s: 1st: %u last: %u inv: %u", 349 349 u - c->uuids, u->uuid, u->label, 350 350 u->first_reg, u->last_reg, u->invalidated); ··· 491 491 492 492 bio->bi_end_io = prio_endio; 493 493 bio->bi_private = ca; 494 - bio_map(bio, ca->disk_buckets); 494 + bch_bio_map(bio, ca->disk_buckets); 495 495 496 496 closure_bio_submit(bio, &ca->prio, ca); 497 497 closure_sync(cl); ··· 538 538 539 539 p->next_bucket = ca->prio_buckets[i + 1]; 540 540 p->magic = pset_magic(ca); 541 - p->csum = crc64(&p->magic, bucket_bytes(ca) - 8); 541 + p->csum = bch_crc64(&p->magic, bucket_bytes(ca) - 8); 542 542 543 543 bucket = bch_bucket_alloc(ca, WATERMARK_PRIO, &cl); 544 544 BUG_ON(bucket == -1); ··· 585 585 586 586 prio_io(ca, bucket, READ_SYNC); 587 587 588 - if (p->csum != crc64(&p->magic, bucket_bytes(ca) - 8)) 588 + if (p->csum != bch_crc64(&p->magic, bucket_bytes(ca) - 8)) 589 589 pr_warn("bad csum reading priorities"); 590 590 591 591 if (p->magic != pset_magic(ca)) ··· 898 898 sysfs_remove_file(&dc->kobj, &sysfs_attach); 899 899 */ 900 900 901 - if (is_zero(u->uuid, 16)) { 901 + if (bch_is_zero(u->uuid, 16)) { 902 902 struct closure cl; 903 903 closure_init_stack(&cl); 904 904
+12 -12
drivers/md/bcache/sysfs.c
··· 105 105 #define var(stat) (dc->stat) 106 106 107 107 if (attr == &sysfs_cache_mode) 108 - return snprint_string_list(buf, PAGE_SIZE, 109 - bch_cache_modes + 1, 110 - BDEV_CACHE_MODE(&dc->sb)); 108 + return bch_snprint_string_list(buf, PAGE_SIZE, 109 + bch_cache_modes + 1, 110 + BDEV_CACHE_MODE(&dc->sb)); 111 111 112 112 sysfs_printf(data_csum, "%i", dc->disk.data_csum); 113 113 var_printf(verify, "%i"); ··· 126 126 char dirty[20]; 127 127 char derivative[20]; 128 128 char target[20]; 129 - hprint(dirty, 129 + bch_hprint(dirty, 130 130 atomic_long_read(&dc->disk.sectors_dirty) << 9); 131 - hprint(derivative, dc->writeback_rate_derivative << 9); 132 - hprint(target, dc->writeback_rate_target << 9); 131 + bch_hprint(derivative, dc->writeback_rate_derivative << 9); 132 + bch_hprint(target, dc->writeback_rate_target << 9); 133 133 134 134 return sprintf(buf, 135 135 "rate:\t\t%u\n" ··· 202 202 bch_cached_dev_run(dc); 203 203 204 204 if (attr == &sysfs_cache_mode) { 205 - ssize_t v = read_string_list(buf, bch_cache_modes + 1); 205 + ssize_t v = bch_read_string_list(buf, bch_cache_modes + 1); 206 206 207 207 if (v < 0) 208 208 return v; ··· 224 224 } 225 225 226 226 if (attr == &sysfs_attach) { 227 - if (parse_uuid(buf, dc->sb.set_uuid) < 16) 227 + if (bch_parse_uuid(buf, dc->sb.set_uuid) < 16) 228 228 return -EINVAL; 229 229 230 230 list_for_each_entry(c, &bch_cache_sets, list) { ··· 657 657 ((size_t) ca->sb.nbuckets)); 658 658 659 659 if (attr == &sysfs_cache_replacement_policy) 660 - return snprint_string_list(buf, PAGE_SIZE, 661 - cache_replacement_policies, 662 - CACHE_REPLACEMENT(&ca->sb)); 660 + return bch_snprint_string_list(buf, PAGE_SIZE, 661 + cache_replacement_policies, 662 + CACHE_REPLACEMENT(&ca->sb)); 663 663 664 664 if (attr == &sysfs_priority_stats) { 665 665 int cmp(const void *l, const void *r) ··· 747 747 } 748 748 749 749 if (attr == &sysfs_cache_replacement_policy) { 750 - ssize_t v = read_string_list(buf, cache_replacement_policies); 750 + ssize_t v = bch_read_string_list(buf, cache_replacement_policies); 751 751 752 752 if (v < 0) 753 753 return v;
+1 -1
drivers/md/bcache/sysfs.h
··· 62 62 #define sysfs_hprint(file, val) \ 63 63 do { \ 64 64 if (attr == &sysfs_ ## file) { \ 65 - ssize_t ret = hprint(buf, val); \ 65 + ssize_t ret = bch_hprint(buf, val); \ 66 66 strcat(buf, "\n"); \ 67 67 return ret + 1; \ 68 68 } \
+13 -25
drivers/md/bcache/util.c
··· 19 19 #define simple_strtouint(c, end, base) simple_strtoul(c, end, base) 20 20 21 21 #define STRTO_H(name, type) \ 22 - int name ## _h(const char *cp, type *res) \ 22 + int bch_ ## name ## _h(const char *cp, type *res) \ 23 23 { \ 24 24 int u = 0; \ 25 25 char *e; \ ··· 67 67 *res = i; \ 68 68 return 0; \ 69 69 } \ 70 - EXPORT_SYMBOL_GPL(name ## _h); 71 70 72 71 STRTO_H(strtoint, int) 73 72 STRTO_H(strtouint, unsigned int) 74 73 STRTO_H(strtoll, long long) 75 74 STRTO_H(strtoull, unsigned long long) 76 75 77 - ssize_t hprint(char *buf, int64_t v) 76 + ssize_t bch_hprint(char *buf, int64_t v) 78 77 { 79 78 static const char units[] = "?kMGTPEZY"; 80 79 char dec[3] = ""; ··· 92 93 93 94 return sprintf(buf, "%lli%s%c", v, dec, units[u]); 94 95 } 95 - EXPORT_SYMBOL_GPL(hprint); 96 96 97 - ssize_t snprint_string_list(char *buf, size_t size, const char * const list[], 97 + ssize_t bch_snprint_string_list(char *buf, size_t size, const char * const list[], 98 98 size_t selected) 99 99 { 100 100 char *out = buf; ··· 106 108 out[-1] = '\n'; 107 109 return out - buf; 108 110 } 109 - EXPORT_SYMBOL_GPL(snprint_string_list); 110 111 111 - ssize_t read_string_list(const char *buf, const char * const list[]) 112 + ssize_t bch_read_string_list(const char *buf, const char * const list[]) 112 113 { 113 114 size_t i; 114 115 char *s, *d = kstrndup(buf, PAGE_SIZE - 1, GFP_KERNEL); ··· 127 130 128 131 return i; 129 132 } 130 - EXPORT_SYMBOL_GPL(read_string_list); 131 133 132 - bool is_zero(const char *p, size_t n) 134 + bool bch_is_zero(const char *p, size_t n) 133 135 { 134 136 size_t i; 135 137 ··· 137 141 return false; 138 142 return true; 139 143 } 140 - EXPORT_SYMBOL_GPL(is_zero); 141 144 142 - int parse_uuid(const char *s, char *uuid) 145 + int bch_parse_uuid(const char *s, char *uuid) 143 146 { 144 147 size_t i, j, x; 145 148 memset(uuid, 0, 16); ··· 165 170 } 166 171 return i; 167 172 } 168 - EXPORT_SYMBOL_GPL(parse_uuid); 169 173 170 - void time_stats_update(struct time_stats *stats, uint64_t start_time) 174 + void bch_time_stats_update(struct time_stats *stats, uint64_t start_time) 171 175 { 172 176 uint64_t now = local_clock(); 173 177 uint64_t duration = time_after64(now, start_time) ··· 189 195 190 196 stats->last = now ?: 1; 191 197 } 192 - EXPORT_SYMBOL_GPL(time_stats_update); 193 198 194 - unsigned next_delay(struct ratelimit *d, uint64_t done) 199 + unsigned bch_next_delay(struct ratelimit *d, uint64_t done) 195 200 { 196 201 uint64_t now = local_clock(); 197 202 ··· 200 207 ? div_u64(d->next - now, NSEC_PER_SEC / HZ) 201 208 : 0; 202 209 } 203 - EXPORT_SYMBOL_GPL(next_delay); 204 210 205 - void bio_map(struct bio *bio, void *base) 211 + void bch_bio_map(struct bio *bio, void *base) 206 212 { 207 213 size_t size = bio->bi_size; 208 214 struct bio_vec *bv = bio->bi_io_vec; ··· 227 235 size -= bv->bv_len; 228 236 } 229 237 } 230 - EXPORT_SYMBOL_GPL(bio_map); 231 238 232 - int bio_alloc_pages(struct bio *bio, gfp_t gfp) 239 + int bch_bio_alloc_pages(struct bio *bio, gfp_t gfp) 233 240 { 234 241 int i; 235 242 struct bio_vec *bv; ··· 244 253 245 254 return 0; 246 255 } 247 - EXPORT_SYMBOL_GPL(bio_alloc_pages); 248 256 249 257 /* 250 258 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group (Any ··· 355 365 0x9AFCE626CE85B507 356 366 }; 357 367 358 - uint64_t crc64_update(uint64_t crc, const void *_data, size_t len) 368 + uint64_t bch_crc64_update(uint64_t crc, const void *_data, size_t len) 359 369 { 360 370 const unsigned char *data = _data; 361 371 ··· 366 376 367 377 return crc; 368 378 } 369 - EXPORT_SYMBOL(crc64_update); 370 379 371 - uint64_t crc64(const void *data, size_t len) 380 + uint64_t bch_crc64(const void *data, size_t len) 372 381 { 373 382 uint64_t crc = 0xffffffffffffffff; 374 383 375 - crc = crc64_update(crc, data, len); 384 + crc = bch_crc64_update(crc, data, len); 376 385 377 386 return crc ^ 0xffffffffffffffff; 378 387 } 379 - EXPORT_SYMBOL(crc64);
+27 -27
drivers/md/bcache/util.h
··· 307 307 #define ANYSINT_MAX(t) \ 308 308 ((((t) 1 << (sizeof(t) * 8 - 2)) - (t) 1) * (t) 2 + (t) 1) 309 309 310 - int strtoint_h(const char *, int *); 311 - int strtouint_h(const char *, unsigned int *); 312 - int strtoll_h(const char *, long long *); 313 - int strtoull_h(const char *, unsigned long long *); 310 + int bch_strtoint_h(const char *, int *); 311 + int bch_strtouint_h(const char *, unsigned int *); 312 + int bch_strtoll_h(const char *, long long *); 313 + int bch_strtoull_h(const char *, unsigned long long *); 314 314 315 - static inline int strtol_h(const char *cp, long *res) 315 + static inline int bch_strtol_h(const char *cp, long *res) 316 316 { 317 317 #if BITS_PER_LONG == 32 318 - return strtoint_h(cp, (int *) res); 318 + return bch_strtoint_h(cp, (int *) res); 319 319 #else 320 - return strtoll_h(cp, (long long *) res); 320 + return bch_strtoll_h(cp, (long long *) res); 321 321 #endif 322 322 } 323 323 324 - static inline int strtoul_h(const char *cp, long *res) 324 + static inline int bch_strtoul_h(const char *cp, long *res) 325 325 { 326 326 #if BITS_PER_LONG == 32 327 - return strtouint_h(cp, (unsigned int *) res); 327 + return bch_strtouint_h(cp, (unsigned int *) res); 328 328 #else 329 - return strtoull_h(cp, (unsigned long long *) res); 329 + return bch_strtoull_h(cp, (unsigned long long *) res); 330 330 #endif 331 331 } 332 332 333 333 #define strtoi_h(cp, res) \ 334 334 (__builtin_types_compatible_p(typeof(*res), int) \ 335 - ? strtoint_h(cp, (void *) res) \ 335 + ? bch_strtoint_h(cp, (void *) res) \ 336 336 : __builtin_types_compatible_p(typeof(*res), long) \ 337 - ? strtol_h(cp, (void *) res) \ 337 + ? bch_strtol_h(cp, (void *) res) \ 338 338 : __builtin_types_compatible_p(typeof(*res), long long) \ 339 - ? strtoll_h(cp, (void *) res) \ 339 + ? bch_strtoll_h(cp, (void *) res) \ 340 340 : __builtin_types_compatible_p(typeof(*res), unsigned int) \ 341 - ? strtouint_h(cp, (void *) res) \ 341 + ? bch_strtouint_h(cp, (void *) res) \ 342 342 : __builtin_types_compatible_p(typeof(*res), unsigned long) \ 343 - ? strtoul_h(cp, (void *) res) \ 343 + ? bch_strtoul_h(cp, (void *) res) \ 344 344 : __builtin_types_compatible_p(typeof(*res), unsigned long long)\ 345 - ? strtoull_h(cp, (void *) res) : -EINVAL) 345 + ? bch_strtoull_h(cp, (void *) res) : -EINVAL) 346 346 347 347 #define strtoul_safe(cp, var) \ 348 348 ({ \ ··· 379 379 __builtin_types_compatible_p(typeof(var), const char *) \ 380 380 ? "%s\n" : "%i\n", var) 381 381 382 - ssize_t hprint(char *buf, int64_t v); 382 + ssize_t bch_hprint(char *buf, int64_t v); 383 383 384 - bool is_zero(const char *p, size_t n); 385 - int parse_uuid(const char *s, char *uuid); 384 + bool bch_is_zero(const char *p, size_t n); 385 + int bch_parse_uuid(const char *s, char *uuid); 386 386 387 - ssize_t snprint_string_list(char *buf, size_t size, const char * const list[], 387 + ssize_t bch_snprint_string_list(char *buf, size_t size, const char * const list[], 388 388 size_t selected); 389 389 390 - ssize_t read_string_list(const char *buf, const char * const list[]); 390 + ssize_t bch_read_string_list(const char *buf, const char * const list[]); 391 391 392 392 struct time_stats { 393 393 /* ··· 400 400 uint64_t last; 401 401 }; 402 402 403 - void time_stats_update(struct time_stats *stats, uint64_t time); 403 + void bch_time_stats_update(struct time_stats *stats, uint64_t time); 404 404 405 405 #define NSEC_PER_ns 1L 406 406 #define NSEC_PER_us NSEC_PER_USEC ··· 462 462 d->next = local_clock(); 463 463 } 464 464 465 - unsigned next_delay(struct ratelimit *d, uint64_t done); 465 + unsigned bch_next_delay(struct ratelimit *d, uint64_t done); 466 466 467 467 #define __DIV_SAFE(n, d, zero) \ 468 468 ({ \ ··· 568 568 569 569 #define bio_end(bio) ((bio)->bi_sector + bio_sectors(bio)) 570 570 571 - void bio_map(struct bio *bio, void *base); 571 + void bch_bio_map(struct bio *bio, void *base); 572 572 573 - int bio_alloc_pages(struct bio *bio, gfp_t gfp); 573 + int bch_bio_alloc_pages(struct bio *bio, gfp_t gfp); 574 574 575 575 static inline sector_t bdev_sectors(struct block_device *bdev) 576 576 { ··· 583 583 bch_generic_make_request(bio, &(dev)->bio_split_hook); \ 584 584 } while (0) 585 585 586 - uint64_t crc64_update(uint64_t, const void *, size_t); 587 - uint64_t crc64(const void *, size_t); 586 + uint64_t bch_crc64_update(uint64_t, const void *, size_t); 587 + uint64_t bch_crc64(const void *, size_t); 588 588 589 589 #endif /* _BCACHE_UTIL_H */
+3 -3
drivers/md/bcache/writeback.c
··· 95 95 !dc->writeback_percent) 96 96 return 0; 97 97 98 - return next_delay(&dc->writeback_rate, sectors * 10000000ULL); 98 + return bch_next_delay(&dc->writeback_rate, sectors * 10000000ULL); 99 99 } 100 100 101 101 /* Background writeback */ ··· 118 118 bio->bi_max_vecs = DIV_ROUND_UP(KEY_SIZE(&w->key), PAGE_SECTORS); 119 119 bio->bi_private = w; 120 120 bio->bi_io_vec = bio->bi_inline_vecs; 121 - bio_map(bio, NULL); 121 + bch_bio_map(bio, NULL); 122 122 } 123 123 124 124 static void refill_dirty(struct closure *cl) ··· 349 349 io->bio.bi_rw = READ; 350 350 io->bio.bi_end_io = read_dirty_endio; 351 351 352 - if (bio_alloc_pages(&io->bio, GFP_KERNEL)) 352 + if (bch_bio_alloc_pages(&io->bio, GFP_KERNEL)) 353 353 goto err_free; 354 354 355 355 pr_debug("%s", pkey(&w->key));