2010-09-30 13:16:55 +00:00
/*
2010-09-30 20:47:18 +00:00
* Copyright ( C ) 2001 - 2004 Sistina Software , Inc . All rights reserved .
2013-04-29 14:04:38 +02:00
* Copyright ( C ) 2004 - 2012 Red Hat , Inc . All rights reserved .
2010-09-30 13:16:55 +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
* of the GNU Lesser General Public License v .2 .1 .
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
*/
2010-10-25 12:01:59 +00:00
# ifndef _LVM_LV_H
# define _LVM_LV_H
2010-09-30 13:16:55 +00:00
2012-01-25 23:26:33 +01:00
# include "vg.h"
2010-09-30 13:16:55 +00:00
union lvid ;
struct lv_segment ;
struct replicator_device ;
2013-04-29 14:04:38 +02:00
enum activation_change ;
2010-09-30 13:16:55 +00:00
struct logical_volume {
union lvid lvid ;
2011-02-18 14:47:28 +00:00
const char * name ;
2010-09-30 13:16:55 +00:00
struct volume_group * vg ;
uint64_t status ;
alloc_policy_t alloc ;
2013-06-25 12:28:36 +02:00
struct profile * profile ;
2010-09-30 13:16:55 +00:00
uint32_t read_ahead ;
int32_t major ;
int32_t minor ;
uint64_t size ; /* Sectors */
uint32_t le_count ;
uint32_t origin_count ;
2013-02-21 10:25:44 +01:00
uint32_t external_count ;
2010-09-30 13:16:55 +00:00
struct dm_list snapshot_segs ;
struct lv_segment * snapshot ;
struct replicator_device * rdevice ; /* For replicator-devs, rimages, slogs - reference to rdevice */
struct dm_list rsites ; /* For replicators - all sites */
struct dm_list segments ;
struct dm_list tags ;
struct dm_list segs_using_this_lv ;
2012-01-19 15:31:45 +00:00
uint64_t timestamp ;
const char * hostname ;
2010-09-30 13:16:55 +00:00
} ;
2015-01-20 13:14:16 +01:00
struct lv_with_info_and_seg_status ;
2010-09-30 13:16:55 +00:00
uint64_t lv_size ( const struct logical_volume * lv ) ;
2012-01-19 15:34:32 +00:00
uint64_t lv_metadata_size ( const struct logical_volume * lv ) ;
2015-01-20 13:14:16 +01:00
char * lv_attr_dup_with_info_and_seg_status ( struct dm_pool * mem , const struct lv_with_info_and_seg_status * lvdm ) ;
2010-09-30 13:52:55 +00:00
char * lv_attr_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-09-30 14:07:47 +00:00
char * lv_uuid_dup ( const struct logical_volume * lv ) ;
2010-09-30 14:08:19 +00:00
char * lv_tags_dup ( const struct logical_volume * lv ) ;
2010-10-12 16:11:34 +00:00
char * lv_path_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2014-07-02 17:24:05 +01:00
char * lv_dmpath_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-10-12 16:11:48 +00:00
uint64_t lv_origin_size ( const struct logical_volume * lv ) ;
2010-10-12 16:12:02 +00:00
char * lv_move_pv_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-10-12 16:12:18 +00:00
char * lv_convert_lv_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-10-12 16:12:33 +00:00
int lv_kernel_major ( const struct logical_volume * lv ) ;
int lv_kernel_minor ( const struct logical_volume * lv ) ;
2010-10-12 16:12:50 +00:00
char * lv_mirror_log_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2012-01-19 15:34:32 +00:00
char * lv_data_lv_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
char * lv_metadata_lv_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2011-09-09 00:54:49 +00:00
char * lv_pool_lv_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-10-12 16:13:06 +00:00
char * lv_modules_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-10-21 14:49:10 +00:00
char * lv_name_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2014-07-02 17:24:05 +01:00
char * lv_fullname_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2014-07-04 01:13:51 +01:00
struct logical_volume * lv_parent ( const struct logical_volume * lv ) ;
2014-07-03 23:49:34 +01:00
char * lv_parent_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-10-21 14:49:20 +00:00
char * lv_origin_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2010-10-21 14:49:31 +00:00
uint32_t lv_kernel_read_ahead ( const struct logical_volume * lv ) ;
2014-10-20 18:40:39 +02:00
const char * lvseg_name ( const struct lv_segment * seg ) ;
2010-11-17 20:08:14 +00:00
uint64_t lvseg_start ( const struct lv_segment * seg ) ;
uint64_t lvseg_size ( const struct lv_segment * seg ) ;
uint64_t lvseg_chunksize ( const struct lv_segment * seg ) ;
2011-03-05 12:14:00 +00:00
char * lvseg_segtype_dup ( struct dm_pool * mem , const struct lv_segment * seg ) ;
2012-11-27 11:02:49 +01:00
char * lvseg_discards_dup ( struct dm_pool * mem , const struct lv_segment * seg ) ;
2014-10-01 16:06:01 -05:00
char * lvseg_cachemode_dup ( struct dm_pool * mem , const struct lv_segment * seg ) ;
2013-04-25 12:07:57 +02:00
char * lvseg_monitor_dup ( struct dm_pool * mem , const struct lv_segment * seg ) ;
2010-11-17 20:08:14 +00:00
char * lvseg_tags_dup ( const struct lv_segment * seg ) ;
2011-04-12 12:24:29 +00:00
char * lvseg_devices ( struct dm_pool * mem , const struct lv_segment * seg ) ;
char * lvseg_seg_pe_ranges ( struct dm_pool * mem , const struct lv_segment * seg ) ;
2012-01-19 15:31:45 +00:00
char * lv_time_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
char * lv_host_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
int lv_set_creation ( struct logical_volume * lv ,
const char * hostname , uint64_t timestamp ) ;
2013-02-01 11:09:34 +01:00
const char * lv_layer ( const struct logical_volume * lv ) ;
2013-04-29 14:04:38 +02:00
int lv_active_change ( struct cmd_context * cmd , struct logical_volume * lv ,
2014-11-05 15:14:58 +01:00
enum activation_change activate , int needs_exlusive ) ;
2013-04-25 12:12:05 +02:00
char * lv_active_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2013-05-02 18:06:50 +02:00
const struct logical_volume * lv_lock_holder ( const struct logical_volume * lv ) ;
2014-09-22 15:50:07 +02:00
const struct logical_volume * lv_ondisk ( const struct logical_volume * lv ) ;
2013-06-27 11:17:16 +02:00
struct profile * lv_config_profile ( const struct logical_volume * lv ) ;
2013-07-02 14:34:52 +02:00
char * lv_profile_dup ( struct dm_pool * mem , const struct logical_volume * lv ) ;
2014-07-01 09:56:03 +02:00
int lv_mirror_image_in_sync ( const struct logical_volume * lv ) ;
int lv_raid_image_in_sync ( const struct logical_volume * lv ) ;
int lv_raid_healthy ( const struct logical_volume * lv ) ;
2010-10-25 12:01:59 +00:00
# endif /* _LVM_LV_H */