~ubuntu-branches/ubuntu/breezy/lvm2/breezy

« back to all changes in this revision

Viewing changes to tools/toollib.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Caulfield
  • Date: 2004-11-03 09:37:56 UTC
  • Revision ID: james.westby@ubuntu.com-20041103093756-jt0nj8z0v8k1lyiv
Tags: upstream-2.00.25
ImportĀ upstreamĀ versionĀ 2.00.25

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
 
3
 * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
 
4
 *
 
5
 * This file is part of LVM2.
 
6
 *
 
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.
 
10
 *
 
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
 
14
 */
 
15
 
 
16
#ifndef _LVM_TOOLLIB_H
 
17
#define _LVM_TOOLLIB_H
 
18
 
 
19
#include "metadata.h"
 
20
#include "pool.h"
 
21
 
 
22
int autobackup_set(void);
 
23
int autobackup_init(const char *backup_dir, int keep_days, int keep_number,
 
24
                    int autobackup);
 
25
int autobackup(struct volume_group *vg);
 
26
 
 
27
struct volume_group *recover_vg(struct cmd_context *cmd, const char *vgname,
 
28
                                int lock_type);
 
29
 
 
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,
 
33
                                           const char *vg_name,
 
34
                                           struct volume_group * vg,
 
35
                                           int consistent, void *handle));
 
36
 
 
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,
 
42
                                           void *handle));
 
43
 
 
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,
 
48
                                           void *handle));
 
49
 
 
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,
 
54
                                                      void *handle));
 
55
 
 
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,
 
61
                                                 void *handle));
 
62
 
 
63
int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
 
64
                          struct list *arg_lvnames, struct list *tags,
 
65
                          void *handle,
 
66
                          int (*process_single) (struct cmd_context * cmd,
 
67
                                                 struct logical_volume * lv,
 
68
                                                 void *handle));
 
69
 
 
70
char *default_vgname(struct cmd_context *cmd);
 
71
const char *extract_vgname(struct cmd_context *cmd, const char *lv_name);
 
72
 
 
73
/*
 
74
 * Builds a list of pv's from the names in argv.  Used in
 
75
 * lvcreate/extend.
 
76
 */
 
77
struct list *create_pv_list(struct pool *mem, struct volume_group *vg, int argc,
 
78
                            char **argv, int allocatable_only);
 
79
 
 
80
struct list *clone_pv_list(struct pool *mem, struct list *pvs);
 
81
 
 
82
int exec_cmd(const char *command, const char *fscmd, const char *lv_path,
 
83
             const char *size);
 
84
 
 
85
#endif