diff options
Diffstat (limited to 'drivers/md/bcache/util.h')
-rw-r--r-- | drivers/md/bcache/util.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h index 56705fdcc149..577393e38c3a 100644 --- a/drivers/md/bcache/util.h +++ b/drivers/md/bcache/util.h | |||
@@ -307,42 +307,42 @@ do { \ | |||
307 | #define ANYSINT_MAX(t) \ | 307 | #define ANYSINT_MAX(t) \ |
308 | ((((t) 1 << (sizeof(t) * 8 - 2)) - (t) 1) * (t) 2 + (t) 1) | 308 | ((((t) 1 << (sizeof(t) * 8 - 2)) - (t) 1) * (t) 2 + (t) 1) |
309 | 309 | ||
310 | int strtoint_h(const char *, int *); | 310 | int bch_strtoint_h(const char *, int *); |
311 | int strtouint_h(const char *, unsigned int *); | 311 | int bch_strtouint_h(const char *, unsigned int *); |
312 | int strtoll_h(const char *, long long *); | 312 | int bch_strtoll_h(const char *, long long *); |
313 | int strtoull_h(const char *, unsigned 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 | #if BITS_PER_LONG == 32 | 317 | #if BITS_PER_LONG == 32 |
318 | return strtoint_h(cp, (int *) res); | 318 | return bch_strtoint_h(cp, (int *) res); |
319 | #else | 319 | #else |
320 | return strtoll_h(cp, (long long *) res); | 320 | return bch_strtoll_h(cp, (long long *) res); |
321 | #endif | 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 | #if BITS_PER_LONG == 32 | 326 | #if BITS_PER_LONG == 32 |
327 | return strtouint_h(cp, (unsigned int *) res); | 327 | return bch_strtouint_h(cp, (unsigned int *) res); |
328 | #else | 328 | #else |
329 | return strtoull_h(cp, (unsigned long long *) res); | 329 | return bch_strtoull_h(cp, (unsigned long long *) res); |
330 | #endif | 330 | #endif |
331 | } | 331 | } |
332 | 332 | ||
333 | #define strtoi_h(cp, res) \ | 333 | #define strtoi_h(cp, res) \ |
334 | (__builtin_types_compatible_p(typeof(*res), int) \ | 334 | (__builtin_types_compatible_p(typeof(*res), int) \ |
335 | ? strtoint_h(cp, (void *) res) \ | 335 | ? bch_strtoint_h(cp, (void *) res) \ |
336 | : __builtin_types_compatible_p(typeof(*res), long) \ | 336 | : __builtin_types_compatible_p(typeof(*res), long) \ |
337 | ? strtol_h(cp, (void *) res) \ | 337 | ? bch_strtol_h(cp, (void *) res) \ |
338 | : __builtin_types_compatible_p(typeof(*res), long long) \ | 338 | : __builtin_types_compatible_p(typeof(*res), long long) \ |
339 | ? strtoll_h(cp, (void *) res) \ | 339 | ? bch_strtoll_h(cp, (void *) res) \ |
340 | : __builtin_types_compatible_p(typeof(*res), unsigned int) \ | 340 | : __builtin_types_compatible_p(typeof(*res), unsigned int) \ |
341 | ? strtouint_h(cp, (void *) res) \ | 341 | ? bch_strtouint_h(cp, (void *) res) \ |
342 | : __builtin_types_compatible_p(typeof(*res), unsigned long) \ | 342 | : __builtin_types_compatible_p(typeof(*res), unsigned long) \ |
343 | ? strtoul_h(cp, (void *) res) \ | 343 | ? bch_strtoul_h(cp, (void *) res) \ |
344 | : __builtin_types_compatible_p(typeof(*res), unsigned long long)\ | 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 | #define strtoul_safe(cp, var) \ | 347 | #define strtoul_safe(cp, var) \ |
348 | ({ \ | 348 | ({ \ |
@@ -379,15 +379,15 @@ static inline int strtoul_h(const char *cp, long *res) | |||
379 | __builtin_types_compatible_p(typeof(var), const char *) \ | 379 | __builtin_types_compatible_p(typeof(var), const char *) \ |
380 | ? "%s\n" : "%i\n", var) | 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); | 384 | bool bch_is_zero(const char *p, size_t n); |
385 | int parse_uuid(const char *s, char *uuid); | 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 | size_t selected); | 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 | struct time_stats { | 392 | struct time_stats { |
393 | /* | 393 | /* |
@@ -400,7 +400,7 @@ struct time_stats { | |||
400 | uint64_t last; | 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 | #define NSEC_PER_ns 1L | 405 | #define NSEC_PER_ns 1L |
406 | #define NSEC_PER_us NSEC_PER_USEC | 406 | #define NSEC_PER_us NSEC_PER_USEC |
@@ -462,7 +462,7 @@ static inline void ratelimit_reset(struct ratelimit *d) | |||
462 | d->next = local_clock(); | 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 | #define __DIV_SAFE(n, d, zero) \ | 467 | #define __DIV_SAFE(n, d, zero) \ |
468 | ({ \ | 468 | ({ \ |
@@ -568,9 +568,9 @@ static inline unsigned fract_exp_two(unsigned x, unsigned fract_bits) | |||
568 | 568 | ||
569 | #define bio_end(bio) ((bio)->bi_sector + bio_sectors(bio)) | 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 | static inline sector_t bdev_sectors(struct block_device *bdev) | 575 | static inline sector_t bdev_sectors(struct block_device *bdev) |
576 | { | 576 | { |
@@ -583,7 +583,7 @@ do { \ | |||
583 | bch_generic_make_request(bio, &(dev)->bio_split_hook); \ | 583 | bch_generic_make_request(bio, &(dev)->bio_split_hook); \ |
584 | } while (0) | 584 | } while (0) |
585 | 585 | ||
586 | uint64_t crc64_update(uint64_t, const void *, size_t); | 586 | uint64_t bch_crc64_update(uint64_t, const void *, size_t); |
587 | uint64_t crc64(const void *, size_t); | 587 | uint64_t bch_crc64(const void *, size_t); |
588 | 588 | ||
589 | #endif /* _BCACHE_UTIL_H */ | 589 | #endif /* _BCACHE_UTIL_H */ |