2002-02-25 15:02:33 +03:00
/*
2004-03-30 23:35:44 +04:00
* Copyright ( C ) 2002 - 2004 Sistina Software , Inc . All rights reserved .
2007-08-21 00:55:30 +04:00
* Copyright ( C ) 2004 - 2006 Red Hat , Inc . All rights reserved .
2002-02-25 15:02:33 +03:00
*
2004-03-30 23:35:44 +04:00
* This file is part of LVM2 .
*
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
2007-08-21 00:55:30 +04:00
* of the GNU Lesser General Public License v .2 .1 .
2004-03-30 23:35:44 +04:00
*
2007-08-21 00:55:30 +04:00
* You should have received a copy of the GNU Lesser General Public License
2004-03-30 23:35:44 +04:00
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
2002-02-25 15:02:33 +03:00
*/
# ifndef _LVM_DEV_MANAGER_H
# define _LVM_DEV_MANAGER_H
2009-10-01 04:35:29 +04:00
# include "metadata-exported.h"
2004-05-05 01:25:57 +04:00
struct logical_volume ;
2005-10-25 23:08:21 +04:00
struct volume_group ;
2004-05-05 01:25:57 +04:00
struct cmd_context ;
2002-02-25 15:02:33 +03:00
struct dev_manager ;
2003-03-24 21:08:53 +03:00
struct dm_info ;
2005-10-25 23:08:21 +04:00
struct device ;
2002-02-25 15:02:33 +03:00
/*
* Constructor and destructor .
*/
2004-05-05 01:25:57 +04:00
struct dev_manager * dev_manager_create ( struct cmd_context * cmd ,
const char * vg_name ) ;
2002-02-25 15:02:33 +03:00
void dev_manager_destroy ( struct dev_manager * dm ) ;
2006-05-16 20:48:31 +04:00
void dev_manager_release ( void ) ;
2003-07-05 02:34:56 +04:00
void dev_manager_exit ( void ) ;
2002-02-25 15:02:33 +03:00
/*
* The device handler is responsible for creating all the layered
* dm devices , and ensuring that all constraints are maintained
* ( eg , an origin is created before its snapshot , but is not
* unsuspended until the snapshot is also created . )
*/
2005-10-19 17:59:18 +04:00
int dev_manager_info ( struct dm_pool * mem , const char * name ,
const struct logical_volume * lv ,
2007-11-12 23:51:54 +03:00
int mknodes , int with_open_count , int with_read_ahead ,
struct dm_info * info , uint32_t * read_ahead ) ;
2002-05-22 18:03:45 +04:00
int dev_manager_snapshot_percent ( struct dev_manager * dm ,
2006-04-06 18:06:27 +04:00
const struct logical_volume * lv ,
2009-10-01 04:35:29 +04:00
float * percent ,
percent_range_t * percent_range ) ;
2003-04-30 19:26:25 +04:00
int dev_manager_mirror_percent ( struct dev_manager * dm ,
struct logical_volume * lv , int wait ,
2009-10-01 04:35:29 +04:00
float * percent , percent_range_t * percent_range ,
uint32_t * event_nr ) ;
2006-08-09 01:20:00 +04:00
int dev_manager_suspend ( struct dev_manager * dm , struct logical_volume * lv ,
2009-05-20 13:52:37 +04:00
int lockfs , int flush_required ) ;
2002-02-25 15:02:33 +03:00
int dev_manager_activate ( struct dev_manager * dm , struct logical_volume * lv ) ;
2009-05-20 13:52:37 +04:00
int dev_manager_preload ( struct dev_manager * dm , struct logical_volume * lv ,
int * flush_required ) ;
2002-02-25 15:02:33 +03:00
int dev_manager_deactivate ( struct dev_manager * dm , struct logical_volume * lv ) ;
2004-03-30 18:38:57 +04:00
int dev_manager_lv_mknodes ( const struct logical_volume * lv ) ;
int dev_manager_lv_rmnodes ( const struct logical_volume * lv ) ;
2003-11-12 22:16:48 +03:00
2002-02-25 15:02:33 +03:00
/*
* Put the desired changes into effect .
*/
int dev_manager_execute ( struct dev_manager * dm ) ;
2006-05-11 21:58:58 +04:00
int dev_manager_device_uses_vg ( struct device * dev ,
2005-10-25 23:08:21 +04:00
struct volume_group * vg ) ;
2002-02-25 15:02:33 +03:00
# endif