• Home
  • Raw
  • Download

Lines Matching refs:array

118 void *mthca_array_get(struct mthca_array *array, int index)  in mthca_array_get()  argument
122 if (array->page_list[p].page) in mthca_array_get()
123 return array->page_list[p].page[index & MTHCA_ARRAY_MASK]; in mthca_array_get()
128 int mthca_array_set(struct mthca_array *array, int index, void *value) in mthca_array_set() argument
133 if (!array->page_list[p].page) in mthca_array_set()
134 array->page_list[p].page = (void **) get_zeroed_page(GFP_ATOMIC); in mthca_array_set()
136 if (!array->page_list[p].page) in mthca_array_set()
139 array->page_list[p].page[index & MTHCA_ARRAY_MASK] = value; in mthca_array_set()
140 ++array->page_list[p].used; in mthca_array_set()
145 void mthca_array_clear(struct mthca_array *array, int index) in mthca_array_clear() argument
149 if (--array->page_list[p].used == 0) { in mthca_array_clear()
150 free_page((unsigned long) array->page_list[p].page); in mthca_array_clear()
151 array->page_list[p].page = NULL; in mthca_array_clear()
153 array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL; in mthca_array_clear()
155 if (array->page_list[p].used < 0) in mthca_array_clear()
157 array, index, p, array->page_list[p].used); in mthca_array_clear()
160 int mthca_array_init(struct mthca_array *array, int nent) in mthca_array_init() argument
165 array->page_list = kmalloc_array(npage, sizeof(*array->page_list), in mthca_array_init()
167 if (!array->page_list) in mthca_array_init()
171 array->page_list[i].page = NULL; in mthca_array_init()
172 array->page_list[i].used = 0; in mthca_array_init()
178 void mthca_array_cleanup(struct mthca_array *array, int nent) in mthca_array_cleanup() argument
183 free_page((unsigned long) array->page_list[i].page); in mthca_array_cleanup()
185 kfree(array->page_list); in mthca_array_cleanup()