Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / lib / activate / dev_manager.h
blob448cffbc51d60614d9821311fe4449175c939387
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2006 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_DEV_MANAGER_H
19 #define _LVM_DEV_MANAGER_H
21 #include "metadata-exported.h"
23 struct logical_volume;
24 struct volume_group;
25 struct cmd_context;
26 struct dev_manager;
27 struct dm_info;
28 struct device;
31 * Constructor and destructor.
33 struct dev_manager *dev_manager_create(struct cmd_context *cmd,
34 const char *vg_name);
35 void dev_manager_destroy(struct dev_manager *dm);
36 void dev_manager_release(void);
37 void dev_manager_exit(void);
40 * The device handler is responsible for creating all the layered
41 * dm devices, and ensuring that all constraints are maintained
42 * (eg, an origin is created before its snapshot, but is not
43 * unsuspended until the snapshot is also created.)
45 int dev_manager_info(struct dm_pool *mem, const char *name,
46 const struct logical_volume *lv,
47 int mknodes, int with_open_count, int with_read_ahead,
48 struct dm_info *info, uint32_t *read_ahead);
49 int dev_manager_snapshot_percent(struct dev_manager *dm,
50 const struct logical_volume *lv,
51 float *percent,
52 percent_range_t *percent_range);
53 int dev_manager_mirror_percent(struct dev_manager *dm,
54 struct logical_volume *lv, int wait,
55 float *percent, percent_range_t *percent_range,
56 uint32_t *event_nr);
57 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
58 int lockfs, int flush_required);
59 int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv);
60 int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv,
61 int *flush_required);
62 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv);
64 int dev_manager_lv_mknodes(const struct logical_volume *lv);
65 int dev_manager_lv_rmnodes(const struct logical_volume *lv);
68 * Put the desired changes into effect.
70 int dev_manager_execute(struct dev_manager *dm);
72 int dev_manager_device_uses_vg(struct device *dev,
73 struct volume_group *vg);
75 #endif