request.h 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _BCACHE_REQUEST_H_
  3. #define _BCACHE_REQUEST_H_
  4. struct data_insert_op {
  5. struct closure cl;
  6. struct cache_set *c;
  7. struct bio *bio;
  8. struct workqueue_struct *wq;
  9. unsigned int inode;
  10. uint16_t write_point;
  11. uint16_t write_prio;
  12. blk_status_t status;
  13. union {
  14. uint16_t flags;
  15. struct {
  16. unsigned int bypass:1;
  17. unsigned int writeback:1;
  18. unsigned int flush_journal:1;
  19. unsigned int csum:1;
  20. unsigned int replace:1;
  21. unsigned int replace_collision:1;
  22. unsigned int insert_data_done:1;
  23. };
  24. };
  25. struct keylist insert_keys;
  26. BKEY_PADDED(replace_key);
  27. };
  28. unsigned int bch_get_congested(const struct cache_set *c);
  29. void bch_data_insert(struct closure *cl);
  30. void bch_cached_dev_request_init(struct cached_dev *dc);
  31. blk_qc_t cached_dev_submit_bio(struct bio *bio);
  32. void bch_flash_dev_request_init(struct bcache_device *d);
  33. blk_qc_t flash_dev_submit_bio(struct bio *bio);
  34. extern struct kmem_cache *bch_search_cache;
  35. #endif /* _BCACHE_REQUEST_H_ */