diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2017-06-19 06:18:05 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-07-07 11:25:17 -0400 |
commit | a02a946dfe9633d7e0202359836f6b5217a62824 (patch) | |
tree | 005dc13eca08a7dc99ffa9a465ab7f5fc7402ee2 /include/linux/ceph | |
parent | 76f827a7b1faaaebc53f89d184e95ea3a0b8dd71 (diff) |
libceph: respect RADOS_BACKOFF backoffs
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r-- | include/linux/ceph/ceph_fs.h | 1 | ||||
-rw-r--r-- | include/linux/ceph/osd_client.h | 45 | ||||
-rw-r--r-- | include/linux/ceph/osdmap.h | 1 | ||||
-rw-r--r-- | include/linux/ceph/rados.h | 6 |
4 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index ad078ebe25d6..edf5b04b918a 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -147,6 +147,7 @@ struct ceph_dir_layout { | |||
147 | #define CEPH_MSG_OSD_OP 42 | 147 | #define CEPH_MSG_OSD_OP 42 |
148 | #define CEPH_MSG_OSD_OPREPLY 43 | 148 | #define CEPH_MSG_OSD_OPREPLY 43 |
149 | #define CEPH_MSG_WATCH_NOTIFY 44 | 149 | #define CEPH_MSG_WATCH_NOTIFY 44 |
150 | #define CEPH_MSG_OSD_BACKOFF 61 | ||
150 | 151 | ||
151 | 152 | ||
152 | /* watch-notify operations */ | 153 | /* watch-notify operations */ |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 62c672bcbb31..c6d96a5f46fd 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _FS_CEPH_OSD_CLIENT_H | 1 | #ifndef _FS_CEPH_OSD_CLIENT_H |
2 | #define _FS_CEPH_OSD_CLIENT_H | 2 | #define _FS_CEPH_OSD_CLIENT_H |
3 | 3 | ||
4 | #include <linux/bitrev.h> | ||
4 | #include <linux/completion.h> | 5 | #include <linux/completion.h> |
5 | #include <linux/kref.h> | 6 | #include <linux/kref.h> |
6 | #include <linux/mempool.h> | 7 | #include <linux/mempool.h> |
@@ -36,6 +37,8 @@ struct ceph_osd { | |||
36 | struct ceph_connection o_con; | 37 | struct ceph_connection o_con; |
37 | struct rb_root o_requests; | 38 | struct rb_root o_requests; |
38 | struct rb_root o_linger_requests; | 39 | struct rb_root o_linger_requests; |
40 | struct rb_root o_backoff_mappings; | ||
41 | struct rb_root o_backoffs_by_id; | ||
39 | struct list_head o_osd_lru; | 42 | struct list_head o_osd_lru; |
40 | struct ceph_auth_handshake o_auth; | 43 | struct ceph_auth_handshake o_auth; |
41 | unsigned long lru_ttl; | 44 | unsigned long lru_ttl; |
@@ -275,6 +278,48 @@ struct ceph_watch_item { | |||
275 | struct ceph_entity_addr addr; | 278 | struct ceph_entity_addr addr; |
276 | }; | 279 | }; |
277 | 280 | ||
281 | struct ceph_spg_mapping { | ||
282 | struct rb_node node; | ||
283 | struct ceph_spg spgid; | ||
284 | |||
285 | struct rb_root backoffs; | ||
286 | }; | ||
287 | |||
288 | struct ceph_hobject_id { | ||
289 | void *key; | ||
290 | size_t key_len; | ||
291 | void *oid; | ||
292 | size_t oid_len; | ||
293 | u64 snapid; | ||
294 | u32 hash; | ||
295 | u8 is_max; | ||
296 | void *nspace; | ||
297 | size_t nspace_len; | ||
298 | s64 pool; | ||
299 | |||
300 | /* cache */ | ||
301 | u32 hash_reverse_bits; | ||
302 | }; | ||
303 | |||
304 | static inline void ceph_hoid_build_hash_cache(struct ceph_hobject_id *hoid) | ||
305 | { | ||
306 | hoid->hash_reverse_bits = bitrev32(hoid->hash); | ||
307 | } | ||
308 | |||
309 | /* | ||
310 | * PG-wide backoff: [begin, end) | ||
311 | * per-object backoff: begin == end | ||
312 | */ | ||
313 | struct ceph_osd_backoff { | ||
314 | struct rb_node spg_node; | ||
315 | struct rb_node id_node; | ||
316 | |||
317 | struct ceph_spg spgid; | ||
318 | u64 id; | ||
319 | struct ceph_hobject_id *begin; | ||
320 | struct ceph_hobject_id *end; | ||
321 | }; | ||
322 | |||
278 | #define CEPH_LINGER_ID_START 0xffff000000000000ULL | 323 | #define CEPH_LINGER_ID_START 0xffff000000000000ULL |
279 | 324 | ||
280 | struct ceph_osd_client { | 325 | struct ceph_osd_client { |
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index 060d059acbf8..fe6d189bdd30 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
@@ -32,6 +32,7 @@ struct ceph_spg { | |||
32 | }; | 32 | }; |
33 | 33 | ||
34 | int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs); | 34 | int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs); |
35 | int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs); | ||
35 | 36 | ||
36 | #define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id | 37 | #define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id |
37 | together */ | 38 | together */ |
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h index 5d0018782d50..385db08bb8b2 100644 --- a/include/linux/ceph/rados.h +++ b/include/linux/ceph/rados.h | |||
@@ -439,6 +439,12 @@ enum { | |||
439 | 439 | ||
440 | const char *ceph_osd_watch_op_name(int o); | 440 | const char *ceph_osd_watch_op_name(int o); |
441 | 441 | ||
442 | enum { | ||
443 | CEPH_OSD_BACKOFF_OP_BLOCK = 1, | ||
444 | CEPH_OSD_BACKOFF_OP_ACK_BLOCK = 2, | ||
445 | CEPH_OSD_BACKOFF_OP_UNBLOCK = 3, | ||
446 | }; | ||
447 | |||
442 | /* | 448 | /* |
443 | * an individual object operation. each may be accompanied by some data | 449 | * an individual object operation. each may be accompanied by some data |
444 | * payload | 450 | * payload |