diff options
| author | NeilBrown <neilb@suse.de> | 2009-03-30 23:33:13 -0400 |
|---|---|---|
| committer | NeilBrown <neilb@suse.de> | 2009-03-30 23:33:13 -0400 |
| commit | 43b2e5d86d8bdd77386226db0bc961529492c043 (patch) | |
| tree | 601a885b1410324678cf319eee77cc54a02f2cf3 /include/linux/raid | |
| parent | bff61975b3d6c18ee31457cc5b4d73042f44915f (diff) | |
md: move md_k.h from include/linux/raid/ to drivers/md/
It really is nicer to keep related code together..
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'include/linux/raid')
| -rw-r--r-- | include/linux/raid/md_k.h | 411 |
1 files changed, 0 insertions, 411 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h deleted file mode 100644 index e78b3c1d55fd..000000000000 --- a/include/linux/raid/md_k.h +++ /dev/null | |||
| @@ -1,411 +0,0 @@ | |||
| 1 | /* | ||
| 2 | md_k.h : kernel internal structure of the Linux MD driver | ||
| 3 | Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman | ||
| 4 | |||
| 5 | This program is free software; you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License as published by | ||
| 7 | the Free Software Foundation; either version 2, or (at your option) | ||
| 8 | any later version. | ||
| 9 | |||
| 10 | You should have received a copy of the GNU General Public License | ||
| 11 | (for example /usr/src/linux/COPYING); if not, write to the Free | ||
| 12 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _MD_K_H | ||
| 16 | #define _MD_K_H | ||
| 17 | |||
| 18 | #ifdef CONFIG_BLOCK | ||
| 19 | |||
| 20 | #define MaxSector (~(sector_t)0) | ||
| 21 | |||
| 22 | typedef struct mddev_s mddev_t; | ||
| 23 | typedef struct mdk_rdev_s mdk_rdev_t; | ||
| 24 | |||
| 25 | /* | ||
| 26 | * options passed in raidrun: | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* Currently this must fit in an 'int' */ | ||
| 30 | #define MAX_CHUNK_SIZE (1<<30) | ||
| 31 | |||
| 32 | /* | ||
| 33 | * MD's 'extended' device | ||
| 34 | */ | ||
| 35 | struct mdk_rdev_s | ||
| 36 | { | ||
| 37 | struct list_head same_set; /* RAID devices within the same set */ | ||
| 38 | |||
| 39 | sector_t size; /* Device size (in blocks) */ | ||
| 40 | mddev_t *mddev; /* RAID array if running */ | ||
| 41 | int last_events; /* IO event timestamp */ | ||
| 42 | |||
| 43 | struct block_device *bdev; /* block device handle */ | ||
| 44 | |||
| 45 | struct page *sb_page; | ||
| 46 | int sb_loaded; | ||
| 47 | __u64 sb_events; | ||
| 48 | sector_t data_offset; /* start of data in array */ | ||
| 49 | sector_t sb_start; /* offset of the super block (in 512byte sectors) */ | ||
| 50 | int sb_size; /* bytes in the superblock */ | ||
| 51 | int preferred_minor; /* autorun support */ | ||
| 52 | |||
| 53 | struct kobject kobj; | ||
| 54 | |||
| 55 | /* A device can be in one of three states based on two flags: | ||
| 56 | * Not working: faulty==1 in_sync==0 | ||
| 57 | * Fully working: faulty==0 in_sync==1 | ||
| 58 | * Working, but not | ||
| 59 | * in sync with array | ||
| 60 | * faulty==0 in_sync==0 | ||
| 61 | * | ||
| 62 | * It can never have faulty==1, in_sync==1 | ||
| 63 | * This reduces the burden of testing multiple flags in many cases | ||
| 64 | */ | ||
| 65 | |||
| 66 | unsigned long flags; | ||
| 67 | #define Faulty 1 /* device is known to have a fault */ | ||
| 68 | #define In_sync 2 /* device is in_sync with rest of array */ | ||
| 69 | #define WriteMostly 4 /* Avoid reading if at all possible */ | ||
| 70 | #define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ | ||
| 71 | #define AllReserved 6 /* If whole device is reserved for | ||
| 72 | * one array */ | ||
| 73 | #define AutoDetected 7 /* added by auto-detect */ | ||
| 74 | #define Blocked 8 /* An error occured on an externally | ||
| 75 | * managed array, don't allow writes | ||
| 76 | * until it is cleared */ | ||
| 77 | #define StateChanged 9 /* Faulty or Blocked has changed during | ||
| 78 | * interrupt, so it needs to be | ||
| 79 | * notified by the thread */ | ||
| 80 | wait_queue_head_t blocked_wait; | ||
| 81 | |||
| 82 | int desc_nr; /* descriptor index in the superblock */ | ||
| 83 | int raid_disk; /* role of device in array */ | ||
| 84 | int saved_raid_disk; /* role that device used to have in the | ||
| 85 | * array and could again if we did a partial | ||
| 86 | * resync from the bitmap | ||
| 87 | */ | ||
| 88 | sector_t recovery_offset;/* If this device has been partially | ||
| 89 | * recovered, this is where we were | ||
| 90 | * up to. | ||
| 91 | */ | ||
| 92 | |||
| 93 | atomic_t nr_pending; /* number of pending requests. | ||
| 94 | * only maintained for arrays that | ||
| 95 | * support hot removal | ||
| 96 | */ | ||
| 97 | atomic_t read_errors; /* number of consecutive read errors that | ||
| 98 | * we have tried to ignore. | ||
| 99 | */ | ||
| 100 | atomic_t corrected_errors; /* number of corrected read errors, | ||
| 101 | * for reporting to userspace and storing | ||
| 102 | * in superblock. | ||
| 103 | */ | ||
| 104 | struct work_struct del_work; /* used for delayed sysfs removal */ | ||
| 105 | |||
| 106 | struct sysfs_dirent *sysfs_state; /* handle for 'state' | ||
| 107 | * sysfs entry */ | ||
| 108 | }; | ||
| 109 | |||
| 110 | struct mddev_s | ||
| 111 | { | ||
| 112 | void *private; | ||
| 113 | struct mdk_personality *pers; | ||
| 114 | dev_t unit; | ||
| 115 | int md_minor; | ||
| 116 | struct list_head disks; | ||
| 117 | unsigned long flags; | ||
| 118 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | ||
| 119 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | ||
| 120 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | ||
| 121 | |||
| 122 | int ro; | ||
| 123 | |||
| 124 | struct gendisk *gendisk; | ||
| 125 | |||
| 126 | struct kobject kobj; | ||
| 127 | int hold_active; | ||
| 128 | #define UNTIL_IOCTL 1 | ||
| 129 | #define UNTIL_STOP 2 | ||
| 130 | |||
| 131 | /* Superblock information */ | ||
| 132 | int major_version, | ||
| 133 | minor_version, | ||
| 134 | patch_version; | ||
| 135 | int persistent; | ||
| 136 | int external; /* metadata is | ||
| 137 | * managed externally */ | ||
| 138 | char metadata_type[17]; /* externally set*/ | ||
| 139 | int chunk_size; | ||
| 140 | time_t ctime, utime; | ||
| 141 | int level, layout; | ||
| 142 | char clevel[16]; | ||
| 143 | int raid_disks; | ||
| 144 | int max_disks; | ||
| 145 | sector_t size; /* used size of component devices */ | ||
| 146 | sector_t array_sectors; /* exported array size */ | ||
| 147 | __u64 events; | ||
| 148 | |||
| 149 | char uuid[16]; | ||
| 150 | |||
| 151 | /* If the array is being reshaped, we need to record the | ||
| 152 | * new shape and an indication of where we are up to. | ||
| 153 | * This is written to the superblock. | ||
| 154 | * If reshape_position is MaxSector, then no reshape is happening (yet). | ||
| 155 | */ | ||
| 156 | sector_t reshape_position; | ||
| 157 | int delta_disks, new_level, new_layout, new_chunk; | ||
| 158 | |||
| 159 | struct mdk_thread_s *thread; /* management thread */ | ||
| 160 | struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ | ||
| 161 | sector_t curr_resync; /* last block scheduled */ | ||
| 162 | unsigned long resync_mark; /* a recent timestamp */ | ||
| 163 | sector_t resync_mark_cnt;/* blocks written at resync_mark */ | ||
| 164 | sector_t curr_mark_cnt; /* blocks scheduled now */ | ||
| 165 | |||
| 166 | sector_t resync_max_sectors; /* may be set by personality */ | ||
| 167 | |||
| 168 | sector_t resync_mismatches; /* count of sectors where | ||
| 169 | * parity/replica mismatch found | ||
| 170 | */ | ||
| 171 | |||
| 172 | /* allow user-space to request suspension of IO to regions of the array */ | ||
| 173 | sector_t suspend_lo; | ||
| 174 | sector_t suspend_hi; | ||
| 175 | /* if zero, use the system-wide default */ | ||
| 176 | int sync_speed_min; | ||
| 177 | int sync_speed_max; | ||
| 178 | |||
| 179 | /* resync even though the same disks are shared among md-devices */ | ||
| 180 | int parallel_resync; | ||
| 181 | |||
| 182 | int ok_start_degraded; | ||
| 183 | /* recovery/resync flags | ||
| 184 | * NEEDED: we might need to start a resync/recover | ||
| 185 | * RUNNING: a thread is running, or about to be started | ||
| 186 | * SYNC: actually doing a resync, not a recovery | ||
