flush.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright 2023 Red Hat
  4. */
  5. #ifndef VDO_FLUSH_H
  6. #define VDO_FLUSH_H
  7. #include "funnel-workqueue.h"
  8. #include "types.h"
  9. #include "vio.h"
  10. #include "wait-queue.h"
  11. /* A marker for tracking which journal entries are affected by a flush request. */
  12. struct vdo_flush {
  13. /* The completion for enqueueing this flush request. */
  14. struct vdo_completion completion;
  15. /* The flush bios covered by this request */
  16. struct bio_list bios;
  17. /* The wait queue entry for this flush */
  18. struct vdo_waiter waiter;
  19. /* Which flush this struct represents */
  20. sequence_number_t flush_generation;
  21. };
  22. struct flusher;
  23. int __must_check vdo_make_flusher(struct vdo *vdo);
  24. void vdo_free_flusher(struct flusher *flusher);
  25. thread_id_t __must_check vdo_get_flusher_thread_id(struct flusher *flusher);
  26. void vdo_complete_flushes(struct flusher *flusher);
  27. void vdo_dump_flusher(const struct flusher *flusher);
  28. void vdo_launch_flush(struct vdo *vdo, struct bio *bio);
  29. void vdo_drain_flusher(struct flusher *flusher, struct vdo_completion *completion);
  30. void vdo_resume_flusher(struct flusher *flusher, struct vdo_completion *parent);
  31. #endif /* VDO_FLUSH_H */