1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _MD_K_H 20 #define _MD_K_H 21 #include "../../../drivers/md/dm-bio-list.h" 22 #define LEVEL_MULTIPATH (-4) 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #define LEVEL_LINEAR (-1) 25 #define LEVEL_FAULTY (-5) 26 #define LEVEL_NONE (-1000000) 27 #define MaxSector (~(sector_t)0) 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define MD_THREAD_NAME_MAX 14 30 typedef struct mddev_s mddev_t; 31 typedef struct mdk_rdev_s mdk_rdev_t; 32 #define MAX_MD_DEVS 256 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define MAX_CHUNK_SIZE (1<<30) 35 struct mdk_rdev_s 36 { 37 struct list_head same_set; 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 sector_t size; 40 mddev_t *mddev; 41 unsigned long last_events; 42 struct block_device *bdev; 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 struct page *sb_page; 45 int sb_loaded; 46 __u64 sb_events; 47 sector_t data_offset; 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 sector_t sb_offset; 50 int sb_size; 51 int preferred_minor; 52 struct kobject kobj; 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 unsigned long flags; 55 #define Faulty 1 56 #define In_sync 2 57 #define WriteMostly 4 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 #define BarriersNotsupp 5 60 int desc_nr; 61 int raid_disk; 62 int saved_raid_disk; 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 sector_t recovery_offset; 65 atomic_t nr_pending; 66 atomic_t read_errors; 67 atomic_t corrected_errors; 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 }; 70 struct mddev_s 71 { 72 void *private; 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 struct mdk_personality *pers; 75 dev_t unit; 76 int md_minor; 77 struct list_head disks; 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 int sb_dirty; 80 int ro; 81 struct gendisk *gendisk; 82 struct kobject kobj; 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 int major_version, 85 minor_version, 86 patch_version; 87 int persistent; 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 int chunk_size; 90 time_t ctime, utime; 91 int level, layout; 92 char clevel[16]; 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 int raid_disks; 95 int max_disks; 96 sector_t size; 97 sector_t array_size; 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 __u64 events; 100 char uuid[16]; 101 sector_t reshape_position; 102 int delta_disks, new_level, new_layout, new_chunk; 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 struct mdk_thread_s *thread; 105 struct mdk_thread_s *sync_thread; 106 sector_t curr_resync; 107 unsigned long resync_mark; 108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109 sector_t resync_mark_cnt; 110 sector_t curr_mark_cnt; 111 sector_t resync_max_sectors; 112 sector_t resync_mismatches; 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 sector_t suspend_lo; 115 sector_t suspend_hi; 116 int sync_speed_min; 117 int sync_speed_max; 118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 int ok_start_degraded; 120 #define MD_RECOVERY_RUNNING 0 121 #define MD_RECOVERY_SYNC 1 122 #define MD_RECOVERY_ERR 2 123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124 #define MD_RECOVERY_INTR 3 125 #define MD_RECOVERY_DONE 4 126 #define MD_RECOVERY_NEEDED 5 127 #define MD_RECOVERY_REQUESTED 6 128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 129 #define MD_RECOVERY_CHECK 7 130 #define MD_RECOVERY_RESHAPE 8 131 #define MD_RECOVERY_FROZEN 9 132 unsigned long recovery; 133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 134 int in_sync; 135 struct mutex reconfig_mutex; 136 atomic_t active; 137 int changed; 138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 139 int degraded; 140 int barriers_work; 141 struct bio *biolist; 142 atomic_t recovery_active; 143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 144 wait_queue_head_t recovery_wait; 145 sector_t recovery_cp; 146 spinlock_t write_lock; 147 wait_queue_head_t sb_wait; 148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 149 atomic_t pending_writes; 150 unsigned int safemode; 151 unsigned int safemode_delay; 152 struct timer_list safemode_timer; 153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 154 atomic_t writes_pending; 155 request_queue_t *queue; 156 atomic_t write_behind; 157 unsigned int max_write_behind; 158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 159 struct bitmap *bitmap; 160 struct file *bitmap_file; 161 long bitmap_offset; 162 long default_bitmap_offset; 163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 164 struct list_head all_mddevs; 165 }; 166 struct mdk_personality 167 { 168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 169 char *name; 170 int level; 171 struct list_head list; 172 struct module *owner; 173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 174 int (*make_request)(request_queue_t *q, struct bio *bio); 175 int (*run)(mddev_t *mddev); 176 int (*stop)(mddev_t *mddev); 177 void (*status)(struct seq_file *seq, mddev_t *mddev); 178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 179 void (*error_handler)(mddev_t *mddev, mdk_rdev_t *rdev); 180 int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); 181 int (*hot_remove_disk) (mddev_t *mddev, int number); 182 int (*spare_active) (mddev_t *mddev); 183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 184 sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); 185 int (*resize) (mddev_t *mddev, sector_t sectors); 186 int (*check_reshape) (mddev_t *mddev); 187 int (*start_reshape) (mddev_t *mddev); 188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 189 int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); 190 void (*quiesce) (mddev_t *mddev, int state); 191 }; 192 struct md_sysfs_entry { 193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 194 struct attribute attr; 195 ssize_t (*show)(mddev_t *, char *); 196 ssize_t (*store)(mddev_t *, const char *, size_t); 197 }; 198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 199 #define ITERATE_RDEV_GENERIC(head,rdev,tmp) for ((tmp) = (head).next; (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), (tmp) = (tmp)->next, (tmp)->prev != &(head) ; ) 200 #define ITERATE_RDEV(mddev,rdev,tmp) ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) 201 #define ITERATE_RDEV_PENDING(rdev,tmp) ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp) 202 typedef struct mdk_thread_s { 203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 204 void (*run) (mddev_t *mddev); 205 mddev_t *mddev; 206 wait_queue_head_t wqueue; 207 unsigned long flags; 208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 209 struct task_struct *tsk; 210 unsigned long timeout; 211 } mdk_thread_t; 212 #define THREAD_WAKEUP 0 213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 214 #define __wait_event_lock_irq(wq, condition, lock, cmd) do { wait_queue_t __wait; init_waitqueue_entry(&__wait, current); add_wait_queue(&wq, &__wait); for (;;) { set_current_state(TASK_UNINTERRUPTIBLE); if (condition) break; spin_unlock_irq(&lock); cmd; schedule(); spin_lock_irq(&lock); } current->state = TASK_RUNNING; remove_wait_queue(&wq, &__wait); } while (0) 215 #define wait_event_lock_irq(wq, condition, lock, cmd) do { if (condition) break; __wait_event_lock_irq(wq, condition, lock, cmd); } while (0) 216 #endif 217