kcopyd.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (C) 2001 Sistina Software
  3. *
  4. * This file is released under the GPL.
  5. *
  6. * Kcopyd provides a simple interface for copying an area of one
  7. * block-device to one or more other block-devices, with an asynchronous
  8. * completion notification.
  9. */
  10. #ifndef DM_KCOPYD_H
  11. #define DM_KCOPYD_H
  12. #include "dm-io.h"
  13. /* FIXME: make this configurable */
  14. #define KCOPYD_MAX_REGIONS 8
  15. #define KCOPYD_IGNORE_ERROR 1
  16. /*
  17. * To use kcopyd you must first create a kcopyd client object.
  18. */
  19. struct kcopyd_client;
  20. int kcopyd_client_create(unsigned int num_pages, struct kcopyd_client **result);
  21. void kcopyd_client_destroy(struct kcopyd_client *kc);
  22. /*
  23. * Submit a copy job to kcopyd. This is built on top of the
  24. * previous three fns.
  25. *
  26. * read_err is a boolean,
  27. * write_err is a bitset, with 1 bit for each destination region
  28. */
  29. typedef void (*kcopyd_notify_fn)(int read_err,
  30. unsigned int write_err, void *context);
  31. int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
  32. unsigned int num_dests, struct io_region *dests,
  33. unsigned int flags, kcopyd_notify_fn fn, void *context);
  34. #endif