diff options
| author | Alex Elder <elder@inktank.com> | 2013-01-30 08:54:34 -0500 |
|---|---|---|
| committer | Alex Elder <elder@inktank.com> | 2013-01-30 08:54:34 -0500 |
| commit | 969e5aa3b0162a02c4f287d48ff58ca2145acf1b (patch) | |
| tree | 1af8e8e47e7352c6d3b4abfdb4aea6bd9458666f /include/linux | |
| parent | 949db153b6466c6f7cad5a427ecea94985927311 (diff) | |
| parent | 1ec3911dbd19076bcdfe5540096ff67f91a6ec02 (diff) | |
Merge branch 'testing' of github.com:ceph/ceph-client into v3.8-rc5-testing
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ceph/ceph_features.h | 8 | ||||
| -rw-r--r-- | include/linux/ceph/decode.h | 29 | ||||
| -rw-r--r-- | include/linux/ceph/osd_client.h | 24 | ||||
| -rw-r--r-- | include/linux/ceph/osdmap.h | 2 | ||||
| -rw-r--r-- | include/linux/crush/crush.h | 2 |
5 files changed, 36 insertions, 29 deletions
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index dad579b0c0e6..2160aab482f6 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h | |||
| @@ -14,13 +14,19 @@ | |||
| 14 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) | 14 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) |
| 15 | /* bits 8-17 defined by user-space; not supported yet here */ | 15 | /* bits 8-17 defined by user-space; not supported yet here */ |
| 16 | #define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) | 16 | #define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) |
| 17 | /* bits 19-24 defined by user-space; not supported yet here */ | ||
| 18 | #define CEPH_FEATURE_CRUSH_TUNABLES2 (1<<25) | ||
| 19 | /* bit 26 defined by user-space; not supported yet here */ | ||
| 20 | #define CEPH_FEATURE_REPLY_CREATE_INODE (1<<27) | ||
| 17 | 21 | ||
| 18 | /* | 22 | /* |
| 19 | * Features supported. | 23 | * Features supported. |
| 20 | */ | 24 | */ |
| 21 | #define CEPH_FEATURES_SUPPORTED_DEFAULT \ | 25 | #define CEPH_FEATURES_SUPPORTED_DEFAULT \ |
| 22 | (CEPH_FEATURE_NOSRCADDR | \ | 26 | (CEPH_FEATURE_NOSRCADDR | \ |
| 23 | CEPH_FEATURE_CRUSH_TUNABLES) | 27 | CEPH_FEATURE_CRUSH_TUNABLES | \ |
| 28 | CEPH_FEATURE_CRUSH_TUNABLES2 | \ | ||
| 29 | CEPH_FEATURE_REPLY_CREATE_INODE) | ||
| 24 | 30 | ||
| 25 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ | 31 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ |
| 26 | (CEPH_FEATURE_NOSRCADDR) | 32 | (CEPH_FEATURE_NOSRCADDR) |
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 63d092822bad..360d9d08ca9e 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
| @@ -52,10 +52,10 @@ static inline int ceph_has_room(void **p, void *end, size_t n) | |||
| 52 | return end >= *p && n <= end - *p; | 52 | return end >= *p && n <= end - *p; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | #define ceph_decode_need(p, end, n, bad) \ | 55 | #define ceph_decode_need(p, end, n, bad) \ |
| 56 | do { \ | 56 | do { \ |
| 57 | if (!likely(ceph_has_room(p, end, n))) \ | 57 | if (!likely(ceph_has_room(p, end, n))) \ |
| 58 | goto bad; \ | 58 | goto bad; \ |
| 59 | } while (0) | 59 | } while (0) |
| 60 | 60 | ||
| 61 | #define ceph_decode_64_safe(p, end, v, bad) \ | 61 | #define ceph_decode_64_safe(p, end, v, bad) \ |
| @@ -99,8 +99,8 @@ static inline int ceph_has_room(void **p, void *end, size_t n) | |||
| 99 | * | 99 | * |
| 100 | * There are two possible failures: | 100 | * There are two possible failures: |
| 101 | * - converting the string would require accessing memory at or | 101 | * - converting the string would require accessing memory at or |
| 102 | * beyond the "end" pointer provided (-E | 102 | * beyond the "end" pointer provided (-ERANGE) |
| 103 | * - memory could not be allocated for the result | 103 | * - memory could not be allocated for the result (-ENOMEM) |
| 104 | */ | 104 | */ |
| 105 | static inline char *ceph_extract_encoded_string(void **p, void *end, | 105 | static inline char *ceph_extract_encoded_string(void **p, void *end, |
| 106 | size_t *lenp, gfp_t gfp) | 106 | size_t *lenp, gfp_t gfp) |
| @@ -217,10 +217,10 @@ static inline void ceph_encode_string(void **p, void *end, | |||
| 217 | *p += len; | 217 | *p += len; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | #define ceph_encode_need(p, end, n, bad) \ | 220 | #define ceph_encode_need(p, end, n, bad) \ |
| 221 | do { \ | 221 | do { \ |
| 222 | if (!likely(ceph_has_room(p, end, n))) \ | 222 | if (!likely(ceph_has_room(p, end, n))) \ |
| 223 | goto bad; \ | 223 | goto bad; \ |
| 224 | } while (0) | 224 | } while (0) |
| 225 | 225 | ||
| 226 | #define ceph_encode_64_safe(p, end, v, bad) \ | 226 | #define ceph_encode_64_safe(p, end, v, bad) \ |
| @@ -231,12 +231,17 @@ static inline void ceph_encode_string(void **p, void *end, | |||
| 231 | #define ceph_encode_32_safe(p, end, v, bad) \ | 231 | #define ceph_encode_32_safe(p, end, v, bad) \ |
| 232 | do { \ | 232 | do { \ |
| 233 | ceph_encode_need(p, end, sizeof(u32), bad); \ | 233 | ceph_encode_need(p, end, sizeof(u32), bad); \ |
| 234 | ceph_encode_32(p, v); \ | 234 | ceph_encode_32(p, v); \ |
| 235 | } while (0) | 235 | } while (0) |
| 236 | #define ceph_encode_16_safe(p, end, v, bad) \ | 236 | #define ceph_encode_16_safe(p, end, v, bad) \ |
| 237 | do { \ | 237 | do { \ |
| 238 | ceph_encode_need(p, end, sizeof(u16), bad); \ | 238 | ceph_encode_need(p, end, sizeof(u16), bad); \ |
| 239 | ceph_encode_16(p, v); \ | 239 | ceph_encode_16(p, v); \ |
| 240 | } while (0) | ||
| 241 | #define ceph_encode_8_safe(p, end, v, bad) \ | ||
| 242 | do { \ | ||
| 243 | ceph_encode_need(p, end, sizeof(u8), bad); \ | ||
| 244 | ceph_encode_8(p, v); \ | ||
| 240 | } while (0) | 245 | } while (0) |
| 241 | 246 | ||
| 242 | #define ceph_encode_copy_safe(p, end, pv, n, bad) \ | 247 | #define ceph_encode_copy_safe(p, end, pv, n, bad) \ |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index d9b880e977e6..69287ccfe68a 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/ceph/osdmap.h> | 10 | #include <linux/ceph/osdmap.h> |
| 11 | #include <linux/ceph/messenger.h> | 11 | #include <linux/ceph/messenger.h> |
| 12 | #include <linux/ceph/auth.h> | 12 | #include <linux/ceph/auth.h> |
| 13 | #include <linux/ceph/pagelist.h> | ||
| 13 | 14 | ||
| 14 | /* | 15 | /* |
| 15 | * Maximum object name size | 16 | * Maximum object name size |
| @@ -22,7 +23,6 @@ struct ceph_snap_context; | |||
| 22 | struct ceph_osd_request; | 23 | struct ceph_osd_request; |
| 23 | struct ceph_osd_client; | 24 | struct ceph_osd_client; |
| 24 | struct ceph_authorizer; | 25 | struct ceph_authorizer; |
| 25 | struct ceph_pagelist; | ||
| 26 | 26 | ||
| 27 | /* | 27 | /* |
| 28 | * completion callback for async writepages | 28 | * completion callback for async writepages |
| @@ -95,7 +95,7 @@ struct ceph_osd_request { | |||
| 95 | struct bio *r_bio; /* instead of pages */ | 95 | struct bio *r_bio; /* instead of pages */ |
| 96 | #endif | 96 | #endif |
| 97 | 97 | ||
| 98 | struct ceph_pagelist *r_trail; /* trailing part of the data */ | 98 | struct ceph_pagelist r_trail; /* trailing part of the data */ |
| 99 | }; | 99 | }; |
| 100 | 100 | ||
| 101 | struct ceph_osd_event { | 101 | struct ceph_osd_event { |
| @@ -157,7 +157,6 @@ struct ceph_osd_client { | |||
| 157 | 157 | ||
| 158 | struct ceph_osd_req_op { | 158 | struct ceph_osd_req_op { |
| 159 | u16 op; /* CEPH_OSD_OP_* */ | 159 | u16 op; /* CEPH_OSD_OP_* */ |
| 160 | u32 flags; /* CEPH_OSD_FLAG_* */ | ||
| 161 | union { | 160 | union { |
| 162 | struct { | 161 | struct { |
| 163 | u64 offset, length; | 162 | u64 offset, length; |
| @@ -207,29 +206,24 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, | |||
| 207 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, | 206 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, |
| 208 | struct ceph_msg *msg); | 207 | struct ceph_msg *msg); |
| 209 | 208 | ||
| 210 | extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc, | 209 | extern int ceph_calc_raw_layout(struct ceph_file_layout *layout, |
| 211 | struct ceph_file_layout *layout, | ||
| 212 | u64 snapid, | ||
| 213 | u64 off, u64 *plen, u64 *bno, | 210 | u64 off, u64 *plen, u64 *bno, |
| 214 | struct ceph_osd_request *req, | 211 | struct ceph_osd_request *req, |
| 215 | struct ceph_osd_req_op *op); | 212 | struct ceph_osd_req_op *op); |
| 216 | 213 | ||
| 217 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, | 214 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, |
| 218 | int flags, | ||
| 219 | struct ceph_snap_context *snapc, | 215 | struct ceph_snap_context *snapc, |
| 220 | struct ceph_osd_req_op *ops, | 216 | unsigned int num_op, |
| 221 | bool use_mempool, | 217 | bool use_mempool, |
| 222 | gfp_t gfp_flags, | 218 | gfp_t gfp_flags); |
| 223 | struct page **pages, | ||
| 224 | struct bio *bio); | ||
| 225 | 219 | ||
| 226 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, | 220 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, |
| 227 | u64 off, u64 *plen, | 221 | u64 off, u64 len, |
| 222 | unsigned int num_op, | ||
| 228 | struct ceph_osd_req_op *src_ops, | 223 | struct ceph_osd_req_op *src_ops, |
| 229 | struct ceph_snap_context *snapc, | 224 | struct ceph_snap_context *snapc, |
| 230 | struct timespec *mtime, | 225 | u64 snap_id, |
| 231 | const char *oid, | 226 | struct timespec *mtime); |
| 232 | int oid_len); | ||
| 233 | 227 | ||
| 234 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | 228 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, |
| 235 | struct ceph_file_layout *layout, | 229 | struct ceph_file_layout *layout, |
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index 10a417f9f76f..c83a838f89f5 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
| @@ -110,7 +110,7 @@ extern void ceph_osdmap_destroy(struct ceph_osdmap *map); | |||
| 110 | 110 | ||
| 111 | /* calculate mapping of a file extent to an object */ | 111 | /* calculate mapping of a file extent to an object */ |
| 112 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, | 112 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, |
| 113 | u64 off, u64 *plen, | 113 | u64 off, u64 len, |
| 114 | u64 *bno, u64 *oxoff, u64 *oxlen); | 114 | u64 *bno, u64 *oxoff, u64 *oxlen); |
| 115 | 115 | ||
| 116 | /* calculate mapping of object to a placement group */ | 116 | /* calculate mapping of object to a placement group */ |
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h index 25baa287cff7..6a1101f24cfb 100644 --- a/include/linux/crush/crush.h +++ b/include/linux/crush/crush.h | |||
| @@ -162,6 +162,8 @@ struct crush_map { | |||
| 162 | __u32 choose_local_fallback_tries; | 162 | __u32 choose_local_fallback_tries; |
| 163 | /* choose attempts before giving up */ | 163 | /* choose attempts before giving up */ |
| 164 | __u32 choose_total_tries; | 164 | __u32 choose_total_tries; |
| 165 | /* attempt chooseleaf inner descent once; on failure retry outer descent */ | ||
| 166 | __u32 chooseleaf_descend_once; | ||
| 165 | }; | 167 | }; |
| 166 | 168 | ||
| 167 | 169 | ||
