Lines Matching refs:end
52 static inline bool ceph_has_room(void **p, void *end, size_t n) in ceph_has_room() argument
54 return end >= *p && n <= end - *p; in ceph_has_room()
57 #define ceph_decode_need(p, end, n, bad) \ argument
59 if (!likely(ceph_has_room(p, end, n))) \
63 #define ceph_decode_64_safe(p, end, v, bad) \ argument
65 ceph_decode_need(p, end, sizeof(u64), bad); \
68 #define ceph_decode_32_safe(p, end, v, bad) \ argument
70 ceph_decode_need(p, end, sizeof(u32), bad); \
73 #define ceph_decode_16_safe(p, end, v, bad) \ argument
75 ceph_decode_need(p, end, sizeof(u16), bad); \
78 #define ceph_decode_8_safe(p, end, v, bad) \ argument
80 ceph_decode_need(p, end, sizeof(u8), bad); \
84 #define ceph_decode_copy_safe(p, end, pv, n, bad) \ argument
86 ceph_decode_need(p, end, n, bad); \
107 static inline char *ceph_extract_encoded_string(void **p, void *end, in ceph_extract_encoded_string() argument
114 ceph_decode_32_safe(&sp, end, len, bad); in ceph_extract_encoded_string()
115 if (!ceph_has_room(&sp, end, len)) in ceph_extract_encoded_string()
139 #define ceph_decode_skip_n(p, end, n, bad) \ argument
141 ceph_decode_need(p, end, n, bad); \
145 #define ceph_decode_skip_64(p, end, bad) \ argument
146 ceph_decode_skip_n(p, end, sizeof(u64), bad)
148 #define ceph_decode_skip_32(p, end, bad) \ argument
149 ceph_decode_skip_n(p, end, sizeof(u32), bad)
151 #define ceph_decode_skip_16(p, end, bad) \ argument
152 ceph_decode_skip_n(p, end, sizeof(u16), bad)
154 #define ceph_decode_skip_8(p, end, bad) \ argument
155 ceph_decode_skip_n(p, end, sizeof(u8), bad)
157 #define ceph_decode_skip_string(p, end, bad) \ argument
161 ceph_decode_32_safe(p, end, len, bad); \
162 ceph_decode_skip_n(p, end, len, bad); \
165 #define ceph_decode_skip_set(p, end, type, bad) \ argument
169 ceph_decode_32_safe(p, end, len, bad); \
171 ceph_decode_skip_##type(p, end, bad); \
174 #define ceph_decode_skip_map(p, end, ktype, vtype, bad) \ argument
178 ceph_decode_32_safe(p, end, len, bad); \
180 ceph_decode_skip_##ktype(p, end, bad); \
181 ceph_decode_skip_##vtype(p, end, bad); \
185 #define ceph_decode_skip_map_of_map(p, end, ktype1, ktype2, vtype2, bad) \ argument
189 ceph_decode_32_safe(p, end, len, bad); \
191 ceph_decode_skip_##ktype1(p, end, bad); \
192 ceph_decode_skip_map(p, end, ktype2, vtype2, bad); \
242 extern int ceph_decode_entity_addr(void **p, void *end,
244 int ceph_decode_entity_addrvec(void **p, void *end, bool msgr2,
282 static inline void ceph_encode_filepath(void **p, void *end, in ceph_encode_filepath() argument
286 BUG_ON(*p + 1 + sizeof(ino) + sizeof(len) + len > end); in ceph_encode_filepath()
295 static inline void ceph_encode_string(void **p, void *end, in ceph_encode_string() argument
298 BUG_ON(*p + sizeof(len) + len > end); in ceph_encode_string()
336 static inline int ceph_start_decoding(void **p, void *end, u8 v, in ceph_start_decoding() argument
342 ceph_decode_need(p, end, CEPH_ENCODING_START_BLK_LEN, bad); in ceph_start_decoding()
352 ceph_decode_need(p, end, *struct_len, bad); in ceph_start_decoding()
359 #define ceph_encode_need(p, end, n, bad) \ argument
361 if (!likely(ceph_has_room(p, end, n))) \
365 #define ceph_encode_64_safe(p, end, v, bad) \ argument
367 ceph_encode_need(p, end, sizeof(u64), bad); \
370 #define ceph_encode_32_safe(p, end, v, bad) \ argument
372 ceph_encode_need(p, end, sizeof(u32), bad); \
375 #define ceph_encode_16_safe(p, end, v, bad) \ argument
377 ceph_encode_need(p, end, sizeof(u16), bad); \
380 #define ceph_encode_8_safe(p, end, v, bad) \ argument
382 ceph_encode_need(p, end, sizeof(u8), bad); \
386 #define ceph_encode_copy_safe(p, end, pv, n, bad) \ argument
388 ceph_encode_need(p, end, n, bad); \
391 #define ceph_encode_string_safe(p, end, s, n, bad) \ argument
393 ceph_encode_need(p, end, n, bad); \
394 ceph_encode_string(p, end, s, n); \