]> sourceware.org Git - lvm2.git/blame - tools/toollib.h
thin: tighten discard string conversions
[lvm2.git] / tools / toollib.h
CommitLineData
269930c0 1/*
6606c3ae 2 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
ea0cdd28 3 * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
269930c0 4 *
6606c3ae 5 * This file is part of LVM2.
269930c0 6 *
6606c3ae
AK
7 * This copyrighted material is made available to anyone wishing to use,
8 * modify, copy, or redistribute it subject to the terms and conditions
be684599 9 * of the GNU Lesser General Public License v.2.1.
269930c0 10 *
be684599 11 * You should have received a copy of the GNU Lesser General Public License
6606c3ae
AK
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
269930c0
AK
14 */
15
b8ef655f
AK
16#ifndef _LVM_TOOLLIB_H
17#define _LVM_TOOLLIB_H
269930c0 18
03eee0e2 19#include "metadata-exported.h"
60274aba 20
25d42d50 21int autobackup_set(void);
41b2fd5f
AK
22int autobackup_init(const char *backup_dir, int keep_days, int keep_number,
23 int autobackup);
9f44467d 24int autobackup(struct volume_group *vg);
269930c0 25
5a52dca9 26struct volume_group *recover_vg(struct cmd_context *cmd, const char *vgname,
21bc3664 27 uint32_t lock_type);
5a52dca9 28
6c4f65fe
AK
29typedef int (*process_single_vg_fn_t) (struct cmd_context * cmd,
30 const char *vg_name,
31 struct volume_group * vg,
32 void *handle);
33typedef int (*process_single_pv_fn_t) (struct cmd_context *cmd,
34 struct volume_group *vg,
35 struct physical_volume *pv,
36 void *handle);
37typedef int (*process_single_lv_fn_t) (struct cmd_context *cmd,
38 struct logical_volume *lv,
39 void *handle);
40typedef int (*process_single_seg_fn_t) (struct cmd_context * cmd,
41 struct lv_segment * seg,
42 void *handle);
43typedef int (*process_single_pvseg_fn_t) (struct cmd_context * cmd,
44 struct volume_group * vg,
45 struct pv_segment * pvseg,
46 void *handle);
47
6fda126d 48int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
13e8c7e4 49 uint32_t flags, void *handle,
6c4f65fe 50 process_single_vg_fn_t process_single_vg);
677a06d5 51
6fda126d 52int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
ea0cdd28
MB
53 struct volume_group *vg, uint32_t lock_type,
54 int scan_label_only, void *handle,
6c4f65fe 55 process_single_pv_fn_t process_single_pv);
ea0cdd28 56
c54a9405
AK
57int process_each_segment_in_pv(struct cmd_context *cmd,
58 struct volume_group *vg,
59 struct physical_volume *pv,
60 void *handle,
6c4f65fe 61 process_single_pvseg_fn_t process_single_pvseg);
5a52dca9 62
60274aba 63int process_each_lv(struct cmd_context *cmd, int argc, char **argv,
13e8c7e4 64 uint32_t flags, void *handle,
6c4f65fe
AK
65 process_single_lv_fn_t process_single_lv);
66
7f3859bb 67
4c64ed4c
AK
68int process_each_segment_in_lv(struct cmd_context *cmd,
69 struct logical_volume *lv, void *handle,
6c4f65fe 70 process_single_seg_fn_t process_single_seg);
08c9ff43 71
60274aba 72int process_each_pv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
2c44337b 73 const struct dm_list *tags, void *handle,
6c4f65fe 74 process_single_pv_fn_t process_single_pv);
08c9ff43 75
5a52dca9 76
08c9ff43 77int process_each_lv_in_vg(struct cmd_context *cmd,
7b45e46a 78 struct volume_group *vg,
2c44337b
AK
79 const struct dm_list *arg_lvnames,
80 const struct dm_list *tags,
04a6dd77 81 struct dm_list *failed_lvnames,
5a52dca9 82 void *handle,
6c4f65fe 83 process_single_lv_fn_t process_single_lv);
677a06d5 84
25b73380 85char *default_vgname(struct cmd_context *cmd);
8ef2b021 86const char *extract_vgname(struct cmd_context *cmd, const char *lv_name);
aec21154
ZK
87const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
88 unsigned *dev_dir_found);
cfd658da 89
cc282870
JT
90/*
91 * Builds a list of pv's from the names in argv. Used in
92 * lvcreate/extend.
93 */
2c44337b 94struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc,
eabaa339 95 char **argv, int allocatable_only);
cc282870 96
2c44337b 97struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvs);
b8c919b4 98
c6ea6bf5
DW
99void vgcreate_params_set_defaults(struct vgcreate_params *vp_def,
100 struct volume_group *vg);
2a924b3e
DW
101int vgcreate_params_set_from_args(struct cmd_context *cmd,
102 struct vgcreate_params *vp_new,
103 struct vgcreate_params *vp_def);
3ad47d16 104int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv);
da1ba4ed 105int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg);
93bbc31c
AK
106void lv_spawn_background_polling(struct cmd_context *cmd,
107 struct logical_volume *lv);
accb1738 108int pvcreate_params_validate(struct cmd_context *cmd,
f900ba63
DW
109 int argc, char **argv,
110 struct pvcreate_params *pp);
93bbc31c 111
a6bc975a
MS
112int get_activation_monitoring_mode(struct cmd_context *cmd,
113 int *monitoring_mode);
68176be1
AK
114int get_stripe_params(struct cmd_context *cmd, uint32_t *stripes,
115 uint32_t *stripe_size);
116
b51cd542
AK
117int change_tag(struct cmd_context *cmd, struct volume_group *vg,
118 struct logical_volume *lv, struct physical_volume *pv, int arg);
119
269930c0 120#endif
This page took 0.180064 seconds and 5 git commands to generate.