blob: 82bea14cae1a7a948aafe1a1a1329aa1a9e6037d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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/blkdev.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <linux/seq_file.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
24/*
25 * 'md_p.h' holds the 'physical' layout of RAID devices
26 * 'md_u.h' holds the user <=> kernel API
27 *
28 * 'md_k.h' holds kernel internal definitions
29 */
30
31#include <linux/raid/md_p.h>
32#include <linux/raid/md_u.h>
33#include <linux/raid/md_k.h>
34
David Howells93614012006-09-30 20:45:40 +020035#ifdef CONFIG_MD
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037/*
38 * Different major versions are not compatible.
39 * Different minor versions are only downward compatible.
40 * Different patchlevel versions are downward and upward compatible.
41 */
42#define MD_MAJOR_VERSION 0
43#define MD_MINOR_VERSION 90
NeilBrowna654b9d82005-06-21 17:17:27 -070044/*
45 * MD_PATCHLEVEL_VERSION indicates kernel functionality.
46 * >=1 means different superblock formats are selectable using SET_ARRAY_INFO
47 * and major_version/minor_version accordingly
48 * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
49 * in the super status byte
NeilBrownbd926c62005-11-08 21:39:32 -080050 * >=3 means that bitmap superblock version 4 is supported, which uses
51 * little-ending representation rather than host-endian
NeilBrowna654b9d82005-06-21 17:17:27 -070052 */
NeilBrownbd926c62005-11-08 21:39:32 -080053#define MD_PATCHLEVEL_VERSION 3
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
Adrian Bunk03de2502008-05-23 13:04:33 -070055extern int mdp_major;
56
NeilBrownd710e132008-10-13 11:55:12 +110057extern int register_md_personality(struct mdk_personality *p);
58extern int unregister_md_personality(struct mdk_personality *p);
59extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev),
Linus Torvalds1da177e2005-04-16 15:20:36 -070060 mddev_t *mddev, const char *name);
NeilBrownd710e132008-10-13 11:55:12 +110061extern void md_unregister_thread(mdk_thread_t *thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -070062extern void md_wakeup_thread(mdk_thread_t *thread);
63extern void md_check_recovery(mddev_t *mddev);
NeilBrown3d310eb2005-06-21 17:17:26 -070064extern void md_write_start(mddev_t *mddev, struct bio *bi);
Linus Torvalds1da177e2005-04-16 15:20:36 -070065extern void md_write_end(mddev_t *mddev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070066extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
NeilBrownd710e132008-10-13 11:55:12 +110067extern void md_error(mddev_t *mddev, mdk_rdev_t *rdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
NeilBrowna654b9d82005-06-21 17:17:27 -070069extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
70 sector_t sector, int size, struct page *page);
NeilBrowna9701a32005-11-08 21:39:34 -080071extern void md_super_wait(mddev_t *mddev);
NeilBrowna654b9d82005-06-21 17:17:27 -070072extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
73 struct page *page, int rw);
NeilBrown29269552006-03-27 01:18:10 -080074extern void md_do_sync(mddev_t *mddev);
75extern void md_new_event(mddev_t *mddev);
Dan Williamsb5470dc2008-06-27 21:44:04 -070076extern int md_allow_write(mddev_t *mddev);
Dan Williams6bfe0b42008-04-30 00:52:32 -070077extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev);
NeilBrownf6705572006-03-27 01:18:11 -080078
David Howells93614012006-09-30 20:45:40 +020079#endif /* CONFIG_MD */
Linus Torvalds1da177e2005-04-16 15:20:36 -070080#endif
81