dm-exception-store.c 844 字节
Newer Older
L
Linus Torvalds 已提交
1 2
/*
 * Copyright (C) 2001-2002 Sistina Software (UK) Limited.
3
 * Copyright (C) 2006-2008 Red Hat GmbH
L
Linus Torvalds 已提交
4 5 6 7
 *
 * This file is released under the GPL.
 */

8
#include "dm-exception-store.h"
L
Linus Torvalds 已提交
9 10 11 12 13 14

#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>

15
#define DM_MSG_PREFIX "snapshot exception stores"
L
Linus Torvalds 已提交
16

17
int dm_exception_store_init(void)
L
Linus Torvalds 已提交
18 19 20
{
	int r;

21 22 23 24
	r = dm_transient_snapshot_init();
	if (r) {
		DMERR("Unable to register transient exception store type.");
		goto transient_fail;
L
Linus Torvalds 已提交
25 26
	}

27 28 29 30
	r = dm_persistent_snapshot_init();
	if (r) {
		DMERR("Unable to register persistent exception store type");
		goto persistent_fail;
L
Linus Torvalds 已提交
31 32 33 34
	}

	return 0;

35 36 37 38
persistent_fail:
	dm_persistent_snapshot_exit();
transient_fail:
	return r;
L
Linus Torvalds 已提交
39 40
}

41
void dm_exception_store_exit(void)
L
Linus Torvalds 已提交
42
{
43 44
	dm_persistent_snapshot_exit();
	dm_transient_snapshot_exit();
L
Linus Torvalds 已提交
45
}