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