diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dynamic_debug.h | 2 | ||||
| -rw-r--r-- | include/linux/extcon.h | 2 | ||||
| -rw-r--r-- | include/linux/hashtable.h | 192 | ||||
| -rw-r--r-- | include/linux/iio/iio.h | 16 | ||||
| -rw-r--r-- | include/linux/kvm_host.h | 15 | ||||
| -rw-r--r-- | include/linux/memblock.h | 1 | ||||
| -rw-r--r-- | include/linux/mfd/max77693.h | 13 | ||||
| -rw-r--r-- | include/linux/percpu-rwsem.h | 28 | ||||
| -rw-r--r-- | include/linux/perf_event.h | 10 | ||||
| -rw-r--r-- | include/linux/raid/Kbuild | 2 | ||||
| -rw-r--r-- | include/linux/raid/md_p.h | 301 | ||||
| -rw-r--r-- | include/linux/raid/md_u.h | 141 | ||||
| -rw-r--r-- | include/linux/rbtree_augmented.h | 1 | ||||
| -rw-r--r-- | include/linux/spi/tsc2005.h | 2 | ||||
| -rw-r--r-- | include/linux/tcp.h | 3 | ||||
| -rw-r--r-- | include/linux/uprobes.h | 11 |
16 files changed, 248 insertions, 492 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index c18257b0fa72..6dd4787a798a 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
| @@ -61,7 +61,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor, | |||
| 61 | const char *fmt, ...); | 61 | const char *fmt, ...); |
| 62 | 62 | ||
| 63 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ | 63 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ |
| 64 | static struct _ddebug __used __aligned(8) \ | 64 | static struct _ddebug __aligned(8) \ |
| 65 | __attribute__((section("__verbose"))) name = { \ | 65 | __attribute__((section("__verbose"))) name = { \ |
| 66 | .modname = KBUILD_MODNAME, \ | 66 | .modname = KBUILD_MODNAME, \ |
| 67 | .function = __func__, \ | 67 | .function = __func__, \ |
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 7443a560c9d0..2c26c14cd710 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
| @@ -68,7 +68,7 @@ enum extcon_cable_name { | |||
| 68 | EXTCON_VIDEO_OUT, | 68 | EXTCON_VIDEO_OUT, |
| 69 | EXTCON_MECHANICAL, | 69 | EXTCON_MECHANICAL, |
| 70 | }; | 70 | }; |
| 71 | extern const char *extcon_cable_name[]; | 71 | extern const char extcon_cable_name[][CABLE_NAME_MAX + 1]; |
| 72 | 72 | ||
| 73 | struct extcon_cable; | 73 | struct extcon_cable; |
| 74 | 74 | ||
diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h new file mode 100644 index 000000000000..227c62424f3c --- /dev/null +++ b/include/linux/hashtable.h | |||
| @@ -0,0 +1,192 @@ | |||
| 1 | /* | ||
| 2 | * Statically sized hash table implementation | ||
| 3 | * (C) 2012 Sasha Levin <levinsasha928@gmail.com> | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef _LINUX_HASHTABLE_H | ||
| 7 | #define _LINUX_HASHTABLE_H | ||
| 8 | |||
| 9 | #include <linux/list.h> | ||
| 10 | #include <linux/types.h> | ||
| 11 | #include <linux/kernel.h> | ||
| 12 | #include <linux/hash.h> | ||
| 13 | #include <linux/rculist.h> | ||
| 14 | |||
| 15 | #define DEFINE_HASHTABLE(name, bits) \ | ||
| 16 | struct hlist_head name[1 << (bits)] = \ | ||
| 17 | { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT } | ||
| 18 | |||
| 19 | #define DECLARE_HASHTABLE(name, bits) \ | ||
| 20 | struct hlist_head name[1 << (bits)] | ||
| 21 | |||
| 22 | #define HASH_SIZE(name) (ARRAY_SIZE(name)) | ||
| 23 | #define HASH_BITS(name) ilog2(HASH_SIZE(name)) | ||
| 24 | |||
| 25 | /* Use hash_32 when possible to allow for fast 32bit hashing in 64bit kernels. */ | ||
| 26 | #define hash_min(val, bits) \ | ||
| 27 | (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits)) | ||
| 28 | |||
| 29 | static inline void __hash_init(struct hlist_head *ht, unsigned int sz) | ||
| 30 | { | ||
| 31 | unsigned int i; | ||
| 32 | |||
| 33 | for (i = 0; i < sz; i++) | ||
| 34 | INIT_HLIST_HEAD(&ht[i]); | ||
| 35 | } | ||
| 36 | |||
| 37 | /** | ||
| 38 | * hash_init - initialize a hash table | ||
| 39 | * @hashtable: hashtable to be initialized | ||
| 40 | * | ||
| 41 | * Calculates the size of the hashtable from the given parameter, otherwise | ||
| 42 | * same as hash_init_size. | ||
| 43 | * | ||
| 44 | * This has to be a macro since HASH_BITS() will not work on pointers since | ||
| 45 | * it calculates the size during preprocessing. | ||
| 46 | */ | ||
| 47 | #define hash_init(hashtable) __hash_init(hashtable, HASH_SIZE(hashtable)) | ||
| 48 | |||
| 49 | /** | ||
| 50 | * hash_add - add an object to a hashtable | ||
| 51 | * @hashtable: hashtable to add to | ||
| 52 | * @node: the &struct hlist_node of the object to be added | ||
| 53 | * @key: the key of the object to be added | ||
| 54 | */ | ||
| 55 | #define hash_add(hashtable, node, key) \ | ||
| 56 | hlist_add_head(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) | ||
| 57 | |||
| 58 | /** | ||
| 59 | * hash_add_rcu - add an object to a rcu enabled hashtable | ||
| 60 | * @hashtable: hashtable to add to | ||
| 61 | * @node: the &struct hlist_node of the object to be added | ||
| 62 | * @key: the key of the object to be added | ||
| 63 | */ | ||
| 64 | #define hash_add_rcu(hashtable, node, key) \ | ||
| 65 | hlist_add_head_rcu(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) | ||
| 66 | |||
| 67 | /** | ||
| 68 | * hash_hashed - check whether an object is in any hashtable | ||
| 69 | * @node: the &struct hlist_node of the object to be checked | ||
| 70 | */ | ||
| 71 | static inline bool hash_hashed(struct hlist_node *node) | ||
| 72 | { | ||
| 73 | return !hlist_unhashed(node); | ||
| 74 | } | ||
| 75 | |||
| 76 | static inline bool __hash_empty(struct hlist_head *ht, unsigned int sz) | ||
| 77 | { | ||
| 78 | unsigned int i; | ||
| 79 | |||
| 80 | for (i = 0; i < sz; i++) | ||
| 81 | if (!hlist_empty(&ht[i])) | ||
| 82 | return false; | ||
| 83 | |||
| 84 | return true; | ||
| 85 | } | ||
| 86 | |||
| 87 | /** | ||
| 88 | * hash_empty - check whether a hashtable is empty | ||
| 89 | * @hashtable: hashtable to check | ||
| 90 | * | ||
| 91 | * This has to be a macro since HASH_BITS() will not work on pointers since | ||
| 92 | * it calculates the size during preprocessing. | ||
| 93 | */ | ||
| 94 | #define hash_empty(hashtable) __hash_empty(hashtable, HASH_SIZE(hashtable)) | ||
| 95 | |||
| 96 | /** | ||
| 97 | * hash_del - remove an object from a hashtable | ||
| 98 | * @node: &struct hlist_node of the object to remove | ||
| 99 | */ | ||
| 100 | static inline void hash_del(struct hlist_node *node) | ||
| 101 | { | ||
| 102 | hlist_del_init(node); | ||
| 103 | } | ||
| 104 | |||
| 105 | /** | ||
| 106 | * hash_del_rcu - remove an object from a rcu enabled hashtable | ||
| 107 | * @node: &struct hlist_node of the object to remove | ||
| 108 | */ | ||
| 109 | static inline void hash_del_rcu(struct hlist_node *node) | ||
| 110 | { | ||
| 111 | hlist_del_init_rcu(node); | ||
| 112 | } | ||
| 113 | |||
| 114 | /** | ||
| 115 | * hash_for_each - iterate over a hashtable | ||
| 116 | * @name: hashtable to iterate | ||
| 117 | * @bkt: integer to use as bucket loop cursor | ||
| 118 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 119 | * @obj: the type * to use as a loop cursor for each entry | ||
| 120 | * @member: the name of the hlist_node within the struct | ||
| 121 | */ | ||
| 122 | #define hash_for_each(name, bkt, node, obj, member) \ | ||
| 123 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | ||
| 124 | hlist_for_each_entry(obj, node, &name[bkt], member) | ||
| 125 | |||
| 126 | /** | ||
| 127 | * hash_for_each_rcu - iterate over a rcu enabled hashtable | ||
| 128 | * @name: hashtable to iterate | ||
| 129 | * @bkt: integer to use as bucket loop cursor | ||
| 130 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 131 | * @obj: the type * to use as a loop cursor for each entry | ||
| 132 | * @member: the name of the hlist_node within the struct | ||
| 133 | */ | ||
| 134 | #define hash_for_each_rcu(name, bkt, node, obj, member) \ | ||
| 135 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | ||
| 136 | hlist_for_each_entry_rcu(obj, node, &name[bkt], member) | ||
| 137 | |||
| 138 | /** | ||
| 139 | * hash_for_each_safe - iterate over a hashtable safe against removal of | ||
| 140 | * hash entry | ||
| 141 | * @name: hashtable to iterate | ||
| 142 | * @bkt: integer to use as bucket loop cursor | ||
| 143 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 144 | * @tmp: a &struct used for temporary storage | ||
| 145 | * @obj: the type * to use as a loop cursor for each entry | ||
| 146 | * @member: the name of the hlist_node within the struct | ||
| 147 | */ | ||
| 148 | #define hash_for_each_safe(name, bkt, node, tmp, obj, member) \ | ||
| 149 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | ||
| 150 | hlist_for_each_entry_safe(obj, node, tmp, &name[bkt], member) | ||
| 151 | |||
| 152 | /** | ||
| 153 | * hash_for_each_possible - iterate over all possible objects hashing to the | ||
| 154 | * same bucket | ||
| 155 | * @name: hashtable to iterate | ||
| 156 | * @obj: the type * to use as a loop cursor for each entry | ||
| 157 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 158 | * @member: the name of the hlist_node within the struct | ||
| 159 | * @key: the key of the objects to iterate over | ||
| 160 | */ | ||
| 161 | #define hash_for_each_possible(name, obj, node, member, key) \ | ||
| 162 | hlist_for_each_entry(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | ||
| 163 | |||
| 164 | /** | ||
| 165 | * hash_for_each_possible_rcu - iterate over all possible objects hashing to the | ||
| 166 | * same bucket in an rcu enabled hashtable | ||
| 167 | * in a rcu enabled hashtable | ||
| 168 | * @name: hashtable to iterate | ||
| 169 | * @obj: the type * to use as a loop cursor for each entry | ||
| 170 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 171 | * @member: the name of the hlist_node within the struct | ||
| 172 | * @key: the key of the objects to iterate over | ||
| 173 | */ | ||
| 174 | #define hash_for_each_possible_rcu(name, obj, node, member, key) \ | ||
| 175 | hlist_for_each_entry_rcu(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | ||
| 176 | |||
| 177 | /** | ||
| 178 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the | ||
| 179 | * same bucket safe against removals | ||
| 180 | * @name: hashtable to iterate | ||
| 181 | * @obj: the type * to use as a loop cursor for each entry | ||
| 182 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 183 | * @tmp: a &struct used for temporary storage | ||
| 184 | * @member: the name of the hlist_node within the struct | ||
| 185 | * @key: the key of the objects to iterate over | ||
| 186 | */ | ||
| 187 | #define hash_for_each_possible_safe(name, obj, node, tmp, member, key) \ | ||
| 188 | hlist_for_each_entry_safe(obj, node, tmp, \ | ||
| 189 | &name[hash_min(key, HASH_BITS(name))], member) | ||
| 190 | |||
| 191 | |||
| 192 | #endif | ||
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index c0ae76ac4e0b..7806c24e5bc8 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -618,4 +618,20 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) | |||
| 618 | }; | 618 | }; |
| 619 | #endif | 619 | #endif |
| 620 | 620 | ||
| 621 | /** | ||
| 622 | * IIO_DEGREE_TO_RAD() - Convert degree to rad | ||
| 623 | * @deg: A value in degree | ||
| 624 | * | ||
| 625 | * Returns the given value converted from degree to rad | ||
| 626 | */ | ||
| 627 | #define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL) | ||
| 628 | |||
| 629 | /** | ||
| 630 | * IIO_G_TO_M_S_2() - Convert g to meter / second**2 | ||
| 631 | * @g: A value in g | ||
| 632 | * | ||
| 633 | * Returns the given value converted from g to meter / second**2 | ||
| 634 | */ | ||
| 635 | #define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL) | ||
| 636 | |||
| 621 | #endif /* _INDUSTRIAL_IO_H_ */ | 637 | #endif /* _INDUSTRIAL_IO_H_ */ |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 93bfc9f9815c..ecc554374e44 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -42,19 +42,8 @@ | |||
| 42 | */ | 42 | */ |
| 43 | #define KVM_MEMSLOT_INVALID (1UL << 16) | 43 | #define KVM_MEMSLOT_INVALID (1UL << 16) |
| 44 | 44 | ||
| 45 | /* | 45 | /* Two fragments for cross MMIO pages. */ |
| 46 | * If we support unaligned MMIO, at most one fragment will be split into two: | 46 | #define KVM_MAX_MMIO_FRAGMENTS 2 |
| 47 | */ | ||
| 48 | #ifdef KVM_UNALIGNED_MMIO | ||
| 49 | # define KVM_EXTRA_MMIO_FRAGMENTS 1 | ||
| 50 | #else | ||
| 51 | # define KVM_EXTRA_MMIO_FRAGMENTS 0 | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #define KVM_USER_MMIO_SIZE 8 | ||
| 55 | |||
| 56 | #define KVM_MAX_MMIO_FRAGMENTS \ | ||
| 57 | (KVM_MMIO_SIZE / KVM_USER_MMIO_SIZE + KVM_EXTRA_MMIO_FRAGMENTS) | ||
| 58 | 47 | ||
| 59 | /* | 48 | /* |
| 60 | * For the normal pfn, the highest 12 bits should be zero, | 49 | * For the normal pfn, the highest 12 bits should be zero, |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 569d67d4243e..d452ee191066 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -57,6 +57,7 @@ int memblock_add(phys_addr_t base, phys_addr_t size); | |||
| 57 | int memblock_remove(phys_addr_t base, phys_addr_t size); | 57 | int memblock_remove(phys_addr_t base, phys_addr_t size); |
| 58 | int memblock_free(phys_addr_t base, phys_addr_t size); | 58 | int memblock_free(phys_addr_t base, phys_addr_t size); |
| 59 | int memblock_reserve(phys_addr_t base, phys_addr_t size); | 59 | int memblock_reserve(phys_addr_t base, phys_addr_t size); |
| 60 | void memblock_trim_memory(phys_addr_t align); | ||
| 60 | 61 | ||
| 61 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 62 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 62 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, | 63 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, |
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h index 1d28ae90384e..fe03b2d35d4f 100644 --- a/include/linux/mfd/max77693.h +++ b/include/linux/mfd/max77693.h | |||
| @@ -30,7 +30,20 @@ | |||
| 30 | #ifndef __LINUX_MFD_MAX77693_H | 30 | #ifndef __LINUX_MFD_MAX77693_H |
| 31 | #define __LINUX_MFD_MAX77693_H | 31 | #define __LINUX_MFD_MAX77693_H |
| 32 | 32 | ||
| 33 | struct max77693_reg_data { | ||
| 34 | u8 addr; | ||
| 35 | u8 data; | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct max77693_muic_platform_data { | ||
| 39 | struct max77693_reg_data *init_data; | ||
| 40 | int num_init_data; | ||
| 41 | }; | ||
| 42 | |||
| 33 | struct max77693_platform_data { | 43 | struct max77693_platform_data { |
| 34 | int wakeup; | 44 | int wakeup; |
| 45 | |||
| 46 | /* muic data */ | ||
| 47 | struct max77693_muic_platform_data *muic_data; | ||
| 35 | }; | 48 | }; |
| 36 | #endif /* __LINUX_MFD_MAX77693_H */ | 49 | #endif /* __LINUX_MFD_MAX77693_H */ |
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index cf80f7e5277f..250a4acddb2b 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h | |||
| @@ -12,34 +12,27 @@ struct percpu_rw_semaphore { | |||
| 12 | struct mutex mtx; | 12 | struct mutex mtx; |
| 13 | }; | 13 | }; |
| 14 | 14 | ||
| 15 | #define light_mb() barrier() | ||
| 16 | #define heavy_mb() synchronize_sched() | ||
| 17 | |||
| 15 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) | 18 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) |
| 16 | { | 19 | { |
| 17 | rcu_read_lock(); | 20 | rcu_read_lock_sched(); |
| 18 | if (unlikely(p->locked)) { | 21 | if (unlikely(p->locked)) { |
| 19 | rcu_read_unlock(); | 22 | rcu_read_unlock_sched(); |
| 20 | mutex_lock(&p->mtx); | 23 | mutex_lock(&p->mtx); |
| 21 | this_cpu_inc(*p->counters); | 24 | this_cpu_inc(*p->counters); |
| 22 | mutex_unlock(&p->mtx); | 25 | mutex_unlock(&p->mtx); |
| 23 | return; | 26 | return; |
| 24 | } | 27 | } |
| 25 | this_cpu_inc(*p->counters); | 28 | this_cpu_inc(*p->counters); |
| 26 | rcu_read_unlock(); | 29 | rcu_read_unlock_sched(); |
| 30 | light_mb(); /* A, between read of p->locked and read of data, paired with D */ | ||
| 27 | } | 31 | } |
| 28 | 32 | ||
| 29 | static inline void percpu_up_read(struct percpu_rw_semaphore *p) | 33 | static inline void percpu_up_read(struct percpu_rw_semaphore *p) |
| 30 | { | 34 | { |
| 31 | /* | 35 | light_mb(); /* B, between read of the data and write to p->counter, paired with C */ |
| 32 | * On X86, write operation in this_cpu_dec serves as a memory unlock | ||
| 33 | * barrier (i.e. memory accesses may be moved before the write, but | ||
| 34 | * no memory accesses are moved past the write). | ||
| 35 | * On other architectures this may not be the case, so we need smp_mb() | ||
| 36 | * there. | ||
| 37 | */ | ||
| 38 | #if defined(CONFIG_X86) && (!defined(CONFIG_X86_PPRO_FENCE) && !defined(CONFIG_X86_OOSTORE)) | ||
| 39 | barrier(); | ||
| 40 | #else | ||
| 41 | smp_mb(); | ||
| 42 | #endif | ||
| 43 | this_cpu_dec(*p->counters); | 36 | this_cpu_dec(*p->counters); |
| 44 | } | 37 | } |
| 45 | 38 | ||
| @@ -58,14 +51,15 @@ static inline void percpu_down_write(struct percpu_rw_semaphore *p) | |||
| 58 | { | 51 | { |
| 59 | mutex_lock(&p->mtx); | 52 | mutex_lock(&p->mtx); |
| 60 | p->locked = true; | 53 | p->locked = true; |
| 61 | synchronize_rcu(); | 54 | synchronize_sched(); /* make sure that all readers exit the rcu_read_lock_sched region */ |
| 62 | while (__percpu_count(p->counters)) | 55 | while (__percpu_count(p->counters)) |
| 63 | msleep(1); | 56 | msleep(1); |
| 64 | smp_rmb(); /* paired with smp_mb() in percpu_sem_up_read() */ | 57 | heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ |
| 65 | } | 58 | } |
| 66 | 59 | ||
| 67 | static inline void percpu_up_write(struct percpu_rw_semaphore *p) | 60 | static inline void percpu_up_write(struct percpu_rw_semaphore *p) |
| 68 | { | 61 | { |
| 62 | heavy_mb(); /* D, between write to data and write to p->locked, paired with A */ | ||
| 69 | p->locked = false; | 63 | p->locked = false; |
| 70 | mutex_unlock(&p->mtx); | 64 | mutex_unlock(&p->mtx); |
| 71 | } | 65 | } |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2e902359aee5..6bfb2faa0b19 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -803,12 +803,16 @@ static inline void perf_event_task_tick(void) { } | |||
| 803 | do { \ | 803 | do { \ |
| 804 | static struct notifier_block fn##_nb __cpuinitdata = \ | 804 | static struct notifier_block fn##_nb __cpuinitdata = \ |
| 805 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ | 805 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ |
| 806 | unsigned long cpu = smp_processor_id(); \ | ||
| 807 | unsigned long flags; \ | ||
| 806 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ | 808 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ |
| 807 | (void *)(unsigned long)smp_processor_id()); \ | 809 | (void *)(unsigned long)cpu); \ |
| 810 | local_irq_save(flags); \ | ||
| 808 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ | 811 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ |
| 809 | (void *)(unsigned long)smp_processor_id()); \ | 812 | (void *)(unsigned long)cpu); \ |
| 813 | local_irq_restore(flags); \ | ||
| 810 | fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ | 814 | fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ |
| 811 | (void *)(unsigned long)smp_processor_id()); \ | 815 | (void *)(unsigned long)cpu); \ |
| 812 | register_cpu_notifier(&fn##_nb); \ | 816 | register_cpu_notifier(&fn##_nb); \ |
| 813 | } while (0) | 817 | } while (0) |
| 814 | 818 | ||
diff --git a/include/linux/raid/Kbuild b/include/linux/raid/Kbuild index 2415a64c5e51..e69de29bb2d1 100644 --- a/include/linux/raid/Kbuild +++ b/include/linux/raid/Kbuild | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | header-y += md_p.h | ||
| 2 | header-y += md_u.h | ||
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h deleted file mode 100644 index ee753536ab70..000000000000 --- a/include/linux/raid/md_p.h +++ /dev/null | |||
| @@ -1,301 +0,0 @@ | |||
| 1 | /* | ||
| 2 | md_p.h : physical layout of Linux RAID devices | ||
| 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_P_H | ||
| 16 | #define _MD_P_H | ||
| 17 | |||
| 18 | #include <linux/types.h> | ||
| 19 | |||
| 20 | /* | ||
| 21 | * RAID superblock. | ||
| 22 | * | ||
| 23 | * The RAID superblock maintains some statistics on each RAID configuration. | ||
| 24 | * Each real device in the RAID set contains it near the end of the device. | ||
| 25 | * Some of the ideas are copied from the ext2fs implementation. | ||
| 26 | * | ||
| 27 | * We currently use 4096 bytes as follows: | ||
| 28 | * | ||
| 29 | * word offset function | ||
| 30 | * | ||
| 31 | * 0 - 31 Constant generic RAID device information. | ||
| 32 | * 32 - 63 Generic state information. | ||
| 33 | * 64 - 127 Personality specific information. | ||
| 34 | * 128 - 511 12 32-words descriptors of the disks in the raid set. | ||
| 35 | * 512 - 911 Reserved. | ||
| 36 | * 912 - 1023 Disk specific descriptor. | ||
| 37 | */ | ||
| 38 | |||
| 39 | /* | ||
| 40 | * If x is the real device size in bytes, we return an apparent size of: | ||
| 41 | * | ||
| 42 | * y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES | ||
| 43 | * | ||
| 44 | * and place the 4kB superblock at offset y. | ||
| 45 | */ | ||
| 46 | #define MD_RESERVED_BYTES (64 * 1024) | ||
| 47 | #define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512) | ||
| 48 | |||
| 49 | #define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) | ||
| 50 | |||
| 51 | #define MD_SB_BYTES 4096 | ||
| 52 | #define MD_SB_WORDS (MD_SB_BYTES / 4) | ||
| 53 | #define MD_SB_SECTORS (MD_SB_BYTES / 512) | ||
| 54 | |||
| 55 | /* | ||
| 56 | * The following are counted in 32-bit words | ||
| 57 | */ | ||
| 58 | #define MD_SB_GENERIC_OFFSET 0 | ||
| 59 | #define MD_SB_PERSONALITY_OFFSET 64 | ||
| 60 | #define MD_SB_DISKS_OFFSET 128 | ||
| 61 | #define MD_SB_DESCRIPTOR_OFFSET 992 | ||
| 62 | |||
| 63 | #define MD_SB_GENERIC_CONSTANT_WORDS 32 | ||
| 64 | #define MD_SB_GENERIC_STATE_WORDS 32 | ||
| 65 | #define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS) | ||
| 66 | #define MD_SB_PERSONALITY_WORDS 64 | ||
| 67 | #define MD_SB_DESCRIPTOR_WORDS 32 | ||
| 68 | #define MD_SB_DISKS 27 | ||
| 69 | #define MD_SB_DISKS_WORDS (MD_SB_DISKS*MD_SB_DESCRIPTOR_WORDS) | ||
| 70 | #define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS) | ||
| 71 | #define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS) | ||
| 72 | |||
| 73 | /* | ||
| 74 | * Device "operational" state bits | ||
| 75 | */ | ||
| 76 | #define MD_DISK_FAULTY 0 /* disk is faulty / operational */ | ||
| 77 | #define MD_DISK_ACTIVE 1 /* disk is running or spare disk */ | ||
| 78 | #define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ | ||
| 79 | #define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */ | ||
| 80 | |||
| 81 | #define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config. | ||
| 82 | * read requests will only be sent here in | ||
| 83 | * dire need | ||
| 84 | */ | ||
| 85 | |||
| 86 | typedef struct mdp_device_descriptor_s { | ||
| 87 | __u32 number; /* 0 Device number in the entire set */ | ||
| 88 | __u32 major; /* 1 Device major number */ | ||
| 89 | __u32 minor; /* 2 Device minor number */ | ||
| 90 | __u32 raid_disk; /* 3 The role of the device in the raid set */ | ||
| 91 | __u32 state; /* 4 Operational state */ | ||
| 92 | __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5]; | ||
| 93 | } mdp_disk_t; | ||
| 94 | |||
| 95 | #define MD_SB_MAGIC 0xa92b4efc | ||
| 96 | |||
| 97 | /* | ||
| 98 | * Superblock state bits | ||
| 99 | */ | ||
| 100 | #define MD_SB_CLEAN 0 | ||
| 101 | #define MD_SB_ERRORS 1 | ||
| 102 | |||
| 103 | #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ | ||
| 104 | |||
| 105 | /* | ||
| 106 | * Notes: | ||
| 107 | * - if an array is being reshaped (restriped) in order to change the | ||
| 108 | * the number of active devices in the array, 'raid_disks' will be | ||
| 109 | * the larger of the old and new numbers. 'delta_disks' will | ||
| 110 | * be the "new - old". So if +ve, raid_disks is the new value, and | ||
| 111 | * "raid_disks-delta_disks" is the old. If -ve, raid_disks is the | ||
| 112 | * old value and "raid_disks+delta_disks" is the new (smaller) value. | ||
| 113 | */ | ||
| 114 | |||
| 115 | |||
| 116 | typedef struct mdp_superblock_s { | ||
| 117 | /* | ||
| 118 | * Constant generic information | ||
| 119 | */ | ||
| 120 | __u32 md_magic; /* 0 MD identifier */ | ||
| 121 | __u32 major_version; /* 1 major version to which the set conforms */ | ||
| 122 | __u32 minor_version; /* 2 minor version ... */ | ||
| 123 | __u32 patch_version; /* 3 patchlevel version ... */ | ||
| 124 | __u32 gvalid_words; /* 4 Number of used words in this section */ | ||
| 125 | __u32 set_uuid0; /* 5 Raid set identifier */ | ||
| 126 | __u32 ctime; /* 6 Creation time */ | ||
| 127 | __u32 level; /* 7 Raid personality */ | ||
| 128 | __u32 size; /* 8 Apparent size of each individual disk */ | ||
| 129 | __u32 nr_disks; /* 9 total disks in the raid set */ | ||
| 130 | __u32 raid_disks; /* 10 disks in a fully functional raid set */ | ||
| 131 | __u32 md_minor; /* 11 preferred MD minor device number */ | ||
| 132 | __u32 not_persistent; /* 12 does it have a persistent superblock */ | ||
| 133 | __u32 set_uuid1; /* 13 Raid set identifier #2 */ | ||
| 134 | __u32 set_uuid2; /* 14 Raid set identifier #3 */ | ||
| 135 | __u32 set_uuid3; /* 15 Raid set identifier #4 */ | ||
| 136 | __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16]; | ||
| 137 | |||
| 138 | /* | ||
| 139 | * Generic state information | ||
| 140 | */ | ||
| 141 | __u32 utime; /* 0 Superblock update time */ | ||
| 142 | __u32 state; /* 1 State bits (clean, ...) */ | ||
| 143 | __u32 active_disks; /* 2 Number of currently active disks */ | ||
| 144 | __u32 working_disks; /* 3 Number of working disks */ | ||
| 145 | __u32 failed_disks; /* 4 Number of failed disks */ | ||
| 146 | __u32 spare_disks; /* 5 Number of spare disks */ | ||
| 147 | __u32 sb_csum; /* 6 checksum of the whole superblock */ | ||
| 148 | #ifdef __BIG_ENDIAN | ||
| 149 | __u32 events_hi; /* 7 high-order of superblock update count */ | ||
| 150 | __u32 events_lo; /* 8 low-order of superblock update count */ | ||
| 151 | __u32 cp_events_hi; /* 9 high-order of checkpoint update count */ | ||
| 152 | __u32 cp_events_lo; /* 10 low-order of checkpoint update count */ | ||
| 153 | #else | ||
| 154 | __u32 events_lo; /* 7 low-order of superblock update count */ | ||
| 155 | __u32 events_hi; /* 8 high-order of superblock update count */ | ||
| 156 | __u32 cp_events_lo; /* 9 low-order of checkpoint update count */ | ||
| 157 | __u32 cp_events_hi; /* 10 high-order of checkpoint update count */ | ||
| 158 | #endif | ||
| 159 | __u32 recovery_cp; /* 11 recovery checkpoint sector count */ | ||
| 160 | /* There are only valid for minor_version > 90 */ | ||
| 161 | __u64 reshape_position; /* 12,13 next address in array-space for reshape */ | ||
| 162 | __u32 new_level; /* 14 new level we are reshaping to */ | ||
| 163 | __u32 delta_disks; /* 15 change in number of raid_disks */ | ||
| 164 | __u32 new_layout; /* 16 new layout */ | ||
| 165 | __u32 new_chunk; /* 17 new chunk size (bytes) */ | ||
| 166 | __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18]; | ||
| 167 | |||
| 168 | /* | ||
| 169 | * Personality information | ||
| 170 | */ | ||
| 171 | __u32 layout; /* 0 the array's physical layout */ | ||
| 172 | __u32 chunk_size; /* 1 chunk size in bytes */ | ||
| 173 | __u32 root_pv; /* 2 LV root PV */ | ||
| 174 | __u32 root_block; /* 3 LV root block */ | ||
| 175 | __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4]; | ||
| 176 | |||
| 177 | /* | ||
| 178 | * Disks information | ||
| 179 | */ | ||
| 180 | mdp_disk_t disks[MD_SB_DISKS]; | ||
| 181 | |||
| 182 | /* | ||
| 183 | * Reserved | ||
| 184 | */ | ||
| 185 | __u32 reserved[MD_SB_RESERVED_WORDS]; | ||
| 186 | |||
| 187 | /* | ||
| 188 | * Active descriptor | ||
| 189 | */ | ||
| 190 | mdp_disk_t this_disk; | ||
| 191 | |||
| 192 | } mdp_super_t; | ||
| 193 | |||
| 194 | static inline __u64 md_event(mdp_super_t *sb) { | ||
| 195 | __u64 ev = sb->events_hi; | ||
| 196 | return (ev<<32)| sb->events_lo; | ||
| 197 | } | ||
| 198 | |||
| 199 | #define MD_SUPERBLOCK_1_TIME_SEC_MASK ((1ULL<<40) - 1) | ||
| 200 | |||
| 201 | /* | ||
| 202 | * The version-1 superblock : | ||
| 203 | * All numeric fields are little-endian. | ||
| 204 | * | ||
| 205 | * total size: 256 bytes plus 2 per device. | ||
| 206 | * 1K allows 384 devices. | ||
| 207 | */ | ||
| 208 | struct mdp_superblock_1 { | ||
| 209 | /* constant array information - 128 bytes */ | ||
| 210 | __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ | ||
| 211 | __le32 major_version; /* 1 */ | ||
| 212 | __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ | ||
| 213 | __le32 pad0; /* always set to 0 when writing */ | ||
| 214 | |||
| 215 | __u8 set_uuid[16]; /* user-space generated. */ | ||
| 216 | char set_name[32]; /* set and interpreted by user-space */ | ||
| 217 | |||
| 218 | __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ | ||
| 219 | __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ | ||
| 220 | __le32 layout; /* only for raid5 and raid10 currently */ | ||
| 221 | __le64 size; /* used size of component devices, in 512byte sectors */ | ||
| 222 | |||
| 223 | __le32 chunksize; /* in 512byte sectors */ | ||
| 224 | __le32 raid_disks; | ||
| 225 | __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts | ||
| 226 | * NOTE: signed, so bitmap can be before superblock | ||
| 227 | * only meaningful of feature_map[0] is set. | ||
| 228 | */ | ||
| 229 | |||
| 230 | /* These are only valid with feature bit '4' */ | ||
| 231 | __le32 new_level; /* new level we are reshaping to */ | ||
| 232 | __le64 reshape_position; /* next address in array-space for reshape */ | ||
| 233 | __le32 delta_disks; /* change in number of raid_disks */ | ||
| 234 | __le32 new_layout; /* new layout */ | ||
| 235 | __le32 new_chunk; /* new chunk size (512byte sectors) */ | ||
| 236 | __le32 new_offset; /* signed number to add to data_offset in new | ||
| 237 | * layout. 0 == no-change. This can be | ||
| 238 | * different on each device in the array. | ||
| 239 | */ | ||
| 240 | |||
| 241 | /* constant this-device information - 64 bytes */ | ||
| 242 | __le64 data_offset; /* sector start of data, often 0 */ | ||
| 243 | __le64 data_size; /* sectors in this device that can be used for data */ | ||
| 244 | __le64 super_offset; /* sector start of this superblock */ | ||
| 245 | __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ | ||
| 246 | __le32 dev_number; /* permanent identifier of this device - not role in raid */ | ||
| 247 | __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ | ||
| 248 | __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ | ||
| 249 | __u8 devflags; /* per-device flags. Only one defined...*/ | ||
| 250 | #define WriteMostly1 1 /* mask for writemostly flag in above */ | ||
| 251 | /* Bad block log. If there are any bad blocks the feature flag is set. | ||
| 252 | * If offset and size are non-zero, that space is reserved and available | ||
| 253 | */ | ||
| 254 | __u8 bblog_shift; /* shift from sectors to block size */ | ||
| 255 | __le16 bblog_size; /* number of sectors reserved for list */ | ||
| 256 | __le32 bblog_offset; /* sector offset from superblock to bblog, | ||
| 257 | * signed - not unsigned */ | ||
| 258 | |||
| 259 | /* array state information - 64 bytes */ | ||
| 260 | __le64 utime; /* 40 bits second, 24 bits microseconds */ | ||
| 261 | __le64 events; /* incremented when superblock updated */ | ||
| 262 | __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ | ||
| 263 | __le32 sb_csum; /* checksum up to devs[max_dev] */ | ||
| 264 | __le32 max_dev; /* size of devs[] array to consider */ | ||
| 265 | __u8 pad3[64-32]; /* set to 0 when writing */ | ||
| 266 | |||
| 267 | /* device state information. Indexed by dev_number. | ||
| 268 | * 2 bytes per device | ||
| 269 | * Note there are no per-device state flags. State information is rolled | ||
| 270 | * into the 'roles' value. If a device is spare or faulty, then it doesn't | ||
| 271 | * have a meaningful role. | ||
| 272 | */ | ||
| 273 | __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ | ||
| 274 | }; | ||
| 275 | |||
| 276 | /* feature_map bits */ | ||
| 277 | #define MD_FEATURE_BITMAP_OFFSET 1 | ||
| 278 | #define MD_FEATURE_RECOVERY_OFFSET 2 /* recovery_offset is present and | ||
| 279 | * must be honoured | ||
| 280 | */ | ||
| 281 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | ||
| 282 | #define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */ | ||
| 283 | #define MD_FEATURE_REPLACEMENT 16 /* This device is replacing an | ||
| 284 | * active device with same 'role'. | ||
| 285 | * 'recovery_offset' is also set. | ||
| 286 | */ | ||
| 287 | #define MD_FEATURE_RESHAPE_BACKWARDS 32 /* Reshape doesn't change number | ||
| 288 | * of devices, but is going | ||
| 289 | * backwards anyway. | ||
| 290 | */ | ||
| 291 | #define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */ | ||
| 292 | #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ | ||
| 293 | |MD_FEATURE_RECOVERY_OFFSET \ | ||
| 294 | |MD_FEATURE_RESHAPE_ACTIVE \ | ||
| 295 | |MD_FEATURE_BAD_BLOCKS \ | ||
| 296 | |MD_FEATURE_REPLACEMENT \ | ||
| 297 | |MD_FEATURE_RESHAPE_BACKWARDS \ | ||
| 298 | |MD_FEATURE_NEW_OFFSET \ | ||
| 299 | ) | ||
| 300 | |||
| 301 | #endif | ||
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index fb1abb3367e9..358c04bfbe2a 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h | |||
| @@ -11,149 +11,10 @@ | |||
| 11 | (for example /usr/src/linux/COPYING); if not, write to the Free | 11 | (for example /usr/src/linux/COPYING); if not, write to the Free |
| 12 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 12 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 13 | */ | 13 | */ |
| 14 | |||
| 15 | #ifndef _MD_U_H | 14 | #ifndef _MD_U_H |
| 16 | #define _MD_U_H | 15 | #define _MD_U_H |
| 17 | 16 | ||
| 18 | /* | 17 | #include <uapi/linux/raid/md_u.h> |
| 19 | * Different major versions are not compatible. | ||
| 20 | * Different minor versions are only downward compatible. | ||
| 21 | * Different patchlevel versions are downward and upward compatible. | ||
| 22 | */ | ||
| 23 | #define MD_MAJOR_VERSION 0 | ||
| 24 | #define MD_MINOR_VERSION 90 | ||
| 25 | /* | ||
| 26 | * MD_PATCHLEVEL_VERSION indicates kernel functionality. | ||
| 27 | * >=1 means different superblock formats are selectable using SET_ARRAY_INFO | ||
| 28 | * and major_version/minor_version accordingly | ||
| 29 | * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT | ||
| 30 | * in the super status byte | ||
| 31 | * >=3 means that bitmap superblock version 4 is supported, which uses | ||
| 32 | * little-ending representation rather than host-endian | ||
| 33 | */ | ||
| 34 | #define MD_PATCHLEVEL_VERSION 3 | ||
| 35 | |||
| 36 | /* ioctls */ | ||
| 37 | |||
| 38 | /* status */ | ||
| 39 | #define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t) | ||
| 40 | #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t) | ||
| 41 | #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) | ||
| 42 | #define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) | ||
| 43 | #define RAID_AUTORUN _IO (MD_MAJOR, 0x14) | ||
| 44 | #define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t) | ||
| 45 | |||
| 46 | /* configuration */ | ||
| 47 | #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) | ||
| 48 | #define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t) | ||
| 49 | #define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22) | ||
| 50 | #define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t) | ||
| 51 | #define SET_DISK_INFO _IO (MD_MAJOR, 0x24) | ||
| 52 | #define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25) | ||
| 53 | #define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26) | ||
| 54 | #define PROTECT_ARRAY _IO (MD_MAJOR, 0x27) | ||
| 55 | #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) | ||
| 56 | #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) | ||
| 57 | #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) | ||
| 58 | #define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int) | ||
| 59 | 18 | ||
| 60 | /* usage */ | ||
| 61 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) | ||
| 62 | /* 0x31 was START_ARRAY */ | ||
| 63 | #define STOP_ARRAY _IO (MD_MAJOR, 0x32) | ||
| 64 | #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) | ||
| 65 | #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) | ||
| 66 | |||
| 67 | /* 63 partitions with the alternate major number (mdp) */ | ||
| 68 | #define MdpMinorShift 6 | ||
| 69 | #ifdef __KERNEL__ | ||
| 70 | extern int mdp_major; | 19 | extern int mdp_major; |
| 71 | #endif | ||
| 72 | |||
| 73 | typedef struct mdu_version_s { | ||
| 74 | int major; | ||
| 75 | int minor; | ||
| 76 | int patchlevel; | ||
| 77 | } mdu_version_t; | ||
| 78 | |||
| 79 | typedef struct mdu_array_info_s { | ||
| 80 | /* | ||
| 81 | * Generic constant information | ||
| 82 | */ | ||
| 83 | int major_version; | ||
| 84 | int minor_version; | ||
| 85 | int patch_version; | ||
| 86 | int ctime; | ||
| 87 | int level; | ||
| 88 | int size; | ||
| 89 | int nr_disks; | ||
| 90 | int raid_disks; | ||
| 91 | int md_minor; | ||
| 92 | int not_persistent; | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Generic state information | ||
| 96 | */ | ||
| 97 | int utime; /* 0 Superblock update time */ | ||
| 98 | int state; /* 1 State bits (clean, ...) */ | ||
| 99 | int active_disks; /* 2 Number of currently active disks */ | ||
| 100 | int working_disks; /* 3 Number of working disks */ | ||
| 101 | int failed_disks; /* 4 Number of failed disks */ | ||
| 102 | int spare_disks; /* 5 Number of spare disks */ | ||
| 103 | |||
| 104 | /* | ||
| 105 | * Personality information | ||
| 106 | */ | ||
| 107 | int layout; /* 0 the array's physical layout */ | ||
| 108 | int chunk_size; /* 1 chunk size in bytes */ | ||
| 109 | |||
| 110 | } mdu_array_info_t; | ||
| 111 | |||
| 112 | /* non-obvious values for 'level' */ | ||
| 113 | #define LEVEL_MULTIPATH (-4) | ||
| 114 | #define LEVEL_LINEAR (-1) | ||
| 115 | #define LEVEL_FAULTY (-5) | ||
| 116 | |||
| 117 | /* we need a value for 'no level specified' and 0 | ||
| 118 | * means 'raid0', so we need something else. This is | ||
| 119 | * for internal use only | ||
| 120 | */ | ||
| 121 | #define LEVEL_NONE (-1000000) | ||
| 122 | |||
| 123 | typedef struct mdu_disk_info_s { | ||
| 124 | /* | ||
| 125 | * configuration/status of one particular disk | ||
| 126 | */ | ||
| 127 | int number; | ||
| 128 | int major; | ||
| 129 | int minor; | ||
| 130 | int raid_disk; | ||
| 131 | int state; | ||
| 132 | |||
| 133 | } mdu_disk_info_t; | ||
| 134 | |||
| 135 | typedef struct mdu_start_info_s { | ||
| 136 | /* | ||
| 137 | * configuration/status of one particular disk | ||
| 138 | */ | ||
| 139 | int major; | ||
| 140 | int minor; | ||
| 141 | int raid_disk; | ||
| 142 | int state; | ||
| 143 | |||
| 144 | } mdu_start_info_t; | ||
| 145 | |||
| 146 | typedef struct mdu_bitmap_file_s | ||
| 147 | { | ||
| 148 | char pathname[4096]; | ||
| 149 | } mdu_bitmap_file_t; | ||
| 150 | |||
| 151 | typedef struct mdu_param_s | ||
| 152 | { | ||
| 153 | int personality; /* 1,2,3,4 */ | ||
| 154 | int chunk_size; /* in bytes */ | ||
| 155 | int max_fault; /* unused for now */ | ||
| 156 | } mdu_param_t; | ||
| 157 | |||
| 158 | #endif | 20 | #endif |
| 159 | |||
diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h index 214caa33433b..2ac60c9cf644 100644 --- a/include/linux/rbtree_augmented.h +++ b/include/linux/rbtree_augmented.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #ifndef _LINUX_RBTREE_AUGMENTED_H | 24 | #ifndef _LINUX_RBTREE_AUGMENTED_H |
| 25 | #define _LINUX_RBTREE_AUGMENTED_H | 25 | #define _LINUX_RBTREE_AUGMENTED_H |
| 26 | 26 | ||
| 27 | #include <linux/compiler.h> | ||
| 27 | #include <linux/rbtree.h> | 28 | #include <linux/rbtree.h> |
| 28 | 29 | ||
| 29 | /* | 30 | /* |
diff --git a/include/linux/spi/tsc2005.h b/include/linux/spi/tsc2005.h index d9b0c84220c7..8f721e465e05 100644 --- a/include/linux/spi/tsc2005.h +++ b/include/linux/spi/tsc2005.h | |||
| @@ -3,8 +3,6 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 Nokia Corporation | 4 | * Copyright (C) 2009-2010 Nokia Corporation |
| 5 | * | 5 | * |
| 6 | * Contact: Aaro Koskinen <aaro.koskinen@nokia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | 6 | * 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 | 7 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8a7fc4be2d75..60b7aac15e0e 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -191,7 +191,8 @@ struct tcp_sock { | |||
| 191 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ | 191 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ |
| 192 | early_retrans_delayed:1, /* Delayed ER timer installed */ | 192 | early_retrans_delayed:1, /* Delayed ER timer installed */ |
| 193 | syn_data:1, /* SYN includes data */ | 193 | syn_data:1, /* SYN includes data */ |
| 194 | syn_fastopen:1; /* SYN includes Fast Open option */ | 194 | syn_fastopen:1, /* SYN includes Fast Open option */ |
| 195 | syn_data_acked:1;/* data in SYN is acked by SYN-ACK */ | ||
| 195 | 196 | ||
| 196 | /* RTT measurement */ | 197 | /* RTT measurement */ |
| 197 | u32 srtt; /* smoothed round trip time << 3 */ | 198 | u32 srtt; /* smoothed round trip time << 3 */ |
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index e6f0331e3d45..24594571c5a3 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
| @@ -35,16 +35,6 @@ struct inode; | |||
| 35 | # include <asm/uprobes.h> | 35 | # include <asm/uprobes.h> |
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
| 38 | /* flags that denote/change uprobes behaviour */ | ||
| 39 | |||
| 40 | /* Have a copy of original instruction */ | ||
| 41 | #define UPROBE_COPY_INSN 0x1 | ||
| 42 | |||
| 43 | /* Dont run handlers when first register/ last unregister in progress*/ | ||
| 44 | #define UPROBE_RUN_HANDLER 0x2 | ||
| 45 | /* Can skip singlestep */ | ||
| 46 | #define UPROBE_SKIP_SSTEP 0x4 | ||
| 47 | |||
| 48 | struct uprobe_consumer { | 38 | struct uprobe_consumer { |
| 49 | int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); | 39 | int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); |
| 50 | /* | 40 | /* |
| @@ -59,7 +49,6 @@ struct uprobe_consumer { | |||
| 59 | #ifdef CONFIG_UPROBES | 49 | #ifdef CONFIG_UPROBES |
| 60 | enum uprobe_task_state { | 50 | enum uprobe_task_state { |
| 61 | UTASK_RUNNING, | 51 | UTASK_RUNNING, |
| 62 | UTASK_BP_HIT, | ||
| 63 | UTASK_SSTEP, | 52 | UTASK_SSTEP, |
| 64 | UTASK_SSTEP_ACK, | 53 | UTASK_SSTEP_ACK, |
| 65 | UTASK_SSTEP_TRAPPED, | 54 | UTASK_SSTEP_TRAPPED, |
