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
16
#ifndef _LVM_TOOLLIB_H
17
#define _LVM_TOOLLIB_H
22
int autobackup_set(void);
23
int autobackup_init(const char *backup_dir, int keep_days, int keep_number,
25
int autobackup(struct volume_group *vg);
27
struct volume_group *recover_vg(struct cmd_context *cmd, const char *vgname,
30
int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
31
int lock_type, int consistent, void *handle,
32
int (*process_single) (struct cmd_context * cmd,
34
struct volume_group * vg,
35
int consistent, void *handle));
37
int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
38
struct volume_group *vg, void *handle,
39
int (*process_single) (struct cmd_context * cmd,
40
struct volume_group * vg,
41
struct physical_volume * pv,
44
int process_each_lv(struct cmd_context *cmd, int argc, char **argv,
45
int lock_type, void *handle,
46
int (*process_single) (struct cmd_context * cmd,
47
struct logical_volume * lv,
50
int process_each_segment_in_lv(struct cmd_context *cmd,
51
struct logical_volume *lv, void *handle,
52
int (*process_single) (struct cmd_context * cmd,
53
struct lv_segment * seg,
56
int process_each_pv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
57
struct list *tags, void *handle,
58
int (*process_single) (struct cmd_context * cmd,
59
struct volume_group * vg,
60
struct physical_volume * pv,
63
int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
64
struct list *arg_lvnames, struct list *tags,
66
int (*process_single) (struct cmd_context * cmd,
67
struct logical_volume * lv,
70
char *default_vgname(struct cmd_context *cmd);
71
const char *extract_vgname(struct cmd_context *cmd, const char *lv_name);
74
* Builds a list of pv's from the names in argv. Used in
77
struct list *create_pv_list(struct pool *mem, struct volume_group *vg, int argc,
78
char **argv, int allocatable_only);
80
struct list *clone_pv_list(struct pool *mem, struct list *pvs);
82
int exec_cmd(const char *command, const char *fscmd, const char *lv_path,