2
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
5
* This file is part of LVM2.
7
* This copyrighted material is made available to anyone wishing to use,
8
* modify, copy, or redistribute it subject to the terms and conditions
9
* of the GNU General Public License v.2.
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software Foundation,
13
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
struct segtype_handler;
29
#define SEG_CAN_SPLIT 0x00000001
30
#define SEG_AREAS_STRIPED 0x00000002
31
#define SEG_AREAS_MIRRORED 0x00000004
32
#define SEG_SNAPSHOT 0x00000008
33
#define SEG_FORMAT1_SUPPORT 0x00000010
34
#define SEG_VIRTUAL 0x00000020
38
struct cmd_context *cmd;
40
struct segtype_handler *ops;
46
struct segtype_handler {
47
const char *(*name) (const struct lv_segment * seg);
48
void (*display) (const struct lv_segment * seg);
49
int (*text_export) (const struct lv_segment * seg,
50
struct formatter * f);
51
int (*text_import_area_count) (struct config_node * sn,
52
uint32_t *area_count);
53
int (*text_import) (struct lv_segment * seg,
54
const struct config_node * sn,
55
struct hash_table * pv_hash);
56
int (*merge_segments) (struct lv_segment * seg1,
57
struct lv_segment * seg2);
58
int (*compose_target_line) (struct dev_manager * dm, struct pool * mem,
59
struct config_tree * cft,
61
struct lv_segment * seg, char *params,
62
size_t paramsize, const char **target,
63
int *pos, uint32_t *pvmove_mirror_count);
64
int (*target_percent) (void **target_state, struct pool * mem,
65
struct config_tree * cft,
66
struct lv_segment * seg, char *params,
67
uint64_t *total_numerator,
68
uint64_t *total_denominator, float *percent);
69
int (*target_present) (void);
70
void (*destroy) (const struct segment_type * segtype);
73
struct segment_type *get_segtype_from_string(struct cmd_context *cmd,
76
struct segment_type *init_striped_segtype(struct cmd_context *cmd);
77
struct segment_type *init_zero_segtype(struct cmd_context *cmd);
78
struct segment_type *init_error_segtype(struct cmd_context *cmd);
80
#ifdef SNAPSHOT_INTERNAL
81
struct segment_type *init_snapshot_segtype(struct cmd_context *cmd);
84
#ifdef MIRRORED_INTERNAL
85
struct segment_type *init_mirrored_segtype(struct cmd_context *cmd);
89
struct segment_type *init_crypt_segtype(struct cmd_context *cmd);