Lines Matching refs:tidbuf
58 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages);
169 struct tid_user_buf *tidbuf, in unpin_rcv_pages() argument
185 pages = &tidbuf->pages[idx]; in unpin_rcv_pages()
195 static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf) in pin_rcv_pages() argument
199 unsigned long vaddr = tidbuf->vaddr; in pin_rcv_pages()
204 npages = num_user_pages(vaddr, tidbuf->length); in pin_rcv_pages()
233 tidbuf->pages = pages; in pin_rcv_pages()
234 tidbuf->npages = npages; in pin_rcv_pages()
297 struct tid_user_buf *tidbuf; in hfi1_user_exp_rcv_setup() local
302 tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); in hfi1_user_exp_rcv_setup()
303 if (!tidbuf) in hfi1_user_exp_rcv_setup()
306 tidbuf->vaddr = tinfo->vaddr; in hfi1_user_exp_rcv_setup()
307 tidbuf->length = tinfo->length; in hfi1_user_exp_rcv_setup()
308 tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets), in hfi1_user_exp_rcv_setup()
310 if (!tidbuf->psets) { in hfi1_user_exp_rcv_setup()
311 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
315 pinned = pin_rcv_pages(fd, tidbuf); in hfi1_user_exp_rcv_setup()
317 kfree(tidbuf->psets); in hfi1_user_exp_rcv_setup()
318 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
323 tidbuf->n_psets = find_phys_blocks(tidbuf, pinned); in hfi1_user_exp_rcv_setup()
331 if (fd->tid_used + tidbuf->n_psets > fd->tid_limit) in hfi1_user_exp_rcv_setup()
334 pageset_count = tidbuf->n_psets; in hfi1_user_exp_rcv_setup()
362 ret = program_rcvarray(fd, tidbuf, grp, in hfi1_user_exp_rcv_setup()
408 ret = program_rcvarray(fd, tidbuf, grp, in hfi1_user_exp_rcv_setup()
469 unpin_rcv_pages(fd, tidbuf, NULL, mapped_pages, in hfi1_user_exp_rcv_setup()
472 kfree(tidbuf->psets); in hfi1_user_exp_rcv_setup()
474 kfree(tidbuf->pages); in hfi1_user_exp_rcv_setup()
475 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
561 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages) in find_phys_blocks() argument
565 struct page **pages = tidbuf->pages; in find_phys_blocks()
566 struct tid_pageset *list = tidbuf->psets; in find_phys_blocks()