2009-03-04 04:28:35 +01:00
|
|
|
/****************************************************************************
|
|
|
|
****************************************************************************
|
|
|
|
***
|
|
|
|
*** This header was automatically generated from a Linux kernel header
|
|
|
|
*** of the same name, to make information necessary for userspace to
|
|
|
|
*** call into the kernel available to libc. It contains only constants,
|
|
|
|
*** structures, and macros generated from the original header, and thus,
|
|
|
|
*** contains no copyrightable information.
|
|
|
|
***
|
2012-03-08 06:13:49 +01:00
|
|
|
*** To edit the content of this header, modify the corresponding
|
|
|
|
*** source file (e.g. under external/kernel-headers/original/) then
|
|
|
|
*** run bionic/libc/kernel/tools/update_all.py
|
|
|
|
***
|
|
|
|
*** Any manual change here will be lost the next time this script will
|
|
|
|
*** be run. You've been warned!
|
|
|
|
***
|
2009-03-04 04:28:35 +01:00
|
|
|
****************************************************************************
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef _MD_K_H
|
|
|
|
#define _MD_K_H
|
|
|
|
#include "../../../drivers/md/dm-bio-list.h"
|
|
|
|
#define LEVEL_MULTIPATH (-4)
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#define LEVEL_LINEAR (-1)
|
|
|
|
#define LEVEL_FAULTY (-5)
|
|
|
|
#define LEVEL_NONE (-1000000)
|
|
|
|
#define MaxSector (~(sector_t)0)
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#define MD_THREAD_NAME_MAX 14
|
|
|
|
typedef struct mddev_s mddev_t;
|
|
|
|
typedef struct mdk_rdev_s mdk_rdev_t;
|
|
|
|
#define MAX_MD_DEVS 256
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#define MAX_CHUNK_SIZE (1<<30)
|
|
|
|
struct mdk_rdev_s
|
|
|
|
{
|
|
|
|
struct list_head same_set;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
sector_t size;
|
|
|
|
mddev_t *mddev;
|
|
|
|
unsigned long last_events;
|
|
|
|
struct block_device *bdev;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
struct page *sb_page;
|
|
|
|
int sb_loaded;
|
|
|
|
__u64 sb_events;
|
|
|
|
sector_t data_offset;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
sector_t sb_offset;
|
|
|
|
int sb_size;
|
|
|
|
int preferred_minor;
|
|
|
|
struct kobject kobj;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned long flags;
|
|
|
|
#define Faulty 1
|
|
|
|
#define In_sync 2
|
|
|
|
#define WriteMostly 4
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#define BarriersNotsupp 5
|
|
|
|
int desc_nr;
|
|
|
|
int raid_disk;
|
|
|
|
int saved_raid_disk;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
sector_t recovery_offset;
|
|
|
|
atomic_t nr_pending;
|
|
|
|
atomic_t read_errors;
|
|
|
|
atomic_t corrected_errors;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
};
|
|
|
|
struct mddev_s
|
|
|
|
{
|
|
|
|
void *private;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
struct mdk_personality *pers;
|
|
|
|
dev_t unit;
|
|
|
|
int md_minor;
|
|
|
|
struct list_head disks;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
int sb_dirty;
|
|
|
|
int ro;
|
|
|
|
struct gendisk *gendisk;
|
|
|
|
struct kobject kobj;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
int major_version,
|
|
|
|
minor_version,
|
|
|
|
patch_version;
|
|
|
|
int persistent;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
int chunk_size;
|
|
|
|
time_t ctime, utime;
|
|
|
|
int level, layout;
|
|
|
|
char clevel[16];
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
int raid_disks;
|
|
|
|
int max_disks;
|
|
|
|
sector_t size;
|
|
|
|
sector_t array_size;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
__u64 events;
|
|
|
|
char uuid[16];
|
|
|
|
sector_t reshape_position;
|
|
|
|
int delta_disks, new_level, new_layout, new_chunk;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
struct mdk_thread_s *thread;
|
|
|
|
struct mdk_thread_s *sync_thread;
|
|
|
|
sector_t curr_resync;
|
|
|
|
unsigned long resync_mark;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
sector_t resync_mark_cnt;
|
|
|
|
sector_t curr_mark_cnt;
|
|
|
|
sector_t resync_max_sectors;
|
|
|
|
sector_t resync_mismatches;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
sector_t suspend_lo;
|
|
|
|
sector_t suspend_hi;
|
|
|
|
int sync_speed_min;
|
|
|
|
int sync_speed_max;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
int ok_start_degraded;
|
|
|
|
#define MD_RECOVERY_RUNNING 0
|
|
|
|
#define MD_RECOVERY_SYNC 1
|
|
|
|
#define MD_RECOVERY_ERR 2
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#define MD_RECOVERY_INTR 3
|
|
|
|
#define MD_RECOVERY_DONE 4
|
|
|
|
#define MD_RECOVERY_NEEDED 5
|
|
|
|
#define MD_RECOVERY_REQUESTED 6
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#define MD_RECOVERY_CHECK 7
|
|
|
|
#define MD_RECOVERY_RESHAPE 8
|
|
|
|
#define MD_RECOVERY_FROZEN 9
|
|
|
|
unsigned long recovery;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
int in_sync;
|
|
|
|
struct mutex reconfig_mutex;
|
|
|
|
atomic_t active;
|
|
|
|
int changed;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
int degraded;
|
|
|
|
int barriers_work;
|
|
|
|
struct bio *biolist;
|
|
|
|
atomic_t recovery_active;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
wait_queue_head_t recovery_wait;
|
|
|
|
sector_t recovery_cp;
|
|
|
|
spinlock_t write_lock;
|
|
|
|
wait_queue_head_t sb_wait;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
atomic_t pending_writes;
|
|
|
|
unsigned int safemode;
|
|
|
|
unsigned int safemode_delay;
|
|
|
|
struct timer_list safemode_timer;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
atomic_t writes_pending;
|
|
|
|
request_queue_t *queue;
|
|
|
|
atomic_t write_behind;
|
|
|
|
unsigned int max_write_behind;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
struct bitmap *bitmap;
|
|
|
|
struct file *bitmap_file;
|
|
|
|
long bitmap_offset;
|
|
|
|
long default_bitmap_offset;
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
struct list_head all_mddevs;
|
|
|
|
};
|
2012-03-08 06:13:49 +01:00
|
|
|
struct mdk_personality
|
|
|
|
{
|
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
|
|
|
char *name;
|
|
|
|
int level;
|
|
|
|
struct list_head list;
|
|
|
|
struct module *owner;
|
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
|
|
|
int (*make_request)(request_queue_t *q, struct bio *bio);
|
|
|
|
int (*run)(mddev_t *mddev);
|
|
|
|
int (*stop)(mddev_t *mddev);
|
|
|
|
void (*status)(struct seq_file *seq, mddev_t *mddev);
|
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
|
|
|
void (*error_handler)(mddev_t *mddev, mdk_rdev_t *rdev);
|
|
|
|
int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev);
|
|
|
|
int (*hot_remove_disk) (mddev_t *mddev, int number);
|
|
|
|
int (*spare_active) (mddev_t *mddev);
|
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
|
|
|
sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster);
|
|
|
|
int (*resize) (mddev_t *mddev, sector_t sectors);
|
|
|
|
int (*check_reshape) (mddev_t *mddev);
|
|
|
|
int (*start_reshape) (mddev_t *mddev);
|
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
|
|
|
int (*reconfig) (mddev_t *mddev, int layout, int chunk_size);
|
|
|
|
void (*quiesce) (mddev_t *mddev, int state);
|
|
|
|
};
|
2009-03-04 04:28:35 +01:00
|
|
|
struct md_sysfs_entry {
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
struct attribute attr;
|
|
|
|
ssize_t (*show)(mddev_t *, char *);
|
|
|
|
ssize_t (*store)(mddev_t *, const char *, size_t);
|
|
|
|
};
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#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) ; )
|
|
|
|
#define ITERATE_RDEV(mddev,rdev,tmp) ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp)
|
|
|
|
#define ITERATE_RDEV_PENDING(rdev,tmp) ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
|
2012-03-08 06:13:49 +01:00
|
|
|
typedef struct mdk_thread_s {
|
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
|
|
|
void (*run) (mddev_t *mddev);
|
|
|
|
mddev_t *mddev;
|
|
|
|
wait_queue_head_t wqueue;
|
|
|
|
unsigned long flags;
|
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
|
|
|
struct task_struct *tsk;
|
|
|
|
unsigned long timeout;
|
|
|
|
} mdk_thread_t;
|
2009-03-04 04:28:35 +01:00
|
|
|
#define THREAD_WAKEUP 0
|
2012-03-08 06:13:49 +01:00
|
|
|
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
2009-03-04 04:28:35 +01:00
|
|
|
#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)
|
|
|
|
#define wait_event_lock_irq(wq, condition, lock, cmd) do { if (condition) break; __wait_event_lock_irq(wq, condition, lock, cmd); } while (0)
|
|
|
|
#endif
|