request.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. unsigned bypass:1;
  13. unsigned writeback:1;
  14. unsigned flush_journal:1;
  15. unsigned csum:1;
  16. unsigned replace:1;
  17. unsigned replace_collision:1;
  18. unsigned insert_data_done:1;
  19. /* Anything past this point won't get zeroed in search_alloc() */
  20. struct keylist insert_keys;
  21. BKEY_PADDED(replace_key);
  22. };
  23. unsigned bch_get_congested(struct cache_set *);
  24. void bch_data_insert(struct closure *cl);
  25. void bch_cached_dev_request_init(struct cached_dev *dc);
  26. void bch_flash_dev_request_init(struct bcache_device *d);
  27. extern struct kmem_cache *bch_search_cache, *bch_passthrough_cache;
  28. struct bch_cgroup {
  29. #ifdef CONFIG_CGROUP_BCACHE
  30. struct cgroup_subsys_state css;
  31. #endif
  32. /*
  33. * We subtract one from the index into bch_cache_modes[], so that
  34. * default == -1; this makes it so the rest match up with d->cache_mode,
  35. * and we use d->cache_mode if cgrp->cache_mode < 0
  36. */
  37. short cache_mode;
  38. bool verify;
  39. struct cache_stat_collector stats;
  40. };
  41. struct bch_cgroup *bch_bio_to_cgroup(struct bio *bio);
  42. #endif /* _BCACHE_REQUEST_H_ */