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#include <linux/completion.h>
40
41#include <linux/raid/md_compatible.h>
42/*
43 * 'md_p.h' holds the 'physical' layout of RAID devices
44 * 'md_u.h' holds the user <=> kernel API
45 *
46 * 'md_k.h' holds kernel internal definitions
47 */
48
49#include <linux/raid/md_p.h>
50#include <linux/raid/md_u.h>
51#include <linux/raid/md_k.h>
52
53/*
54 * Different major versions are not compatible.
55 * Different minor versions are only downward compatible.
56 * Different patchlevel versions are downward and upward compatible.
57 */
58#define MD_MAJOR_VERSION                0
59#define MD_MINOR_VERSION                90
60#define MD_PATCHLEVEL_VERSION           0
61
62extern int md_size[MAX_MD_DEVS];
63extern struct hd_struct md_hd_struct[MAX_MD_DEVS];
64
65extern void add_mddev_mapping (mddev_t *mddev, kdev_t dev, void *data);
66extern void del_mddev_mapping (mddev_t *mddev, kdev_t dev);
67extern char * partition_name (kdev_t dev);
68extern int register_md_personality (int p_num, mdk_personality_t *p);
69extern int unregister_md_personality (int p_num);
70extern mdk_thread_t * md_register_thread (void (*run) (void *data),
71				void *data, const char *name);
72extern void md_unregister_thread (mdk_thread_t *thread);
73extern void md_wakeup_thread(mdk_thread_t *thread);
74extern void md_interrupt_thread (mdk_thread_t *thread);
75extern int md_update_sb (mddev_t *mddev);
76extern int md_do_sync(mddev_t *mddev, mdp_disk_t *spare);
77extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
78extern void md_sync_acct(kdev_t dev, unsigned long nr_sectors);
79extern void md_recover_arrays (void);
80extern int md_check_ordering (mddev_t *mddev);
81extern int md_notify_reboot(struct notifier_block *this,
82					unsigned long code, void *x);
83extern int md_error (mddev_t *mddev, kdev_t rdev);
84extern int md_run_setup(void);
85
86extern 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