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