2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2001-2002 Sistina Software (UK) Limited.
|
2009-01-06 04:05:17 +01:00
|
|
|
* Copyright (C) 2006-2008 Red Hat GmbH
|
2005-04-17 00:20:36 +02:00
|
|
|
*
|
|
|
|
* This file is released under the GPL.
|
|
|
|
*/
|
|
|
|
|
2009-01-06 04:05:15 +01:00
|
|
|
#include "dm-exception-store.h"
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/pagemap.h>
|
|
|
|
#include <linux/vmalloc.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
|
2009-01-06 04:05:17 +01:00
|
|
|
#define DM_MSG_PREFIX "snapshot exception stores"
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2009-01-06 04:05:17 +01:00
|
|
|
int dm_exception_store_init(void)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int r;
|
|
|
|
|
2009-01-06 04:05:17 +01:00
|
|
|
r = dm_transient_snapshot_init();
|
|
|
|
if (r) {
|
|
|
|
DMERR("Unable to register transient exception store type.");
|
|
|
|
goto transient_fail;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2009-01-06 04:05:17 +01:00
|
|
|
r = dm_persistent_snapshot_init();
|
|
|
|
if (r) {
|
|
|
|
DMERR("Unable to register persistent exception store type");
|
|
|
|
goto persistent_fail;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
2009-01-06 04:05:17 +01:00
|
|
|
persistent_fail:
|
|
|
|
dm_persistent_snapshot_exit();
|
|
|
|
transient_fail:
|
|
|
|
return r;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2009-01-06 04:05:17 +01:00
|
|
|
void dm_exception_store_exit(void)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2009-01-06 04:05:17 +01:00
|
|
|
dm_persistent_snapshot_exit();
|
|
|
|
dm_transient_snapshot_exit();
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|