diff options
Diffstat (limited to 'include/linux/ceph')
| -rw-r--r-- | include/linux/ceph/auth.h | 12 | ||||
| -rw-r--r-- | include/linux/ceph/ceph_fs.h | 4 | ||||
| -rw-r--r-- | include/linux/ceph/decode.h | 9 | ||||
| -rw-r--r-- | include/linux/ceph/messenger.h | 6 | ||||
| -rw-r--r-- | include/linux/ceph/osd_client.h | 11 | ||||
| -rw-r--r-- | include/linux/ceph/osdmap.h | 2 |
6 files changed, 26 insertions, 18 deletions
diff --git a/include/linux/ceph/auth.h b/include/linux/ceph/auth.h index aa13392a7efb..d4080f309b56 100644 --- a/include/linux/ceph/auth.h +++ b/include/linux/ceph/auth.h | |||
| @@ -14,6 +14,14 @@ | |||
| 14 | struct ceph_auth_client; | 14 | struct ceph_auth_client; |
| 15 | struct ceph_authorizer; | 15 | struct ceph_authorizer; |
| 16 | 16 | ||
| 17 | struct ceph_auth_handshake { | ||
| 18 | struct ceph_authorizer *authorizer; | ||
| 19 | void *authorizer_buf; | ||
| 20 | size_t authorizer_buf_len; | ||
| 21 | void *authorizer_reply_buf; | ||
| 22 | size_t authorizer_reply_buf_len; | ||
| 23 | }; | ||
| 24 | |||
| 17 | struct ceph_auth_client_ops { | 25 | struct ceph_auth_client_ops { |
| 18 | const char *name; | 26 | const char *name; |
| 19 | 27 | ||
| @@ -43,9 +51,7 @@ struct ceph_auth_client_ops { | |||
| 43 | * the response to authenticate the service. | 51 | * the response to authenticate the service. |
| 44 | */ | 52 | */ |
| 45 | int (*create_authorizer)(struct ceph_auth_client *ac, int peer_type, | 53 | int (*create_authorizer)(struct ceph_auth_client *ac, int peer_type, |
| 46 | struct ceph_authorizer **a, | 54 | struct ceph_auth_handshake *auth); |
| 47 | void **buf, size_t *len, | ||
| 48 | void **reply_buf, size_t *reply_len); | ||
| 49 | int (*verify_authorizer_reply)(struct ceph_auth_client *ac, | 55 | int (*verify_authorizer_reply)(struct ceph_auth_client *ac, |
| 50 | struct ceph_authorizer *a, size_t len); | 56 | struct ceph_authorizer *a, size_t len); |
| 51 | void (*destroy_authorizer)(struct ceph_auth_client *ac, | 57 | void (*destroy_authorizer)(struct ceph_auth_client *ac, |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index b8c60694b2b0..e81ab30d4896 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
| @@ -65,7 +65,7 @@ struct ceph_file_layout { | |||
| 65 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ | 65 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ |
| 66 | 66 | ||
| 67 | /* object -> pg layout */ | 67 | /* object -> pg layout */ |
| 68 | __le32 fl_pg_preferred; /* preferred primary for pg (-1 for none) */ | 68 | __le32 fl_unused; /* unused; used to be preferred primary (-1) */ |
| 69 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ | 69 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ |
| 70 | } __attribute__ ((packed)); | 70 | } __attribute__ ((packed)); |
| 71 | 71 | ||
| @@ -384,7 +384,7 @@ union ceph_mds_request_args { | |||
| 384 | __le32 stripe_count; /* ... */ | 384 | __le32 stripe_count; /* ... */ |
| 385 | __le32 object_size; | 385 | __le32 object_size; |
| 386 | __le32 file_replication; | 386 | __le32 file_replication; |
| 387 | __le32 preferred; | 387 | __le32 unused; /* used to be preferred osd */ |
| 388 | } __attribute__ ((packed)) open; | 388 | } __attribute__ ((packed)) open; |
| 389 | struct { | 389 | struct { |
| 390 | __le32 flags; | 390 | __le32 flags; |
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 220ae21e819b..d8615dee5808 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
| @@ -46,9 +46,14 @@ static inline void ceph_decode_copy(void **p, void *pv, size_t n) | |||
| 46 | /* | 46 | /* |
| 47 | * bounds check input. | 47 | * bounds check input. |
| 48 | */ | 48 | */ |
| 49 | static inline int ceph_has_room(void **p, void *end, size_t n) | ||
| 50 | { | ||
| 51 | return end >= *p && n <= end - *p; | ||
| 52 | } | ||
| 53 | |||
| 49 | #define ceph_decode_need(p, end, n, bad) \ | 54 | #define ceph_decode_need(p, end, n, bad) \ |
| 50 | do { \ | 55 | do { \ |
| 51 | if (unlikely(*(p) + (n) > (end))) \ | 56 | if (!likely(ceph_has_room(p, end, n))) \ |
| 52 | goto bad; \ | 57 | goto bad; \ |
| 53 | } while (0) | 58 | } while (0) |
| 54 | 59 | ||
| @@ -167,7 +172,7 @@ static inline void ceph_encode_string(void **p, void *end, | |||
| 167 | 172 | ||
| 168 | #define ceph_encode_need(p, end, n, bad) \ | 173 | #define ceph_encode_need(p, end, n, bad) \ |
| 169 | do { \ | 174 | do { \ |
| 170 | if (unlikely(*(p) + (n) > (end))) \ | 175 | if (!likely(ceph_has_room(p, end, n))) \ |
| 171 | goto bad; \ | 176 | goto bad; \ |
| 172 | } while (0) | 177 | } while (0) |
| 173 | 178 | ||
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 3bff047f6b0f..2521a95fa6d9 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
| @@ -25,9 +25,9 @@ struct ceph_connection_operations { | |||
| 25 | void (*dispatch) (struct ceph_connection *con, struct ceph_msg *m); | 25 | void (*dispatch) (struct ceph_connection *con, struct ceph_msg *m); |
| 26 | 26 | ||
| 27 | /* authorize an outgoing connection */ | 27 | /* authorize an outgoing connection */ |
| 28 | int (*get_authorizer) (struct ceph_connection *con, | 28 | struct ceph_auth_handshake *(*get_authorizer) ( |
| 29 | void **buf, int *len, int *proto, | 29 | struct ceph_connection *con, |
| 30 | void **reply_buf, int *reply_len, int force_new); | 30 | int *proto, int force_new); |
| 31 | int (*verify_authorizer_reply) (struct ceph_connection *con, int len); | 31 | int (*verify_authorizer_reply) (struct ceph_connection *con, int len); |
| 32 | int (*invalidate_authorizer)(struct ceph_connection *con); | 32 | int (*invalidate_authorizer)(struct ceph_connection *con); |
| 33 | 33 | ||
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 7c05ac202d90..cedfb1a8434a 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -6,9 +6,10 @@ | |||
| 6 | #include <linux/mempool.h> | 6 | #include <linux/mempool.h> |
| 7 | #include <linux/rbtree.h> | 7 | #include <linux/rbtree.h> |
| 8 | 8 | ||
| 9 | #include "types.h" | 9 | #include <linux/ceph/types.h> |
| 10 | #include "osdmap.h" | 10 | #include <linux/ceph/osdmap.h> |
| 11 | #include "messenger.h" | 11 | #include <linux/ceph/messenger.h> |
| 12 | #include <linux/ceph/auth.h> | ||
| 12 | 13 | ||
| 13 | /* | 14 | /* |
| 14 | * Maximum object name size | 15 | * Maximum object name size |
| @@ -40,9 +41,7 @@ struct ceph_osd { | |||
| 40 | struct list_head o_requests; | 41 | struct list_head o_requests; |
| 41 | struct list_head o_linger_requests; | 42 | struct list_head o_linger_requests; |
| 42 | struct list_head o_osd_lru; | 43 | struct list_head o_osd_lru; |
| 43 | struct ceph_authorizer *o_authorizer; | 44 | struct ceph_auth_handshake o_auth; |
| 44 | void *o_authorizer_buf, *o_authorizer_reply_buf; | ||
| 45 | size_t o_authorizer_buf_len, o_authorizer_reply_buf_len; | ||
| 46 | unsigned long lru_ttl; | 45 | unsigned long lru_ttl; |
| 47 | int o_marked_for_keepalive; | 46 | int o_marked_for_keepalive; |
| 48 | struct list_head o_keepalive_item; | 47 | struct list_head o_keepalive_item; |
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index ba4c205cbb01..311ef8d6aa9e 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
| @@ -65,8 +65,6 @@ struct ceph_osdmap { | |||
| 65 | #define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash)) | 65 | #define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash)) |
| 66 | #define ceph_file_layout_object_su(l) \ | 66 | #define ceph_file_layout_object_su(l) \ |
| 67 | ((__s32)le32_to_cpu((l).fl_object_stripe_unit)) | 67 | ((__s32)le32_to_cpu((l).fl_object_stripe_unit)) |
| 68 | #define ceph_file_layout_pg_preferred(l) \ | ||
| 69 | ((__s32)le32_to_cpu((l).fl_pg_preferred)) | ||
| 70 | #define ceph_file_layout_pg_pool(l) \ | 68 | #define ceph_file_layout_pg_pool(l) \ |
| 71 | ((__s32)le32_to_cpu((l).fl_pg_pool)) | 69 | ((__s32)le32_to_cpu((l).fl_pg_pool)) |
| 72 | 70 | ||
