Lines Matching refs:tidbuf
57 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages);
193 struct tid_user_buf *tidbuf, in unpin_rcv_pages() argument
207 pages = &tidbuf->pages[idx]; in unpin_rcv_pages()
216 static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf) in pin_rcv_pages() argument
220 unsigned long vaddr = tidbuf->vaddr; in pin_rcv_pages()
225 npages = num_user_pages(vaddr, tidbuf->length); in pin_rcv_pages()
261 tidbuf->pages = pages; in pin_rcv_pages()
262 tidbuf->npages = npages; in pin_rcv_pages()
325 struct tid_user_buf *tidbuf; in hfi1_user_exp_rcv_setup() local
327 tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); in hfi1_user_exp_rcv_setup()
328 if (!tidbuf) in hfi1_user_exp_rcv_setup()
331 tidbuf->vaddr = tinfo->vaddr; in hfi1_user_exp_rcv_setup()
332 tidbuf->length = tinfo->length; in hfi1_user_exp_rcv_setup()
333 tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets), in hfi1_user_exp_rcv_setup()
335 if (!tidbuf->psets) { in hfi1_user_exp_rcv_setup()
336 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
340 pinned = pin_rcv_pages(fd, tidbuf); in hfi1_user_exp_rcv_setup()
342 kfree(tidbuf->psets); in hfi1_user_exp_rcv_setup()
343 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
348 tidbuf->n_psets = find_phys_blocks(tidbuf, pinned); in hfi1_user_exp_rcv_setup()
356 if (fd->tid_used + tidbuf->n_psets > fd->tid_limit) in hfi1_user_exp_rcv_setup()
359 pageset_count = tidbuf->n_psets; in hfi1_user_exp_rcv_setup()
387 ret = program_rcvarray(fd, tidbuf, grp, in hfi1_user_exp_rcv_setup()
433 ret = program_rcvarray(fd, tidbuf, grp, in hfi1_user_exp_rcv_setup()
494 unpin_rcv_pages(fd, tidbuf, NULL, mapped_pages, in hfi1_user_exp_rcv_setup()
497 kfree(tidbuf->psets); in hfi1_user_exp_rcv_setup()
499 kfree(tidbuf->pages); in hfi1_user_exp_rcv_setup()
500 kfree(tidbuf); in hfi1_user_exp_rcv_setup()
586 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages) in find_phys_blocks() argument
590 struct page **pages = tidbuf->pages; in find_phys_blocks()
591 struct tid_pageset *list = tidbuf->psets; in find_phys_blocks()