2002-02-11 18:48:34 +03:00
/*
* Copyright ( C ) 2002 Sistina Software ( UK ) Limited .
*
* This file is released under the LGPL .
*/
# ifndef _LVM_LL_ACTIVATE_H
# define _LVM_LL_ACTIVATE_H
# include "metadata.h"
# include <libdevmapper.h>
/*
* Prepares a new dm_task .
*/
struct dm_task * setup_dm_task ( const char * name , int task ) ;
/*
* Query functions . ' name ' is the device node name in the
* device - mapper dir .
*/
int device_info ( const char * name , struct dm_info * info ) ;
int device_active ( const char * name ) ;
int device_suspended ( const char * name ) ;
int device_open_count ( const char * name ) ;
/*
* Functions to manipulate an already active device .
*/
int device_deactivate ( const char * name ) ;
int device_suspend ( const char * name ) ;
int device_resume ( const char * name ) ;
/*
2002-02-12 14:15:45 +03:00
* The next three functions populate a dm_task with a suitable
* set of targets .
2002-02-11 18:48:34 +03:00
*/
2002-02-12 14:15:45 +03:00
/*
* Creates a device with a mapping table as specified by the lv .
*/
int device_populate_lv ( struct dm_task * dmt , struct logical_volume * lv ) ;
2002-02-11 18:48:34 +03:00
/*
* Layers the origin device above an already active ' real '
* device .
*/
2002-02-12 14:15:45 +03:00
int device_populate_origin ( struct dm_task * dmt , struct logical_volume * lv ,
const char * real ) ;
2002-02-11 18:48:34 +03:00
/*
* Creates a snapshot device for a given origin and exception
* storage area .
*/
2002-02-12 14:15:45 +03:00
int device_populate_snapshot ( struct dm_task * dmt , struct logical_volume * lv ,
const char * origin , const char * cow_device ) ;
2002-02-11 18:48:34 +03:00
# endif