diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hashtable.h | 192 | ||||
| -rw-r--r-- | include/linux/kvm_host.h | 15 | ||||
| -rw-r--r-- | include/linux/raid/Kbuild | 2 | ||||
| -rw-r--r-- | include/linux/raid/md_u.h | 141 | ||||
| -rw-r--r-- | include/sound/core.h | 3 | ||||
| -rw-r--r-- | include/trace/events/xen.h | 8 | ||||
| -rw-r--r-- | include/uapi/linux/raid/Kbuild | 2 | ||||
| -rw-r--r-- | include/uapi/linux/raid/md_p.h (renamed from include/linux/raid/md_p.h) | 0 | ||||
| -rw-r--r-- | include/uapi/linux/raid/md_u.h | 155 |
9 files changed, 363 insertions, 155 deletions
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/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/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_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/sound/core.h b/include/sound/core.h index bc056687f647..93896ad1fcdd 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
| @@ -132,6 +132,7 @@ struct snd_card { | |||
| 132 | int shutdown; /* this card is going down */ | 132 | int shutdown; /* this card is going down */ |
| 133 | int free_on_last_close; /* free in context of file_release */ | 133 | int free_on_last_close; /* free in context of file_release */ |
| 134 | wait_queue_head_t shutdown_sleep; | 134 | wait_queue_head_t shutdown_sleep; |
| 135 | atomic_t refcount; /* refcount for disconnection */ | ||
| 135 | struct device *dev; /* device assigned to this card */ | 136 | struct device *dev; /* device assigned to this card */ |
| 136 | struct device *card_dev; /* cardX object for sysfs */ | 137 | struct device *card_dev; /* cardX object for sysfs */ |
| 137 | 138 | ||
| @@ -189,6 +190,7 @@ struct snd_minor { | |||
| 189 | const struct file_operations *f_ops; /* file operations */ | 190 | const struct file_operations *f_ops; /* file operations */ |
| 190 | void *private_data; /* private data for f_ops->open */ | 191 | void *private_data; /* private data for f_ops->open */ |
| 191 | struct device *dev; /* device for sysfs */ | 192 | struct device *dev; /* device for sysfs */ |
| 193 | struct snd_card *card_ptr; /* assigned card instance */ | ||
| 192 | }; | 194 | }; |
| 193 | 195 | ||
| 194 | /* return a device pointer linked to each sound device as a parent */ | 196 | /* return a device pointer linked to each sound device as a parent */ |
| @@ -295,6 +297,7 @@ int snd_card_info_done(void); | |||
| 295 | int snd_component_add(struct snd_card *card, const char *component); | 297 | int snd_component_add(struct snd_card *card, const char *component); |
| 296 | int snd_card_file_add(struct snd_card *card, struct file *file); | 298 | int snd_card_file_add(struct snd_card *card, struct file *file); |
| 297 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 299 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
| 300 | void snd_card_unref(struct snd_card *card); | ||
| 298 | 301 | ||
| 299 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) | 302 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) |
| 300 | 303 | ||
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index 15ba03bdd7c6..d06b6da5c1e3 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h | |||
| @@ -377,6 +377,14 @@ DECLARE_EVENT_CLASS(xen_mmu_pgd, | |||
| 377 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin); | 377 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin); |
| 378 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin); | 378 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin); |
| 379 | 379 | ||
| 380 | TRACE_EVENT(xen_mmu_flush_tlb_all, | ||
| 381 | TP_PROTO(int x), | ||
| 382 | TP_ARGS(x), | ||
| 383 | TP_STRUCT__entry(__array(char, x, 0)), | ||
| 384 | TP_fast_assign((void)x), | ||
| 385 | TP_printk("%s", "") | ||
| 386 | ); | ||
| 387 | |||
| 380 | TRACE_EVENT(xen_mmu_flush_tlb, | 388 | TRACE_EVENT(xen_mmu_flush_tlb, |
| 381 | TP_PROTO(int x), | 389 | TP_PROTO(int x), |
| 382 | TP_ARGS(x), | 390 | TP_ARGS(x), |
diff --git a/include/uapi/linux/raid/Kbuild b/include/uapi/linux/raid/Kbuild index aafaa5aa54d4..e2c3d25405d7 100644 --- a/include/uapi/linux/raid/Kbuild +++ b/include/uapi/linux/raid/Kbuild | |||
| @@ -1 +1,3 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += md_p.h | ||
| 3 | header-y += md_u.h | ||
diff --git a/include/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h index ee753536ab70..ee753536ab70 100644 --- a/include/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h | |||
diff --git a/include/uapi/linux/raid/md_u.h b/include/uapi/linux/raid/md_u.h new file mode 100644 index 000000000000..4133e744e4e6 --- /dev/null +++ b/include/uapi/linux/raid/md_u.h | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | /* | ||
| 2 | md_u.h : user <=> kernel API between Linux raidtools and RAID drivers | ||
| 3 | Copyright (C) 1998 Ingo Molnar | ||
| 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 _UAPI_MD_U_H | ||
| 16 | #define _UAPI_MD_U_H | ||
| 17 | |||
| 18 | /* | ||
| 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 | |||
| 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 | |||
| 70 | typedef struct mdu_version_s { | ||
| 71 | int major; | ||
| 72 | int minor; | ||
| 73 | int patchlevel; | ||
| 74 | } mdu_version_t; | ||
| 75 | |||
| 76 | typedef struct mdu_array_info_s { | ||
| 77 | /* | ||
| 78 | * Generic constant information | ||
| 79 | */ | ||
| 80 | int major_version; | ||
| 81 | int minor_version; | ||
| 82 | int patch_version; | ||
| 83 | int ctime; | ||
| 84 | int level; | ||
| 85 | int size; | ||
| 86 | int nr_disks; | ||
| 87 | int raid_disks; | ||
| 88 | int md_minor; | ||
| 89 | int not_persistent; | ||
| 90 | |||
| 91 | /* | ||
| 92 | * Generic state information | ||
| 93 | */ | ||
| 94 | int utime; /* 0 Superblock update time */ | ||
| 95 | int state; /* 1 State bits (clean, ...) */ | ||
| 96 | int active_disks; /* 2 Number of currently active disks */ | ||
| 97 | int working_disks; /* 3 Number of working disks */ | ||
| 98 | int failed_disks; /* 4 Number of failed disks */ | ||
| 99 | int spare_disks; /* 5 Number of spare disks */ | ||
| 100 | |||
| 101 | /* | ||
| 102 | * Personality information | ||
| 103 | */ | ||
| 104 | int layout; /* 0 the array's physical layout */ | ||
| 105 | int chunk_size; /* 1 chunk size in bytes */ | ||
| 106 | |||
| 107 | } mdu_array_info_t; | ||
| 108 | |||
| 109 | /* non-obvious values for 'level' */ | ||
| 110 | #define LEVEL_MULTIPATH (-4) | ||
| 111 | #define LEVEL_LINEAR (-1) | ||
| 112 | #define LEVEL_FAULTY (-5) | ||
| 113 | |||
| 114 | /* we need a value for 'no level specified' and 0 | ||
| 115 | * means 'raid0', so we need something else. This is | ||
| 116 | * for internal use only | ||
| 117 | */ | ||
| 118 | #define LEVEL_NONE (-1000000) | ||
| 119 | |||
| 120 | typedef struct mdu_disk_info_s { | ||
| 121 | /* | ||
| 122 | * configuration/status of one particular disk | ||
| 123 | */ | ||
| 124 | int number; | ||
| 125 | int major; | ||
| 126 | int minor; | ||
| 127 | int raid_disk; | ||
| 128 | int state; | ||
| 129 | |||
| 130 | } mdu_disk_info_t; | ||
| 131 | |||
| 132 | typedef struct mdu_start_info_s { | ||
| 133 | /* | ||
| 134 | * configuration/status of one particular disk | ||
| 135 | */ | ||
| 136 | int major; | ||
| 137 | int minor; | ||
| 138 | int raid_disk; | ||
| 139 | int state; | ||
| 140 | |||
| 141 | } mdu_start_info_t; | ||
| 142 | |||
| 143 | typedef struct mdu_bitmap_file_s | ||
| 144 | { | ||
| 145 | char pathname[4096]; | ||
| 146 | } mdu_bitmap_file_t; | ||
| 147 | |||
| 148 | typedef struct mdu_param_s | ||
| 149 | { | ||
| 150 | int personality; /* 1,2,3,4 */ | ||
| 151 | int chunk_size; /* in bytes */ | ||
| 152 | int max_fault; /* unused for now */ | ||
| 153 | } mdu_param_t; | ||
| 154 | |||
| 155 | #endif /* _UAPI_MD_U_H */ | ||
