File: /usr/include/linux/raid/md.h

1     /*
2        md.h : Multiple Devices driver for Linux
3               Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
4               Copyright (C) 1994-96 Marc ZYNGIER
5     	  <zyngier@ufr-info-p7.ibp.fr> or
6     	  <maz@gloups.fdn.fr>
7     	  
8        This program 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        You should have received a copy of the GNU General Public License
14        (for example /usr/src/linux/COPYING); if not, write to the Free
15        Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
16     */
17     
18     #ifndef _MD_H
19     #define _MD_H
20     
21     #include <linux/mm.h>
22     #include <linux/fs.h>
23     #include <linux/blkdev.h>
24     #include <asm/semaphore.h>
25     #include <linux/major.h>
26     #include <linux/ioctl.h>
27     #include <linux/types.h>
28     #include <asm/bitops.h>
29     #include <linux/module.h>
30     #include <linux/hdreg.h>
31     #include <linux/proc_fs.h>
32     #include <linux/smp_lock.h>
33     #include <linux/delay.h>
34     #include <net/checksum.h>
35     #include <linux/random.h>
36     #include <linux/locks.h>
37     #include <linux/kernel_stat.h>
38     #include <asm/io.h>
39     
40     #include <linux/raid/md_compatible.h>
41     /*
42      * 'md_p.h' holds the 'physical' layout of RAID devices
43      * 'md_u.h' holds the user <=> kernel API
44      *
45      * 'md_k.h' holds kernel internal definitions
46      */
47     
48     #include <linux/raid/md_p.h>
49     #include <linux/raid/md_u.h>
50     #include <linux/raid/md_k.h>
51     
52     /*
53      * Different major versions are not compatible.
54      * Different minor versions are only downward compatible.
55      * Different patchlevel versions are downward and upward compatible.
56      */
57     #define MD_MAJOR_VERSION                0
58     #define MD_MINOR_VERSION                90
59     #define MD_PATCHLEVEL_VERSION           0
60     
61     extern int md_size[MAX_MD_DEVS];
62     extern struct hd_struct md_hd_struct[MAX_MD_DEVS];
63     
64     extern void add_mddev_mapping (mddev_t *mddev, kdev_t dev, void *data);
65     extern void del_mddev_mapping (mddev_t *mddev, kdev_t dev);
66     extern char * partition_name (kdev_t dev);
67     extern int register_md_personality (int p_num, mdk_personality_t *p);
68     extern int unregister_md_personality (int p_num);
69     extern mdk_thread_t * md_register_thread (void (*run) (void *data),
70     				void *data, const char *name);
71     extern void md_unregister_thread (mdk_thread_t *thread);
72     extern void md_wakeup_thread(mdk_thread_t *thread);
73     extern void md_interrupt_thread (mdk_thread_t *thread);
74     extern int md_update_sb (mddev_t *mddev);
75     extern int md_do_sync(mddev_t *mddev, mdp_disk_t *spare);
76     extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
77     extern void md_sync_acct(kdev_t dev, unsigned long nr_sectors);
78     extern void md_recover_arrays (void);
79     extern int md_check_ordering (mddev_t *mddev);
80     extern struct gendisk * find_gendisk (kdev_t dev);
81     extern int md_notify_reboot(struct notifier_block *this,
82     					unsigned long code, void *x);
83     extern int md_error (mddev_t *mddev, kdev_t rdev);
84     extern int md_run_setup(void);
85     
86     extern void md_print_devices (void);
87     
88     #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); }
89     
90     #endif 
91     
92