4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
7 * This file is part of LVM2.
9 * This copyrighted material is made available to anyone wishing to use,
10 * modify, copy, or redistribute it subject to the terms and conditions
11 * of the GNU Lesser General Public License v.2.1.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef _LVM_FORMAT_TEXT_H
19 #define _LVM_FORMAT_TEXT_H
21 #include "lvm-types.h"
24 #define FMT_TEXT_NAME "lvm2"
25 #define FMT_TEXT_ALIAS "text"
26 #define FMT_TEXT_ORPHAN_VG_NAME ORPHAN_VG_NAME(FMT_TEXT_NAME)
29 * Archives a vg config. 'retain_days' is the minimum number of
30 * days that an archive file must be held for. 'min_archives' is
31 * the minimum number of archives required to be kept for each
34 int archive_vg(struct volume_group
*vg
,
36 const char *desc
, uint32_t retain_days
, uint32_t min_archive
);
39 * Displays a list of vg backups in a particular archive directory.
41 int archive_list(struct cmd_context
*cmd
, const char *dir
, const char *vgname
);
42 int archive_list_file(struct cmd_context
*cmd
, const char *file
);
43 int backup_list(struct cmd_context
*cmd
, const char *dir
, const char *vgname
);
46 * The text format can read and write a volume_group to a file.
48 struct format_type
*create_text_format(struct cmd_context
*cmd
);
49 void *create_text_context(struct cmd_context
*cmd
, const char *path
,
52 struct labeller
*text_labeller_create(const struct format_type
*fmt
);
54 int pvhdr_read(struct device
*dev
, char *buf
);
56 int add_da(struct dm_pool
*mem
, struct dm_list
*das
,
57 uint64_t start
, uint64_t size
);
58 void del_das(struct dm_list
*das
);
60 int add_mda(const struct format_type
*fmt
, struct dm_pool
*mem
, struct dm_list
*mdas
,
61 struct device
*dev
, uint64_t start
, uint64_t size
);
62 void del_mdas(struct dm_list
*mdas
);
64 const char *vgname_from_mda(const struct format_type
*fmt
,
65 struct device_area
*dev_area
, struct id
*vgid
,
66 uint32_t *vgstatus
, char **creation_host
,
67 uint64_t *mda_free_sectors
);