2002-02-25 12:02:33 +00:00
/*
2004-03-30 19:35:44 +00:00
* Copyright ( C ) 2002 - 2004 Sistina Software , Inc . All rights reserved .
2012-01-12 01:51:56 +00:00
* Copyright ( C ) 2004 - 2012 Red Hat , Inc . All rights reserved .
2002-02-25 12:02:33 +00:00
*
2004-03-30 19:35:44 +00: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-20 20:55:30 +00:00
* of the GNU Lesser General Public License v .2 .1 .
2004-03-30 19:35:44 +00:00
*
2007-08-20 20:55:30 +00:00
* You should have received a copy of the GNU Lesser General Public License
2004-03-30 19:35:44 +00:00
* along with this program ; if not , write to the Free Software Foundation ,
2016-01-21 11:49:46 +01:00
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
2002-02-25 12:02:33 +00:00
*/
# ifndef _LVM_DEV_MANAGER_H
# define _LVM_DEV_MANAGER_H
2018-05-14 10:30:20 +01:00
# include "lib/metadata/metadata-exported.h"
2009-10-01 00:35:29 +00:00
2004-05-04 21:25:57 +00:00
struct logical_volume ;
2011-06-17 14:14:19 +00:00
struct lv_activate_opts ;
2005-10-25 19:08:21 +00:00
struct volume_group ;
2004-05-04 21:25:57 +00:00
struct cmd_context ;
2002-02-25 12:02:33 +00:00
struct dev_manager ;
2003-03-24 18:08:53 +00:00
struct dm_info ;
2005-10-25 19:08:21 +00:00
struct device ;
2014-11-04 15:00:32 +01:00
struct lv_seg_status ;
2002-02-25 12:02:33 +00:00
2018-03-08 10:27:04 +01:00
int read_only_lv ( const struct logical_volume * lv , const struct lv_activate_opts * laopts , const char * layer ) ;
2012-01-12 01:51:56 +00:00
2002-02-25 12:02:33 +00:00
/*
* Constructor and destructor .
*/
2004-05-04 21:25:57 +00:00
struct dev_manager * dev_manager_create ( struct cmd_context * cmd ,
2011-06-11 00:03:06 +00:00
const char * vg_name ,
unsigned track_pvmove_deps ) ;
2002-02-25 12:02:33 +00:00
void dev_manager_destroy ( struct dev_manager * dm ) ;
2006-05-16 16:48:31 +00:00
void dev_manager_release ( void ) ;
2003-07-04 22:34:56 +00:00
void dev_manager_exit ( void ) ;
2002-02-25 12:02:33 +00: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 . )
*/
2016-04-08 16:27:12 +01:00
int dev_manager_info ( struct cmd_context * cmd , const struct logical_volume * lv ,
2010-08-17 16:25:32 +00:00
const char * layer ,
2010-02-24 20:00:56 +00:00
int with_open_count , int with_read_ahead ,
2014-11-04 15:00:32 +01:00
struct dm_info * dminfo , uint32_t * read_ahead ,
struct lv_seg_status * seg_status ) ;
2016-04-08 16:27:12 +01:00
2002-05-22 14:03:45 +00:00
int dev_manager_snapshot_percent ( struct dev_manager * dm ,
2006-04-06 14:06:27 +00:00
const struct logical_volume * lv ,
2014-06-09 12:08:27 +02:00
dm_percent_t * percent ) ;
2003-04-30 15:26:25 +00:00
int dev_manager_mirror_percent ( struct dev_manager * dm ,
2010-01-15 22:58:25 +00:00
const struct logical_volume * lv , int wait ,
2014-06-09 12:08:27 +02:00
dm_percent_t * percent , uint32_t * event_nr ) ;
2013-02-01 11:31:47 -06:00
int dev_manager_raid_status ( struct dev_manager * dm ,
const struct logical_volume * lv ,
struct dm_status_raid * * status ) ;
2013-04-11 15:33:59 -05:00
int dev_manager_raid_message ( struct dev_manager * dm ,
const struct logical_volume * lv ,
const char * msg ) ;
2018-08-27 14:53:09 -05:00
int dev_manager_writecache_message ( struct dev_manager * dm ,
const struct logical_volume * lv ,
const char * msg ) ;
2014-01-28 12:24:51 -06:00
int dev_manager_cache_status ( struct dev_manager * dm ,
const struct logical_volume * lv ,
2014-11-03 12:52:29 +01:00
struct lv_status_cache * * status ) ;
2012-01-25 08:48:42 +00:00
int dev_manager_thin_pool_status ( struct dev_manager * dm ,
const struct logical_volume * lv ,
2013-01-17 10:54:41 +01:00
struct dm_status_thin_pool * * status ,
2016-05-27 13:45:47 +02:00
int flush ) ;
2011-12-21 13:09:33 +00:00
int dev_manager_thin_pool_percent ( struct dev_manager * dm ,
const struct logical_volume * lv ,
2014-06-09 12:08:27 +02:00
int metadata , dm_percent_t * percent ) ;
2012-01-19 15:27:54 +00:00
int dev_manager_thin_percent ( struct dev_manager * dm ,
const struct logical_volume * lv ,
2014-06-09 12:08:27 +02:00
int mapped , dm_percent_t * percent ) ;
2013-12-04 13:57:27 +01:00
int dev_manager_thin_device_id ( struct dev_manager * dm ,
const struct logical_volume * lv ,
uint32_t * device_id ) ;
2018-06-29 11:15:54 +02:00
int dev_manager_vdo_pool_status ( struct dev_manager * dm ,
const struct logical_volume * lv ,
2019-01-21 00:48:05 +01:00
struct lv_status_vdo * * vdo_status ,
int flush ) ;
2014-09-22 15:50:07 +02:00
int dev_manager_suspend ( struct dev_manager * dm , const struct logical_volume * lv ,
2011-06-17 14:14:19 +00:00
struct lv_activate_opts * laopts , int lockfs , int flush_required ) ;
2014-09-22 15:50:07 +02:00
int dev_manager_activate ( struct dev_manager * dm , const struct logical_volume * lv ,
2011-06-17 14:14:19 +00:00
struct lv_activate_opts * laopts ) ;
2014-09-22 15:50:07 +02:00
int dev_manager_preload ( struct dev_manager * dm , const struct logical_volume * lv ,
2011-06-17 14:14:19 +00:00
struct lv_activate_opts * laopts , int * flush_required ) ;
2014-09-22 15:50:07 +02:00
int dev_manager_deactivate ( struct dev_manager * dm , const struct logical_volume * lv ) ;
int dev_manager_transient ( struct dev_manager * dm , const struct logical_volume * lv ) __attribute__ ( ( nonnull ( 1 , 2 ) ) ) ;
2002-02-25 12:02:33 +00:00
2010-02-24 20:00:56 +00:00
int dev_manager_mknodes ( const struct logical_volume * lv ) ;
2003-11-12 19:16:48 +00:00
2002-02-25 12:02:33 +00:00
/*
* Put the desired changes into effect .
*/
int dev_manager_execute ( struct dev_manager * dm ) ;
2006-05-11 17:58:58 +00:00
int dev_manager_device_uses_vg ( struct device * dev ,
2005-10-25 19:08:21 +00:00
struct volume_group * vg ) ;
2018-08-17 15:45:52 -05:00
int dev_manager_remove_dm_major_minor ( uint32_t major , uint32_t minor ) ;
2019-03-13 12:59:59 +01:00
int dev_manager_check_prefix_dm_major_minor ( uint32_t major , uint32_t minor , const char * prefix ) ;
2019-01-30 09:55:34 -06:00
int get_cache_vol_meta_data ( struct cmd_context * cmd ,
2018-08-17 15:45:52 -05:00
struct logical_volume * lv ,
struct logical_volume * pool_lv ,
struct dm_info * info_meta , struct dm_info * info_data ) ;
2019-01-30 09:55:34 -06:00
int remove_cache_vol_meta_data ( struct cmd_context * cmd ,
2018-08-17 15:45:52 -05:00
struct dm_info * info_meta , struct dm_info * info_data ) ;
2002-02-25 12:02:33 +00:00
# endif