Import 2.4.0-test2pre7
[davej-history.git] / include / linux / raid / md.h
blob152fb359bc7336a83f7ac4f5f5dcd3397b01ece6
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>
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.
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.
18 #ifndef _MD_H
19 #define _MD_H
21 #include <linux/mm.h>
22 #include <linux/config.h>
23 #include <linux/fs.h>
24 #include <linux/blkdev.h>
25 #include <asm/semaphore.h>
26 #include <linux/major.h>
27 #include <linux/ioctl.h>
28 #include <linux/types.h>
29 #include <asm/bitops.h>
30 #include <linux/module.h>
31 #include <linux/hdreg.h>
32 #include <linux/sysctl.h>
33 #include <linux/proc_fs.h>
34 #include <linux/smp_lock.h>
35 #include <linux/delay.h>
36 #include <net/checksum.h>
37 #include <linux/random.h>
38 #include <linux/locks.h>
39 #include <linux/kernel_stat.h>
40 #include <asm/io.h>
42 #include <linux/raid/md_compatible.h>
44 * 'md_p.h' holds the 'physical' layout of RAID devices
45 * 'md_u.h' holds the user <=> kernel API
47 * 'md_k.h' holds kernel internal definitions
50 #include <linux/raid/md_p.h>
51 #include <linux/raid/md_u.h>
52 #include <linux/raid/md_k.h>
55 * Different major versions are not compatible.
56 * Different minor versions are only downward compatible.
57 * Different patchlevel versions are downward and upward compatible.
59 #define MD_MAJOR_VERSION 0
60 #define MD_MINOR_VERSION 90
61 #define MD_PATCHLEVEL_VERSION 0
63 extern int md_size[MAX_MD_DEVS];
64 extern struct hd_struct md_hd_struct[MAX_MD_DEVS];
66 extern void add_mddev_mapping (mddev_t *mddev, kdev_t dev, void *data);
67 extern void del_mddev_mapping (mddev_t *mddev, kdev_t dev);
68 extern char * partition_name (kdev_t dev);
69 extern int register_md_personality (int p_num, mdk_personality_t *p);
70 extern int unregister_md_personality (int p_num);
71 extern mdk_thread_t * md_register_thread (void (*run) (void *data),
72 void *data, const char *name);
73 extern void md_unregister_thread (mdk_thread_t *thread);
74 extern void md_wakeup_thread(mdk_thread_t *thread);
75 extern void md_interrupt_thread (mdk_thread_t *thread);
76 extern int md_update_sb (mddev_t *mddev);
77 extern int md_do_sync(mddev_t *mddev, mdp_disk_t *spare);
78 extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
79 extern void md_recover_arrays (void);
80 extern int md_check_ordering (mddev_t *mddev);
81 extern struct gendisk * find_gendisk (kdev_t dev);
82 extern int md_notify_reboot(struct notifier_block *this,
83 unsigned long code, void *x);
84 extern int md_error (kdev_t mddev, kdev_t rdev);
86 #if CONFIG_BLK_DEV_MD
87 extern void raid_setup(char *str,int *ints) md__init;
88 #endif
90 extern void md_print_devices (void);
92 #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); }
94 #endif _MD_H