more changes on original files
[linux-2.4.git] / drivers / md / lvm-internal.h
1
2 /*
3  * kernel/lvm_internal.h
4  *
5  * Copyright (C) 2001 Sistina Software
6  *
7  *
8  * LVM driver is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * LVM driver is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with GNU CC; see the file COPYING.  If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
24
25 /*
26  * Changelog
27  *
28  *    05/01/2001 - Factored this file out of lvm.c (Joe Thornber)
29  *    11/01/2001 - Renamed lvm_internal and added declarations
30  *                 for lvm_fs.c stuff
31  *
32  */
33
34 #ifndef LVM_INTERNAL_H
35 #define LVM_INTERNAL_H
36
37 #include <linux/lvm.h>
38
39 #define _LVM_INTERNAL_H_VERSION "LVM "LVM_RELEASE_NAME" ("LVM_RELEASE_DATE")"
40
41 /* global variables, defined in lvm.c */
42 extern char *lvm_version;
43 extern ushort lvm_iop_version;
44 extern int loadtime;
45 extern const char *const lvm_name;
46
47
48 extern vg_t *vg[];
49 extern struct file_operations lvm_chr_fops;
50
51 #ifndef uchar
52 typedef unsigned char uchar;
53 #endif
54
55 extern struct block_device_operations lvm_blk_dops;
56
57 #define lvm_sectsize(dev) get_hardsect_size(dev)
58
59 /* 2.4.8 had no global min/max macros, and 2.4.9's were flawed */
60
61 /* debug macros */
62 #ifdef DEBUG_IOCTL
63 #define P_IOCTL(fmt, args...) printk(KERN_DEBUG "lvm ioctl: " fmt, ## args)
64 #else
65 #define P_IOCTL(fmt, args...)
66 #endif
67
68 #ifdef DEBUG_MAP
69 #define P_MAP(fmt, args...) printk(KERN_DEBUG "lvm map: " fmt, ## args)
70 #else
71 #define P_MAP(fmt, args...)
72 #endif
73
74 #ifdef DEBUG_KFREE
75 #define P_KFREE(fmt, args...) printk(KERN_DEBUG "lvm kfree: " fmt, ## args)
76 #else
77 #define P_KFREE(fmt, args...)
78 #endif
79
80 #ifdef DEBUG_DEVICE
81 #define P_DEV(fmt, args...) printk(KERN_DEBUG "lvm device: " fmt, ## args)
82 #else
83 #define P_DEV(fmt, args...)
84 #endif
85
86
87 /* lvm-snap.c */
88 int lvm_get_blksize(kdev_t);
89 int lvm_snapshot_alloc(lv_t *);
90 int lvm_snapshot_fill_COW_page(vg_t *, lv_t *);
91 int lvm_snapshot_COW(kdev_t, ulong, ulong, ulong, vg_t * vg, lv_t *);
92 int lvm_snapshot_remap_block(kdev_t *, ulong *, ulong, lv_t *);
93 void lvm_snapshot_release(lv_t *);
94 int lvm_write_COW_table_block(vg_t *, lv_t *);
95 void lvm_hash_link(lv_block_exception_t *, kdev_t, ulong, lv_t *);
96 int lvm_snapshot_alloc_hash_table(lv_t *);
97 void lvm_drop_snapshot(vg_t * vg, lv_t *, const char *);
98
99
100 /* lvm_fs.c */
101 void lvm_init_fs(void);
102 void lvm_fin_fs(void);
103
104 void lvm_fs_create_vg(vg_t * vg_ptr);
105 void lvm_fs_remove_vg(vg_t * vg_ptr);
106 devfs_handle_t lvm_fs_create_lv(vg_t * vg_ptr, lv_t * lv);
107 void lvm_fs_remove_lv(vg_t * vg_ptr, lv_t * lv);
108 void lvm_fs_create_pv(vg_t * vg_ptr, pv_t * pv);
109 void lvm_fs_remove_pv(vg_t * vg_ptr, pv_t * pv);
110
111 #endif