Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 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 _LINUX_BCACHE_H |
| 20 | #define _LINUX_BCACHE_H |
| 21 | #include <asm/types.h> |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 22 | #define BITMASK(name,type,field,offset,size) static inline __u64 name(const type * k) \ |
| 23 | { return(k->field >> offset) & ~(~0ULL << size); } static inline void SET_ ##name(type * k, __u64 v) \ |
| 24 | { k->field &= ~(~(~0ULL << size) << offset); k->field |= (v & ~(~0ULL << size)) << offset; \ |
| 25 | } |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 26 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 27 | struct bkey { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 28 | __u64 high; |
| 29 | __u64 low; |
| 30 | __u64 ptr[]; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 31 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 32 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 33 | #define KEY_FIELD(name,field,offset,size) BITMASK(name, struct bkey, field, offset, size) |
| 34 | #define PTR_FIELD(name,offset,size) static inline __u64 name(const struct bkey * k, unsigned i) \ |
| 35 | { return(k->ptr[i] >> offset) & ~(~0ULL << size); } static inline void SET_ ##name(struct bkey * k, unsigned i, __u64 v) \ |
| 36 | { k->ptr[i] &= ~(~(~0ULL << size) << offset); k->ptr[i] |= (v & ~(~0ULL << size)) << offset; \ |
| 37 | } |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 38 | #define KEY_SIZE_BITS 16 |
| 39 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 40 | #define KEY_MAX_U64S 8 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 | #define KEY(inode,offset,size) \ |
| 42 | ((struct bkey) {.high = (1ULL << 63) | ((__u64) (size) << 20) | (inode),.low = (offset) \ |
| 43 | }) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 44 | #define ZERO_KEY KEY(0, 0, 0) |
| 45 | #define MAX_KEY_INODE (~(~0 << 20)) |
| 46 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 47 | #define MAX_KEY_OFFSET (~0ULL >> 1) |
| 48 | #define MAX_KEY KEY(MAX_KEY_INODE, MAX_KEY_OFFSET, 0) |
| 49 | #define KEY_START(k) (KEY_OFFSET(k) - KEY_SIZE(k)) |
| 50 | #define START_KEY(k) KEY(KEY_INODE(k), KEY_START(k), 0) |
| 51 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 52 | #define PTR_DEV_BITS 12 |
| 53 | #define PTR_CHECK_DEV ((1 << PTR_DEV_BITS) - 1) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | #define PTR(gen,offset,dev) ((((__u64) dev) << 51) | ((__u64) offset) << 8 | gen) |
| 55 | #define bkey_copy(_dest,_src) memcpy(_dest, _src, bkey_bytes(_src)) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 56 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 57 | #define BKEY_PAD 8 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 58 | #define BKEY_PADDED(key) union { struct bkey key; __u64 key ##_pad[BKEY_PAD]; } |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 59 | #define BCACHE_SB_VERSION_CDEV 0 |
| 60 | #define BCACHE_SB_VERSION_BDEV 1 |
| 61 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 62 | #define BCACHE_SB_VERSION_CDEV_WITH_UUID 3 |
| 63 | #define BCACHE_SB_VERSION_BDEV_WITH_OFFSET 4 |
| 64 | #define BCACHE_SB_MAX_VERSION 4 |
| 65 | #define SB_SECTOR 8 |
| 66 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 67 | #define SB_SIZE 4096 |
| 68 | #define SB_LABEL_SIZE 32 |
| 69 | #define SB_JOURNAL_BUCKETS 256U |
| 70 | #define MAX_CACHES_PER_SET 8 |
| 71 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 72 | #define BDEV_DATA_START_DEFAULT 16 |
| 73 | struct cache_sb { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 | __u64 csum; |
| 75 | __u64 offset; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 76 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 77 | __u64 version; |
| 78 | __u8 magic[16]; |
| 79 | __u8 uuid[16]; |
| 80 | union { |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 81 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 82 | __u8 set_uuid[16]; |
| 83 | __u64 set_magic; |
| 84 | }; |
| 85 | __u8 label[SB_LABEL_SIZE]; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 86 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | __u64 flags; |
| 88 | __u64 seq; |
| 89 | __u64 pad[8]; |
| 90 | union { |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 91 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 92 | struct { |
| 93 | __u64 nbuckets; |
| 94 | __u16 block_size; |
| 95 | __u16 bucket_size; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 96 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 97 | __u16 nr_in_set; |
| 98 | __u16 nr_this_dev; |
| 99 | }; |
| 100 | struct { |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 101 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 102 | __u64 data_offset; |
| 103 | }; |
| 104 | }; |
| 105 | __u32 last_mount; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 106 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 | __u16 first_bucket; |
| 108 | union { |
| 109 | __u16 njournal_buckets; |
| 110 | __u16 keys; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 111 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 112 | }; |
| 113 | __u64 d[SB_JOURNAL_BUCKETS]; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 114 | }; |
| 115 | #define CACHE_REPLACEMENT_LRU 0U |
| 116 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 117 | #define CACHE_REPLACEMENT_FIFO 1U |
| 118 | #define CACHE_REPLACEMENT_RANDOM 2U |
| 119 | #define CACHE_MODE_WRITETHROUGH 0U |
| 120 | #define CACHE_MODE_WRITEBACK 1U |
| 121 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 122 | #define CACHE_MODE_WRITEAROUND 2U |
| 123 | #define CACHE_MODE_NONE 3U |
| 124 | #define BDEV_STATE_NONE 0U |
| 125 | #define BDEV_STATE_CLEAN 1U |
| 126 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 127 | #define BDEV_STATE_DIRTY 2U |
| 128 | #define BDEV_STATE_STALE 3U |
| 129 | #define JSET_MAGIC 0x245235c1a3625032ULL |
| 130 | #define PSET_MAGIC 0x6750e15f87337f91ULL |
| 131 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 132 | #define BSET_MAGIC 0x90135c78b99e07f5ULL |
| 133 | #define BCACHE_JSET_VERSION_UUIDv1 1 |
| 134 | #define BCACHE_JSET_VERSION_UUID 1 |
| 135 | #define BCACHE_JSET_VERSION 1 |
| 136 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 137 | struct jset { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 138 | __u64 csum; |
| 139 | __u64 magic; |
| 140 | __u64 seq; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 141 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 142 | __u32 version; |
| 143 | __u32 keys; |
| 144 | __u64 last_seq; |
| 145 | BKEY_PADDED(uuid_bucket); |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 146 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 147 | BKEY_PADDED(btree_root); |
| 148 | __u16 btree_level; |
| 149 | __u16 pad[3]; |
| 150 | __u64 prio_bucket[MAX_CACHES_PER_SET]; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 151 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 152 | union { |
| 153 | struct bkey start[0]; |
| 154 | __u64 d[0]; |
| 155 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 156 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 157 | }; |
| 158 | struct prio_set { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 159 | __u64 csum; |
| 160 | __u64 magic; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 161 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 162 | __u64 seq; |
| 163 | __u32 version; |
| 164 | __u32 pad; |
| 165 | __u64 next_bucket; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 166 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 167 | struct bucket_disk { |
| 168 | __u16 prio; |
| 169 | __u8 gen; |
| 170 | } __attribute((packed)) data[]; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 171 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 172 | }; |
| 173 | struct uuid_entry { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 174 | union { |
| 175 | struct { |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 176 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 177 | __u8 uuid[16]; |
| 178 | __u8 label[32]; |
| 179 | __u32 first_reg; |
| 180 | __u32 last_reg; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 181 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 182 | __u32 invalidated; |
| 183 | __u32 flags; |
| 184 | __u64 sectors; |
| 185 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 186 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 187 | __u8 pad[128]; |
| 188 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 189 | }; |
| 190 | #define BCACHE_BSET_CSUM 1 |
| 191 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 192 | #define BCACHE_BSET_VERSION 1 |
| 193 | struct bset { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 194 | __u64 csum; |
| 195 | __u64 magic; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 196 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 197 | __u64 seq; |
| 198 | __u32 version; |
| 199 | __u32 keys; |
| 200 | union { |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 201 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 202 | struct bkey start[0]; |
| 203 | __u64 d[0]; |
| 204 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 205 | }; |
| 206 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 207 | struct uuid_entry_v0 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 208 | __u8 uuid[16]; |
| 209 | __u8 label[32]; |
| 210 | __u32 first_reg; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 211 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 212 | __u32 last_reg; |
| 213 | __u32 invalidated; |
| 214 | __u32 pad; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 215 | }; |
| 216 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 217 | #endif |