Lines Matching refs:p

57 #define __decode_and_drop_type(p, end, type, bad)		\  argument
59 if (*p + sizeof(type) > end) \
61 *p += sizeof(type); \
64 #define __decode_and_drop_set(p, end, type, bad) \ argument
68 ceph_decode_32_safe(p, end, n, bad); \
70 ceph_decode_need(p, end, need, bad); \
71 *p += need; \
74 #define __decode_and_drop_map(p, end, ktype, vtype, bad) \ argument
78 ceph_decode_32_safe(p, end, n, bad); \
80 ceph_decode_need(p, end, need, bad); \
81 *p += need; \
85 static int __decode_and_drop_compat_set(void **p, void* end) in __decode_and_drop_compat_set() argument
91 ceph_decode_need(p, end, sizeof(u64) + sizeof(u32), bad); in __decode_and_drop_compat_set()
93 *p += sizeof(u64); in __decode_and_drop_compat_set()
95 n = ceph_decode_32(p); in __decode_and_drop_compat_set()
98 ceph_decode_need(p, end, sizeof(u64) + sizeof(u32), in __decode_and_drop_compat_set()
100 *p += sizeof(u64); in __decode_and_drop_compat_set()
101 len = ceph_decode_32(p); in __decode_and_drop_compat_set()
102 ceph_decode_need(p, end, len, bad); in __decode_and_drop_compat_set()
103 *p += len; in __decode_and_drop_compat_set()
117 struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p, in ceph_mdsmap_decode() argument
121 const void *start = *p; in ceph_mdsmap_decode()
132 ceph_decode_need(p, end, 1 + 1, bad); in ceph_mdsmap_decode()
133 mdsmap_v = ceph_decode_8(p); in ceph_mdsmap_decode()
134 *p += sizeof(u8); /* mdsmap_cv */ in ceph_mdsmap_decode()
137 ceph_decode_32_safe(p, end, mdsmap_len, bad); in ceph_mdsmap_decode()
138 if (end < *p + mdsmap_len) in ceph_mdsmap_decode()
140 end = *p + mdsmap_len; in ceph_mdsmap_decode()
143 ceph_decode_need(p, end, 8*sizeof(u32) + sizeof(u64), bad); in ceph_mdsmap_decode()
144 m->m_epoch = ceph_decode_32(p); in ceph_mdsmap_decode()
145 m->m_client_epoch = ceph_decode_32(p); in ceph_mdsmap_decode()
146 m->m_last_failure = ceph_decode_32(p); in ceph_mdsmap_decode()
147 m->m_root = ceph_decode_32(p); in ceph_mdsmap_decode()
148 m->m_session_timeout = ceph_decode_32(p); in ceph_mdsmap_decode()
149 m->m_session_autoclose = ceph_decode_32(p); in ceph_mdsmap_decode()
150 m->m_max_file_size = ceph_decode_64(p); in ceph_mdsmap_decode()
151 m->m_max_mds = ceph_decode_32(p); in ceph_mdsmap_decode()
159 m->m_num_active_mds = n = ceph_decode_32(p); in ceph_mdsmap_decode()
188 ceph_decode_need(p, end, sizeof(u64) + 1, bad); in ceph_mdsmap_decode()
189 global_id = ceph_decode_64(p); in ceph_mdsmap_decode()
190 info_v= ceph_decode_8(p); in ceph_mdsmap_decode()
193 ceph_decode_need(p, end, 1 + sizeof(u32), bad); in ceph_mdsmap_decode()
194 *p += sizeof(u8); /* info_cv */ in ceph_mdsmap_decode()
195 info_len = ceph_decode_32(p); in ceph_mdsmap_decode()
196 info_end = *p + info_len; in ceph_mdsmap_decode()
201 ceph_decode_need(p, end, sizeof(u64) + sizeof(u32), bad); in ceph_mdsmap_decode()
202 *p += sizeof(u64); in ceph_mdsmap_decode()
203 namelen = ceph_decode_32(p); /* skip mds name */ in ceph_mdsmap_decode()
204 *p += namelen; in ceph_mdsmap_decode()
206 ceph_decode_32_safe(p, end, mds, bad); in ceph_mdsmap_decode()
207 ceph_decode_32_safe(p, end, inc, bad); in ceph_mdsmap_decode()
208 ceph_decode_32_safe(p, end, state, bad); in ceph_mdsmap_decode()
209 *p += sizeof(u64); /* state_seq */ in ceph_mdsmap_decode()
211 err = ceph_decode_entity_addrvec(p, end, msgr2, &addr); in ceph_mdsmap_decode()
213 err = ceph_decode_entity_addr(p, end, &addr); in ceph_mdsmap_decode()
217 ceph_decode_copy_safe(p, end, &laggy_since, sizeof(laggy_since), in ceph_mdsmap_decode()
220 *p += sizeof(u32); in ceph_mdsmap_decode()
221 ceph_decode_32_safe(p, end, namelen, bad); in ceph_mdsmap_decode()
222 *p += namelen; in ceph_mdsmap_decode()
224 ceph_decode_32_safe(p, end, num_export_targets, bad); in ceph_mdsmap_decode()
225 pexport_targets = *p; in ceph_mdsmap_decode()
226 *p += num_export_targets * sizeof(u32); in ceph_mdsmap_decode()
231 if (info_end && *p != info_end) { in ceph_mdsmap_decode()
232 if (*p > info_end) in ceph_mdsmap_decode()
234 *p = info_end; in ceph_mdsmap_decode()
275 ceph_decode_32_safe(p, end, n, bad); in ceph_mdsmap_decode()
280 ceph_decode_need(p, end, sizeof(u64)*(n+1), bad); in ceph_mdsmap_decode()
282 m->m_data_pg_pools[i] = ceph_decode_64(p); in ceph_mdsmap_decode()
283 m->m_cas_pg_pool = ceph_decode_64(p); in ceph_mdsmap_decode()
288 ceph_decode_16_safe(p, end, mdsmap_ev, bad_ext); in ceph_mdsmap_decode()
291 if (__decode_and_drop_compat_set(p, end) < 0) in ceph_mdsmap_decode()
296 __decode_and_drop_type(p, end, u32, bad_ext); in ceph_mdsmap_decode()
298 __decode_and_drop_type(p, end, u64, bad_ext); in ceph_mdsmap_decode()
302 __decode_and_drop_type(p, end, struct ceph_timespec, bad_ext); in ceph_mdsmap_decode()
303 __decode_and_drop_type(p, end, struct ceph_timespec, bad_ext); in ceph_mdsmap_decode()
304 __decode_and_drop_type(p, end, u32, bad_ext); in ceph_mdsmap_decode()
309 ceph_decode_32_safe(p, end, n, bad_ext); in ceph_mdsmap_decode()
310 ceph_decode_need(p, end, sizeof(u32) * n, bad_ext); in ceph_mdsmap_decode()
313 s32 mds = ceph_decode_32(p); in ceph_mdsmap_decode()
333 __decode_and_drop_map(p, end, u32, u32, bad_ext); in ceph_mdsmap_decode()
335 __decode_and_drop_map(p, end, u32, u64, bad_ext); in ceph_mdsmap_decode()
337 __decode_and_drop_set(p, end, u32, bad_ext); in ceph_mdsmap_decode()
339 __decode_and_drop_set(p, end, u32, bad_ext); in ceph_mdsmap_decode()
343 __decode_and_drop_type(p, end, u32, bad_ext); in ceph_mdsmap_decode()
347 __decode_and_drop_type(p, end, u8, bad_ext); in ceph_mdsmap_decode()
349 __decode_and_drop_type(p, end, u8, bad_ext); in ceph_mdsmap_decode()
353 __decode_and_drop_type(p, end, u8, bad_ext); in ceph_mdsmap_decode()
357 ceph_decode_8_safe(p, end, m->m_enabled, bad_ext); in ceph_mdsmap_decode()
359 ceph_decode_skip_string(p, end, bad_ext); in ceph_mdsmap_decode()
364 ceph_decode_32_safe(p, end, n, bad_ext); in ceph_mdsmap_decode()
366 ceph_decode_need(p, end, need, bad_ext); in ceph_mdsmap_decode()
367 *p += need; in ceph_mdsmap_decode()
374 ceph_decode_skip_string(p, end, bad_ext); in ceph_mdsmap_decode()
376 ceph_decode_skip_32(p, end, bad_ext); in ceph_mdsmap_decode()
378 ceph_decode_skip_32(p, end, bad_ext); in ceph_mdsmap_decode()
380 ceph_decode_skip_8(p, end, bad_ext); in ceph_mdsmap_decode()
382 ceph_decode_skip_set(p, end, 64, bad_ext); in ceph_mdsmap_decode()
384 ceph_decode_skip_string(p, end, bad_ext); in ceph_mdsmap_decode()
387 ceph_decode_64_safe(p, end, m->m_max_xattr_size, bad_ext); in ceph_mdsmap_decode()
392 *p = end; in ceph_mdsmap_decode()