]> sourceware.org Git - lvm2.git/blob - lib/activate/dev_manager.h
thin: fix recent commits
[lvm2.git] / lib / activate / dev_manager.h
1 /*
2 * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
3 * Copyright (C) 2004-2012 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 Lesser General Public License v.2.1.
10 *
11 * You should have received a copy of the GNU Lesser 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_DEV_MANAGER_H
17 #define _LVM_DEV_MANAGER_H
18
19 #include "metadata-exported.h"
20
21 struct logical_volume;
22 struct lv_activate_opts;
23 struct volume_group;
24 struct cmd_context;
25 struct dev_manager;
26 struct dm_info;
27 struct device;
28
29 int read_only_lv(struct logical_volume *lv, struct lv_activate_opts *laopts);
30
31 /*
32 * Constructor and destructor.
33 */
34 struct dev_manager *dev_manager_create(struct cmd_context *cmd,
35 const char *vg_name,
36 unsigned track_pvmove_deps);
37 void dev_manager_destroy(struct dev_manager *dm);
38 void dev_manager_release(void);
39 void dev_manager_exit(void);
40
41 /*
42 * The device handler is responsible for creating all the layered
43 * dm devices, and ensuring that all constraints are maintained
44 * (eg, an origin is created before its snapshot, but is not
45 * unsuspended until the snapshot is also created.)
46 */
47 int dev_manager_info(struct dm_pool *mem, const struct logical_volume *lv,
48 const char *layer,
49 int with_open_count, int with_read_ahead,
50 struct dm_info *info, uint32_t *read_ahead);
51 int dev_manager_snapshot_percent(struct dev_manager *dm,
52 const struct logical_volume *lv,
53 percent_t *percent);
54 int dev_manager_mirror_percent(struct dev_manager *dm,
55 const struct logical_volume *lv, int wait,
56 percent_t *percent, uint32_t *event_nr);
57 int dev_manager_thin_pool_status(struct dev_manager *dm,
58 const struct logical_volume *lv,
59 struct dm_status_thin_pool **status);
60 int dev_manager_thin_pool_percent(struct dev_manager *dm,
61 const struct logical_volume *lv,
62 int metadata, percent_t *percent);
63 int dev_manager_thin_percent(struct dev_manager *dm,
64 const struct logical_volume *lv,
65 int mapped, percent_t *percent);
66 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
67 struct lv_activate_opts *laopts, int lockfs, int flush_required);
68 int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv,
69 struct lv_activate_opts *laopts);
70 int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv,
71 struct lv_activate_opts *laopts, int *flush_required);
72 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv);
73 int dev_manager_transient(struct dev_manager *dm, struct logical_volume *lv) __attribute__((nonnull(1, 2)));
74
75 int dev_manager_mknodes(const struct logical_volume *lv);
76
77 /*
78 * Put the desired changes into effect.
79 */
80 int dev_manager_execute(struct dev_manager *dm);
81
82 int dev_manager_device_uses_vg(struct device *dev,
83 struct volume_group *vg);
84
85 #endif
This page took 0.092875 seconds and 5 git commands to generate.