Lines Matching full:capacity
11 static size_t handle_arr_calc_size(u32 capacity) in handle_arr_calc_size() argument
14 capacity * sizeof(struct vmci_handle); in handle_arr_calc_size()
17 struct vmci_handle_arr *vmci_handle_arr_create(u32 capacity, u32 max_capacity) in vmci_handle_arr_create() argument
21 if (max_capacity == 0 || capacity > max_capacity) in vmci_handle_arr_create()
24 if (capacity == 0) in vmci_handle_arr_create()
25 capacity = min((u32)VMCI_HANDLE_ARRAY_DEFAULT_CAPACITY, in vmci_handle_arr_create()
28 array = kmalloc(handle_arr_calc_size(capacity), GFP_ATOMIC); in vmci_handle_arr_create()
32 array->capacity = capacity; in vmci_handle_arr_create()
49 if (unlikely(array->size >= array->capacity)) { in vmci_handle_arr_append_entry()
52 u32 capacity_bump = min(array->max_capacity - array->capacity, in vmci_handle_arr_append_entry()
53 array->capacity); in vmci_handle_arr_append_entry()
54 size_t new_size = handle_arr_calc_size(array->capacity + in vmci_handle_arr_append_entry()
64 new_array->capacity += capacity_bump; in vmci_handle_arr_append_entry()