dm-exception-store.c 844 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define DM_MSG_PREFIX "snapshot exception stores"
  13. int dm_exception_store_init(void)
  14. {
  15. int r;
  16. r = dm_transient_snapshot_init();
  17. if (r) {
  18. DMERR("Unable to register transient exception store type.");
  19. goto transient_fail;
  20. }
  21. r = dm_persistent_snapshot_init();
  22. if (r) {
  23. DMERR("Unable to register persistent exception store type");
  24. goto persistent_fail;
  25. }
  26. return 0;
  27. persistent_fail:
  28. dm_persistent_snapshot_exit();
  29. transient_fail:
  30. return r;
  31. }
  32. void dm_exception_store_exit(void)
  33. {
  34. dm_persistent_snapshot_exit();
  35. dm_transient_snapshot_exit();
  36. }