Lines Matching refs:end
55 static int crush_decode_uniform_bucket(void **p, void *end, in crush_decode_uniform_bucket() argument
58 dout("crush_decode_uniform_bucket %p to %p\n", *p, end); in crush_decode_uniform_bucket()
59 ceph_decode_need(p, end, (1+b->h.size) * sizeof(u32), bad); in crush_decode_uniform_bucket()
66 static int crush_decode_list_bucket(void **p, void *end, in crush_decode_list_bucket() argument
70 dout("crush_decode_list_bucket %p to %p\n", *p, end); in crush_decode_list_bucket()
77 ceph_decode_need(p, end, 2 * b->h.size * sizeof(u32), bad); in crush_decode_list_bucket()
87 static int crush_decode_tree_bucket(void **p, void *end, in crush_decode_tree_bucket() argument
91 dout("crush_decode_tree_bucket %p to %p\n", *p, end); in crush_decode_tree_bucket()
92 ceph_decode_8_safe(p, end, b->num_nodes, bad); in crush_decode_tree_bucket()
96 ceph_decode_need(p, end, b->num_nodes * sizeof(u32), bad); in crush_decode_tree_bucket()
104 static int crush_decode_straw_bucket(void **p, void *end, in crush_decode_straw_bucket() argument
108 dout("crush_decode_straw_bucket %p to %p\n", *p, end); in crush_decode_straw_bucket()
115 ceph_decode_need(p, end, 2 * b->h.size * sizeof(u32), bad); in crush_decode_straw_bucket()
125 static int crush_decode_straw2_bucket(void **p, void *end, in crush_decode_straw2_bucket() argument
129 dout("crush_decode_straw2_bucket %p to %p\n", *p, end); in crush_decode_straw2_bucket()
133 ceph_decode_need(p, end, b->h.size * sizeof(u32), bad); in crush_decode_straw2_bucket()
188 static u32 *decode_array_32_alloc(void **p, void *end, u32 *plen) in decode_array_32_alloc() argument
194 ceph_decode_32_safe(p, end, len, e_inval); in decode_array_32_alloc()
204 ceph_decode_need(p, end, len * sizeof(u32), e_inval); in decode_array_32_alloc()
222 static int decode_choose_arg(void **p, void *end, struct crush_choose_arg *arg) in decode_choose_arg() argument
226 ceph_decode_32_safe(p, end, arg->weight_set_size, e_inval); in decode_choose_arg()
239 w->weights = decode_array_32_alloc(p, end, &w->size); in decode_choose_arg()
248 arg->ids = decode_array_32_alloc(p, end, &arg->ids_size); in decode_choose_arg()
261 static int decode_choose_args(void **p, void *end, struct crush_map *c) in decode_choose_args() argument
267 ceph_decode_32_safe(p, end, num_choose_arg_maps, e_inval); in decode_choose_args()
275 ceph_decode_64_safe(p, end, arg_map->choose_args_index, in decode_choose_args()
285 ceph_decode_32_safe(p, end, num_buckets, e_inval); in decode_choose_args()
290 ceph_decode_32_safe(p, end, bucket_index, e_inval); in decode_choose_args()
295 ret = decode_choose_arg(p, end, arg); in decode_choose_args()
342 static struct crush_map *crush_decode(void *pbyval, void *end) in crush_decode() argument
351 dout("crush_decode %p to %p len %d\n", *p, end, (int)(end - *p)); in crush_decode()
365 ceph_decode_need(p, end, 4*sizeof(u32), bad); in crush_decode()
389 ceph_decode_32_safe(p, end, alg, bad); in crush_decode()
395 i, (int)(*p-start), *p, end); in crush_decode()
421 ceph_decode_need(p, end, 4*sizeof(u32), bad); in crush_decode()
430 b->size, (int)(*p-start), *p, end); in crush_decode()
436 ceph_decode_need(p, end, b->size*sizeof(u32), bad); in crush_decode()
442 err = crush_decode_uniform_bucket(p, end, in crush_decode()
448 err = crush_decode_list_bucket(p, end, in crush_decode()
454 err = crush_decode_tree_bucket(p, end, in crush_decode()
460 err = crush_decode_straw_bucket(p, end, in crush_decode()
466 err = crush_decode_straw2_bucket(p, end, in crush_decode()
480 ceph_decode_32_safe(p, end, yes, bad); in crush_decode()
483 i, (int)(*p-start), *p, end); in crush_decode()
489 i, (int)(*p-start), *p, end); in crush_decode()
492 ceph_decode_32_safe(p, end, yes, bad); in crush_decode()
505 ceph_decode_copy_safe(p, end, &r->mask, 4, bad); /* 4 u8's */ in crush_decode()
506 ceph_decode_need(p, end, r->len*3*sizeof(u32), bad); in crush_decode()
514 ceph_decode_skip_map(p, end, 32, string, bad); /* type_map */ in crush_decode()
515 ceph_decode_skip_map(p, end, 32, string, bad); /* name_map */ in crush_decode()
516 ceph_decode_skip_map(p, end, 32, string, bad); /* rule_name_map */ in crush_decode()
519 ceph_decode_need(p, end, 3*sizeof(u32), done); in crush_decode()
530 ceph_decode_need(p, end, sizeof(u32), done); in crush_decode()
535 ceph_decode_need(p, end, sizeof(u8), done); in crush_decode()
541 ceph_decode_need(p, end, sizeof(u8) + sizeof(u32), done); in crush_decode()
544 ceph_decode_need(p, end, sizeof(u8), done); in crush_decode()
549 if (*p != end) { in crush_decode()
551 ceph_decode_skip_map(p, end, 32, 32, bad); in crush_decode()
553 ceph_decode_skip_map(p, end, 32, string, bad); in crush_decode()
555 ceph_decode_skip_map_of_map(p, end, 32, 32, 32, bad); in crush_decode()
558 if (*p != end) { in crush_decode()
559 err = decode_choose_args(p, end, c); in crush_decode()
721 static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi) in decode_pool() argument
727 ceph_decode_need(p, end, 2 + 4, bad); in decode_pool()
739 ceph_decode_need(p, end, len, bad); in decode_pool()
885 static int decode_pool_names(void **p, void *end, struct ceph_osdmap *map) in decode_pool_names() argument
891 ceph_decode_32_safe(p, end, num, bad); in decode_pool_names()
894 ceph_decode_64_safe(p, end, pool, bad); in decode_pool_names()
895 ceph_decode_32_safe(p, end, len, bad); in decode_pool_names()
897 ceph_decode_need(p, end, len, bad); in decode_pool_names()
1070 static int get_osdmap_client_data_v(void **p, void *end, in get_osdmap_client_data_v() argument
1075 ceph_decode_8_safe(p, end, struct_v, e_inval); in get_osdmap_client_data_v()
1079 ceph_decode_8_safe(p, end, struct_compat, e_inval); in get_osdmap_client_data_v()
1088 ceph_decode_8_safe(p, end, struct_v, e_inval); in get_osdmap_client_data_v()
1089 ceph_decode_8_safe(p, end, struct_compat, e_inval); in get_osdmap_client_data_v()
1101 ceph_decode_16_safe(p, end, version, e_inval); in get_osdmap_client_data_v()
1119 static int __decode_pools(void **p, void *end, struct ceph_osdmap *map, in __decode_pools() argument
1124 ceph_decode_32_safe(p, end, n, e_inval); in __decode_pools()
1130 ceph_decode_64_safe(p, end, pool, e_inval); in __decode_pools()
1147 ret = decode_pool(p, end, pi); in __decode_pools()
1158 static int decode_pools(void **p, void *end, struct ceph_osdmap *map) in decode_pools() argument
1160 return __decode_pools(p, end, map, false); in decode_pools()
1163 static int decode_new_pools(void **p, void *end, struct ceph_osdmap *map) in decode_new_pools() argument
1165 return __decode_pools(p, end, map, true); in decode_new_pools()
1170 static int decode_pg_mapping(void **p, void *end, struct rb_root *mapping_root,
1177 ceph_decode_32_safe(p, end, n, e_inval);
1183 ret = ceph_decode_pgid(p, end, &pgid);
1195 pg = fn(p, end, incremental);
1212 static struct ceph_pg_mapping *__decode_pg_temp(void **p, void *end, in __decode_pg_temp() argument
1218 ceph_decode_32_safe(p, end, len, e_inval); in __decode_pg_temp()
1224 ceph_decode_need(p, end, len * sizeof(u32), e_inval); in __decode_pg_temp()
1239 static int decode_pg_temp(void **p, void *end, struct ceph_osdmap *map) in decode_pg_temp() argument
1241 return decode_pg_mapping(p, end, &map->pg_temp, __decode_pg_temp, in decode_pg_temp()
1245 static int decode_new_pg_temp(void **p, void *end, struct ceph_osdmap *map) in decode_new_pg_temp() argument
1247 return decode_pg_mapping(p, end, &map->pg_temp, __decode_pg_temp, in decode_new_pg_temp()
1251 static struct ceph_pg_mapping *__decode_primary_temp(void **p, void *end, in __decode_primary_temp() argument
1257 ceph_decode_32_safe(p, end, osd, e_inval); in __decode_primary_temp()
1272 static int decode_primary_temp(void **p, void *end, struct ceph_osdmap *map) in decode_primary_temp() argument
1274 return decode_pg_mapping(p, end, &map->primary_temp, in decode_primary_temp()
1278 static int decode_new_primary_temp(void **p, void *end, in decode_new_primary_temp() argument
1281 return decode_pg_mapping(p, end, &map->primary_temp, in decode_new_primary_temp()
1318 static int decode_primary_affinity(void **p, void *end, in decode_primary_affinity() argument
1323 ceph_decode_32_safe(p, end, len, e_inval); in decode_primary_affinity()
1332 ceph_decode_need(p, end, map->max_osd*sizeof(u32), e_inval); in decode_primary_affinity()
1348 static int decode_new_primary_affinity(void **p, void *end, in decode_new_primary_affinity() argument
1353 ceph_decode_32_safe(p, end, n, e_inval); in decode_new_primary_affinity()
1358 ceph_decode_32_safe(p, end, osd, e_inval); in decode_new_primary_affinity()
1359 ceph_decode_32_safe(p, end, aff, e_inval); in decode_new_primary_affinity()
1374 static struct ceph_pg_mapping *__decode_pg_upmap(void **p, void *end, in __decode_pg_upmap() argument
1377 return __decode_pg_temp(p, end, false); in __decode_pg_upmap()
1380 static int decode_pg_upmap(void **p, void *end, struct ceph_osdmap *map) in decode_pg_upmap() argument
1382 return decode_pg_mapping(p, end, &map->pg_upmap, __decode_pg_upmap, in decode_pg_upmap()
1386 static int decode_new_pg_upmap(void **p, void *end, struct ceph_osdmap *map) in decode_new_pg_upmap() argument
1388 return decode_pg_mapping(p, end, &map->pg_upmap, __decode_pg_upmap, in decode_new_pg_upmap()
1392 static int decode_old_pg_upmap(void **p, void *end, struct ceph_osdmap *map) in decode_old_pg_upmap() argument
1394 return decode_pg_mapping(p, end, &map->pg_upmap, NULL, true); in decode_old_pg_upmap()
1397 static struct ceph_pg_mapping *__decode_pg_upmap_items(void **p, void *end, in __decode_pg_upmap_items() argument
1403 ceph_decode_32_safe(p, end, len, e_inval); in __decode_pg_upmap_items()
1407 ceph_decode_need(p, end, 2 * len * sizeof(u32), e_inval); in __decode_pg_upmap_items()
1424 static int decode_pg_upmap_items(void **p, void *end, struct ceph_osdmap *map) in decode_pg_upmap_items() argument
1426 return decode_pg_mapping(p, end, &map->pg_upmap_items, in decode_pg_upmap_items()
1430 static int decode_new_pg_upmap_items(void **p, void *end, in decode_new_pg_upmap_items() argument
1433 return decode_pg_mapping(p, end, &map->pg_upmap_items, in decode_new_pg_upmap_items()
1437 static int decode_old_pg_upmap_items(void **p, void *end, in decode_old_pg_upmap_items() argument
1440 return decode_pg_mapping(p, end, &map->pg_upmap_items, NULL, true); in decode_old_pg_upmap_items()
1446 static int osdmap_decode(void **p, void *end, struct ceph_osdmap *map) in osdmap_decode() argument
1455 dout("%s %p to %p len %d\n", __func__, *p, end, (int)(end - *p)); in osdmap_decode()
1457 err = get_osdmap_client_data_v(p, end, "full", &struct_v); in osdmap_decode()
1462 ceph_decode_need(p, end, sizeof(map->fsid) + sizeof(u32) + in osdmap_decode()
1470 err = decode_pools(p, end, map); in osdmap_decode()
1475 err = decode_pool_names(p, end, map); in osdmap_decode()
1479 ceph_decode_32_safe(p, end, map->pool_max, e_inval); in osdmap_decode()
1481 ceph_decode_32_safe(p, end, map->flags, e_inval); in osdmap_decode()
1484 ceph_decode_32_safe(p, end, max, e_inval); in osdmap_decode()
1492 ceph_decode_need(p, end, 3*sizeof(u32) + in osdmap_decode()
1523 err = decode_pg_temp(p, end, map); in osdmap_decode()
1529 err = decode_primary_temp(p, end, map); in osdmap_decode()
1536 err = decode_primary_affinity(p, end, map); in osdmap_decode()
1544 ceph_decode_32_safe(p, end, len, e_inval); in osdmap_decode()
1545 err = osdmap_set_crush(map, crush_decode(*p, min(*p + len, end))); in osdmap_decode()
1552 ceph_decode_skip_map_of_map(p, end, string, string, string, in osdmap_decode()
1557 err = decode_pg_upmap(p, end, map); in osdmap_decode()
1561 err = decode_pg_upmap_items(p, end, map); in osdmap_decode()
1570 *p = end; in osdmap_decode()
1579 err, epoch, (int)(*p - start), *p, start, end); in osdmap_decode()
1582 start, end - start, true); in osdmap_decode()
1589 struct ceph_osdmap *ceph_osdmap_decode(void **p, void *end) in ceph_osdmap_decode() argument
1598 ret = osdmap_decode(p, end, map); in ceph_osdmap_decode()
1615 static int decode_new_up_state_weight(void **p, void *end, u8 struct_v, in decode_new_up_state_weight() argument
1624 ceph_decode_32_safe(p, end, len, e_inval); in decode_new_up_state_weight()
1626 ceph_decode_need(p, end, len, e_inval); in decode_new_up_state_weight()
1630 ceph_decode_32_safe(p, end, len, e_inval); in decode_new_up_state_weight()
1632 ceph_decode_need(p, end, len, e_inval); in decode_new_up_state_weight()
1636 ceph_decode_32_safe(p, end, len, e_inval); in decode_new_up_state_weight()
1641 ceph_decode_need(p, end, 2*sizeof(u32), e_inval); in decode_new_up_state_weight()
1721 struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, in osdmap_apply_incremental() argument
1735 dout("%s %p to %p len %d\n", __func__, *p, end, (int)(end - *p)); in osdmap_apply_incremental()
1737 err = get_osdmap_client_data_v(p, end, "inc", &struct_v); in osdmap_apply_incremental()
1742 ceph_decode_need(p, end, sizeof(fsid) + sizeof(u32) + sizeof(modified) + in osdmap_apply_incremental()
1752 ceph_decode_32_safe(p, end, len, e_inval); in osdmap_apply_incremental()
1755 len, *p, end); in osdmap_apply_incremental()
1756 return ceph_osdmap_decode(p, min(*p+len, end)); in osdmap_apply_incremental()
1760 ceph_decode_32_safe(p, end, len, e_inval); in osdmap_apply_incremental()
1763 crush_decode(*p, min(*p + len, end))); in osdmap_apply_incremental()
1776 ceph_decode_32_safe(p, end, max, e_inval); in osdmap_apply_incremental()
1787 err = decode_new_pools(p, end, map); in osdmap_apply_incremental()
1792 err = decode_pool_names(p, end, map); in osdmap_apply_incremental()
1797 ceph_decode_32_safe(p, end, len, e_inval); in osdmap_apply_incremental()
1801 ceph_decode_64_safe(p, end, pool, e_inval); in osdmap_apply_incremental()
1808 err = decode_new_up_state_weight(p, end, struct_v, map); in osdmap_apply_incremental()
1813 err = decode_new_pg_temp(p, end, map); in osdmap_apply_incremental()
1819 err = decode_new_primary_temp(p, end, map); in osdmap_apply_incremental()
1826 err = decode_new_primary_affinity(p, end, map); in osdmap_apply_incremental()
1833 ceph_decode_skip_map_of_map(p, end, string, string, string, in osdmap_apply_incremental()
1836 ceph_decode_skip_set(p, end, string, e_inval); in osdmap_apply_incremental()
1840 err = decode_new_pg_upmap(p, end, map); in osdmap_apply_incremental()
1844 err = decode_old_pg_upmap(p, end, map); in osdmap_apply_incremental()
1848 err = decode_new_pg_upmap_items(p, end, map); in osdmap_apply_incremental()
1852 err = decode_old_pg_upmap_items(p, end, map); in osdmap_apply_incremental()
1858 *p = end; in osdmap_apply_incremental()
1867 err, epoch, (int)(*p - start), *p, start, end); in osdmap_apply_incremental()
1870 start, end - start, true); in osdmap_apply_incremental()