diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-30 14:17:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-30 14:17:19 -0400 |
commit | af56e0aa35f3ae2a4c1a6d1000702df1dd78cb76 (patch) | |
tree | 304bd85e5db2d07efa2913aa7c6313b918cfbfdb /include/linux/ceph | |
parent | 65a50c951a38e9827dd9655b6e686bde912e799b (diff) | |
parent | 6bd9adbdf9ca6a052b0b7455ac67b925eb38cfad (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull ceph updates from Sage Weil:
"There are some updates and cleanups to the CRUSH placement code, a bug
fix with incremental maps, several cleanups and fixes from Josh Durgin
in the RBD block device code, a series of cleanups and bug fixes from
Alex Elder in the messenger code, and some miscellaneous bounds
checking and gfp cleanups/fixes."
Fix up trivial conflicts in net/ceph/{messenger.c,osdmap.c} due to the
networking people preferring "unsigned int" over just "unsigned".
* git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (45 commits)
libceph: fix pg_temp updates
libceph: avoid unregistering osd request when not registered
ceph: add auth buf in prepare_write_connect()
ceph: rename prepare_connect_authorizer()
ceph: return pointer from prepare_connect_authorizer()
ceph: use info returned by get_authorizer
ceph: have get_authorizer methods return pointers
ceph: ensure auth ops are defined before use
ceph: messenger: reduce args to create_authorizer
ceph: define ceph_auth_handshake type
ceph: messenger: check return from get_authorizer
ceph: messenger: rework prepare_connect_authorizer()
ceph: messenger: check prepare_write_connect() result
ceph: don't set WRITE_PENDING too early
ceph: drop msgr argument from prepare_write_connect()
ceph: messenger: send banner in process_connect()
ceph: messenger: reset connection kvec caller
libceph: don't reset kvec in prepare_write_banner()
ceph: ignore preferred_osd field
ceph: fully initialize new layout
...
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 aa13392a7ef..d4080f309b5 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 b8c60694b2b..e81ab30d489 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 220ae21e819..d8615dee580 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 3bff047f6b0..2521a95fa6d 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 7c05ac202d9..cedfb1a8434 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 ba4c205cbb0..311ef8d6aa9 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 | ||