Lines Matching refs:tidbuf
16 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages);
127 struct tid_user_buf *tidbuf, in unpin_rcv_pages() argument
143 pages = &tidbuf->pages[idx]; in unpin_rcv_pages()
153 static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf) in pin_rcv_pages() argument
157 unsigned long vaddr = tidbuf->vaddr; in pin_rcv_pages()
162 npages = num_user_pages(vaddr, tidbuf->length); in pin_rcv_pages()
191 tidbuf->pages = pages; in pin_rcv_pages()
192 tidbuf->npages = npages; in pin_rcv_pages()
255 struct tid_user_buf *tidbuf; in hfi1_user_exp_rcv_setup() local
260 tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); in hfi1_user_exp_rcv_setup()
261 if (!tidbuf) in hfi1_user_exp_rcv_setup()
264 tidbuf->vaddr = tinfo->vaddr; in hfi1_user_exp_rcv_setup()
265 tidbuf->length = tinfo->length; in hfi1_user_exp_rcv_setup()
266 tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets), in hfi1_user_exp_rcv_setup()
268 if (!tidbuf->psets) { in hfi1_user_exp_rcv_setup()
269 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
273 pinned = pin_rcv_pages(fd, tidbuf); in hfi1_user_exp_rcv_setup()
275 kfree(tidbuf->psets); in hfi1_user_exp_rcv_setup()
276 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
281 tidbuf->n_psets = find_phys_blocks(tidbuf, pinned); in hfi1_user_exp_rcv_setup()
289 if (fd->tid_used + tidbuf->n_psets > fd->tid_limit) in hfi1_user_exp_rcv_setup()
292 pageset_count = tidbuf->n_psets; in hfi1_user_exp_rcv_setup()
320 ret = program_rcvarray(fd, tidbuf, grp, in hfi1_user_exp_rcv_setup()
366 ret = program_rcvarray(fd, tidbuf, grp, in hfi1_user_exp_rcv_setup()
427 unpin_rcv_pages(fd, tidbuf, NULL, mapped_pages, in hfi1_user_exp_rcv_setup()
430 kfree(tidbuf->psets); in hfi1_user_exp_rcv_setup()
432 kfree(tidbuf->pages); in hfi1_user_exp_rcv_setup()
433 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
519 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages) in find_phys_blocks() argument
523 struct page **pages = tidbuf->pages; in find_phys_blocks()
524 struct tid_pageset *list = tidbuf->psets; in find_phys_blocks()