2001-10-09 20:05:34 +04:00
/*
* Copyright ( C ) 2001 Sistina Software ( UK ) Limited .
*
2002-02-11 18:48:34 +03:00
* This file is released under the LGPL .
2001-10-09 20:05:34 +04:00
*/
2001-10-16 20:25:28 +04:00
# ifndef LVM_ACTIVATE_H
# define LVM_ACTIVATE_H
2001-10-09 20:05:34 +04:00
2002-11-18 17:01:16 +03:00
# include "metadata.h"
2003-01-09 01:44:07 +03:00
# ifdef DEVMAPPER_SUPPORT
2003-04-15 17:20:16 +04:00
# include <libdevmapper.h>
2003-01-09 01:44:07 +03:00
# endif
struct lvinfo {
int exists ;
int suspended ;
unsigned int open_count ;
int major ;
int minor ;
int read_only ;
} ;
2001-11-21 22:32:35 +03:00
2002-11-18 17:01:16 +03:00
void set_activation ( int activation ) ;
2002-12-20 02:25:55 +03:00
int activation ( void ) ;
2002-11-18 17:01:16 +03:00
2002-01-17 19:39:24 +03:00
int driver_version ( char * version , size_t size ) ;
int library_version ( char * version , size_t size ) ;
2003-04-25 02:09:13 +04:00
int lv_suspend_if_active ( struct cmd_context * cmd , const char * lvid_s ) ;
int lv_resume_if_active ( struct cmd_context * cmd , const char * lvid_s ) ;
int lv_activate ( struct cmd_context * cmd , const char * lvid_s ) ;
int lv_deactivate ( struct cmd_context * cmd , const char * lvid_s ) ;
2002-02-11 20:42:02 +03:00
/*
* Returns 1 if info structure has been populated , else 0.
*/
2003-01-09 01:44:07 +03:00
int lv_info ( const struct logical_volume * lv , struct lvinfo * info ) ;
2002-05-10 01:17:57 +04:00
/*
* Returns 1 if percent has been set , else 0.
*/
2002-05-22 18:03:45 +04:00
int lv_snapshot_percent ( struct logical_volume * lv , float * percent ) ;
2003-04-30 19:26:25 +04:00
int lv_mirror_percent ( struct logical_volume * lv , int wait , float * percent ,
uint32_t * event_nr ) ;
2001-11-07 18:02:07 +03:00
2001-11-07 14:51:42 +03:00
/*
2002-02-11 18:48:34 +03:00
* Return number of LVs in the VG that are active .
2001-11-07 14:51:42 +03:00
*/
2001-10-16 20:25:28 +04:00
int lvs_in_vg_activated ( struct volume_group * vg ) ;
2001-11-07 18:02:07 +03:00
int lvs_in_vg_opened ( struct volume_group * vg ) ;
2001-10-16 20:25:28 +04:00
2002-02-26 19:08:22 +03:00
int lv_setup_cow_store ( struct logical_volume * lv ) ;
2001-10-09 20:05:34 +04:00
# endif