Lines Matching refs:rec

449 lnet_res_container_cleanup(struct lnet_res_container *rec)
453 if (rec->rec_type == 0) /* not set yet, it's uninitialized */
456 while (!list_empty(&rec->rec_active)) {
457 struct list_head *e = rec->rec_active.next;
460 if (rec->rec_type == LNET_COOKIE_TYPE_EQ) {
463 } else if (rec->rec_type == LNET_COOKIE_TYPE_MD) {
477 count, lnet_res_type2str(rec->rec_type));
481 lnet_freelist_fini(&rec->rec_freelist);
483 if (rec->rec_lh_hash != NULL) {
484 LIBCFS_FREE(rec->rec_lh_hash,
485 LNET_LH_HASH_SIZE * sizeof(rec->rec_lh_hash[0]));
486 rec->rec_lh_hash = NULL;
489 rec->rec_type = 0; /* mark it as finalized */
493 lnet_res_container_setup(struct lnet_res_container *rec,
499 LASSERT(rec->rec_type == 0);
501 rec->rec_type = type;
502 INIT_LIST_HEAD(&rec->rec_active);
505 memset(&rec->rec_freelist, 0, sizeof(rec->rec_freelist));
506 rc = lnet_freelist_init(&rec->rec_freelist, objnum, objsz);
510 rec->rec_lh_cookie = (cpt << LNET_COOKIE_TYPE_BITS) | type;
513 LIBCFS_CPT_ALLOC(rec->rec_lh_hash, lnet_cpt_table(), cpt,
514 LNET_LH_HASH_SIZE * sizeof(rec->rec_lh_hash[0]));
515 if (rec->rec_lh_hash == NULL) {
521 INIT_LIST_HEAD(&rec->rec_lh_hash[i]);
528 lnet_res_container_cleanup(rec);
535 struct lnet_res_container *rec;
538 cfs_percpt_for_each(rec, i, recs)
539 lnet_res_container_cleanup(rec);
548 struct lnet_res_container *rec;
552 recs = cfs_percpt_alloc(lnet_cpt_table(), sizeof(*rec));
559 cfs_percpt_for_each(rec, i, recs) {
560 rc = lnet_res_container_setup(rec, i, type, objnum, objsz);
571 lnet_res_lh_lookup(struct lnet_res_container *rec, __u64 cookie)
578 if ((cookie & LNET_COOKIE_MASK) != rec->rec_type)
582 head = &rec->rec_lh_hash[hash & LNET_LH_HASH_MASK];
593 lnet_res_lh_initialize(struct lnet_res_container *rec, lnet_libhandle_t *lh)
599 lh->lh_cookie = rec->rec_lh_cookie;
600 rec->rec_lh_cookie += 1 << ibits;
604 list_add(&lh->lh_hash_chain, &rec->rec_lh_hash[hash]);