dm-exception-store.c 877 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2001-2002 Sistina Software (UK) Limited.
  3. * Copyright (C) 2006-2008 Red Hat GmbH
  4. *
  5. * This file is released under the GPL.
  6. */
  7. #include "dm-exception-store.h"
  8. #include <linux/mm.h>
  9. #include <linux/pagemap.h>
  10. #include <linux/vmalloc.h>
  11. #include <linux/slab.h>
  12. #include <linux/device-mapper.h>
  13. #define DM_MSG_PREFIX "snapshot exception stores"
  14. int dm_exception_store_init(void)
  15. {
  16. int r;
  17. r = dm_transient_snapshot_init();
  18. if (r) {
  19. DMERR("Unable to register transient exception store type.");
  20. goto transient_fail;
  21. }
  22. r = dm_persistent_snapshot_init();
  23. if (r) {
  24. DMERR("Unable to register persistent exception store type");
  25. goto persistent_fail;
  26. }
  27. return 0;
  28. persistent_fail:
  29. dm_persistent_snapshot_exit();
  30. transient_fail:
  31. return r;
  32. }
  33. void dm_exception_store_exit(void)
  34. {
  35. dm_persistent_snapshot_exit();
  36. dm_transient_snapshot_exit();
  37. }