request.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _BCACHE_REQUEST_H_
  2. #define _BCACHE_REQUEST_H_
  3. #include <linux/cgroup.h>
  4. struct data_insert_op {
  5. struct closure cl;
  6. struct cache_set *c;
  7. struct bio *bio;
  8. unsigned inode;
  9. uint16_t write_point;
  10. uint16_t write_prio;
  11. short error;
  12. union {
  13. uint16_t flags;
  14. struct {
  15. unsigned bypass:1;
  16. unsigned writeback:1;
  17. unsigned flush_journal:1;
  18. unsigned csum:1;
  19. unsigned replace:1;
  20. unsigned replace_collision:1;
  21. unsigned insert_data_done:1;
  22. };
  23. };
  24. struct keylist insert_keys;
  25. BKEY_PADDED(replace_key);
  26. };
  27. unsigned bch_get_congested(struct cache_set *);
  28. void bch_data_insert(struct closure *cl);
  29. void bch_cached_dev_request_init(struct cached_dev *dc);
  30. void bch_flash_dev_request_init(struct bcache_device *d);
  31. extern struct kmem_cache *bch_search_cache, *bch_passthrough_cache;
  32. struct bch_cgroup {
  33. #ifdef CONFIG_CGROUP_BCACHE
  34. struct cgroup_subsys_state css;
  35. #endif
  36. /*
  37. * We subtract one from the index into bch_cache_modes[], so that
  38. * default == -1; this makes it so the rest match up with d->cache_mode,
  39. * and we use d->cache_mode if cgrp->cache_mode < 0
  40. */
  41. short cache_mode;
  42. bool verify;
  43. struct cache_stat_collector stats;
  44. };
  45. struct bch_cgroup *bch_bio_to_cgroup(struct bio *bio);
  46. #endif /* _BCACHE_REQUEST_H_ */