Lines Matching refs:cnt
119 for (j = 0; j < chunk->cnt; j++) { in usnic_vnic_dump()
139 u16 cnt) in usnic_vnic_res_spec_update() argument
145 spec->resources[i].cnt = cnt; in usnic_vnic_res_spec_update()
166 if (min_spec->resources[i].cnt > in usnic_vnic_res_spec_satisfied()
167 res_spec->resources[i].cnt) in usnic_vnic_res_spec_satisfied()
188 res_cnt = res_spec->resources[i].cnt; in usnic_vnic_spec_dump()
207 res_cnt = res_spec->resources[i].cnt; in usnic_vnic_check_room()
222 return vnic->chunks[type].cnt; in usnic_vnic_res_cnt()
233 int cnt, void *owner) in usnic_vnic_get_resources() argument
239 if (usnic_vnic_res_free_cnt(vnic, type) < cnt || cnt < 0 || !owner) in usnic_vnic_get_resources()
246 if (cnt > 0) { in usnic_vnic_get_resources()
247 ret->res = kcalloc(cnt, sizeof(*(ret->res)), GFP_ATOMIC); in usnic_vnic_get_resources()
255 for (i = 0; i < src->cnt && ret->cnt < cnt; i++) { in usnic_vnic_get_resources()
260 ret->res[ret->cnt++] = res; in usnic_vnic_get_resources()
268 WARN_ON(ret->cnt != cnt); in usnic_vnic_get_resources()
280 if (chunk->cnt > 0) { in usnic_vnic_put_resources()
282 while ((i = --chunk->cnt) >= 0) { in usnic_vnic_put_resources()
304 int cnt, err, i; in usnic_vnic_alloc_res_chunk() local
307 cnt = vnic_dev_get_res_count(vnic->vdev, _to_vnic_res_type(type)); in usnic_vnic_alloc_res_chunk()
308 if (cnt < 1) { in usnic_vnic_alloc_res_chunk()
309 usnic_err("Wrong res count with cnt %d\n", cnt); in usnic_vnic_alloc_res_chunk()
313 chunk->cnt = chunk->free_cnt = cnt; in usnic_vnic_alloc_res_chunk()
314 chunk->res = kcalloc(cnt, sizeof(*(chunk->res)), GFP_KERNEL); in usnic_vnic_alloc_res_chunk()
318 for (i = 0; i < cnt; i++) { in usnic_vnic_alloc_res_chunk()
344 for (i = 0; i < chunk->cnt; i++) in usnic_vnic_free_res_chunk()