Lines Matching refs:pi
46 static void calc_pg_masks(struct ceph_pg_pool_info *pi) in calc_pg_masks() argument
48 pi->pg_num_mask = (1 << calc_bits_of(pi->pg_num-1)) - 1; in calc_pg_masks()
49 pi->pgp_num_mask = (1 << calc_bits_of(pi->pgp_num-1)) - 1; in calc_pg_masks()
462 struct ceph_pg_pool_info *pi = NULL; in __insert_pg_pool() local
466 pi = rb_entry(parent, struct ceph_pg_pool_info, node); in __insert_pg_pool()
467 if (new->id < pi->id) in __insert_pg_pool()
469 else if (new->id > pi->id) in __insert_pg_pool()
482 struct ceph_pg_pool_info *pi; in __lookup_pg_pool() local
486 pi = rb_entry(n, struct ceph_pg_pool_info, node); in __lookup_pg_pool()
487 if (id < pi->id) in __lookup_pg_pool()
489 else if (id > pi->id) in __lookup_pg_pool()
492 return pi; in __lookup_pg_pool()
504 struct ceph_pg_pool_info *pi; in ceph_pg_pool_name_by_id() local
512 pi = __lookup_pg_pool(&map->pg_pools, (int) id); in ceph_pg_pool_name_by_id()
514 return pi ? pi->name : NULL; in ceph_pg_pool_name_by_id()
523 struct ceph_pg_pool_info *pi = in ceph_pg_poolid_by_name() local
525 if (pi->name && strcmp(pi->name, name) == 0) in ceph_pg_poolid_by_name()
526 return pi->id; in ceph_pg_poolid_by_name()
532 static void __remove_pg_pool(struct rb_root *root, struct ceph_pg_pool_info *pi) in __remove_pg_pool() argument
534 rb_erase(&pi->node, root); in __remove_pg_pool()
535 kfree(pi->name); in __remove_pg_pool()
536 kfree(pi); in __remove_pg_pool()
539 static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi) in decode_pool() argument
560 pi->type = ceph_decode_8(p); in decode_pool()
561 pi->size = ceph_decode_8(p); in decode_pool()
562 pi->crush_ruleset = ceph_decode_8(p); in decode_pool()
563 pi->object_hash = ceph_decode_8(p); in decode_pool()
565 pi->pg_num = ceph_decode_32(p); in decode_pool()
566 pi->pgp_num = ceph_decode_32(p); in decode_pool()
586 pi->flags = ceph_decode_64(p); in decode_pool()
603 pi->read_tier = ceph_decode_64(p); in decode_pool()
604 pi->write_tier = ceph_decode_64(p); in decode_pool()
606 pi->read_tier = -1; in decode_pool()
607 pi->write_tier = -1; in decode_pool()
613 calc_pg_masks(pi); in decode_pool()
622 struct ceph_pg_pool_info *pi; in decode_pool_names() local
633 pi = __lookup_pg_pool(&map->pg_pools, pool); in decode_pool_names()
634 if (pi) { in decode_pool_names()
639 kfree(pi->name); in decode_pool_names()
640 pi->name = name; in decode_pool_names()
641 dout(" name is %s\n", pi->name); in decode_pool_names()
674 struct ceph_pg_pool_info *pi = in ceph_osdmap_destroy() local
677 __remove_pg_pool(&map->pg_pools, pi); in ceph_osdmap_destroy()
802 struct ceph_pg_pool_info *pi; in __decode_pools() local
808 pi = __lookup_pg_pool(&map->pg_pools, pool); in __decode_pools()
809 if (!incremental || !pi) { in __decode_pools()
810 pi = kzalloc(sizeof(*pi), GFP_NOFS); in __decode_pools()
811 if (!pi) in __decode_pools()
814 pi->id = pool; in __decode_pools()
816 ret = __insert_pg_pool(&map->pg_pools, pi); in __decode_pools()
818 kfree(pi); in __decode_pools()
823 ret = decode_pool(p, end, pi); in __decode_pools()
1285 struct ceph_pg_pool_info *pi; in osdmap_apply_incremental() local
1288 pi = __lookup_pg_pool(&map->pg_pools, pool); in osdmap_apply_incremental()
1289 if (pi) in osdmap_apply_incremental()
1290 __remove_pg_pool(&map->pg_pools, pi); in osdmap_apply_incremental()
1458 struct ceph_pg_pool_info *pi; in ceph_oloc_oid_to_pg() local
1460 pi = __lookup_pg_pool(&osdmap->pg_pools, oloc->pool); in ceph_oloc_oid_to_pg()
1461 if (!pi) in ceph_oloc_oid_to_pg()
1465 pg_out->seed = ceph_str_hash(pi->object_hash, oid->name, in ceph_oloc_oid_to_pg()