Lines Matching refs:sgt
46 struct sg_table *sgt;
65 struct sg_table *sgt;
198 struct sg_table *sgt;
201 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
202 if (!sgt) {
207 ret = sg_alloc_table_from_pages(sgt, pages, nr_pages, 0,
213 return sgt;
216 kfree(sgt);
241 struct sg_table *sgt = gntdev_dmabuf_attach->sgt;
243 if (sgt) {
245 dma_unmap_sgtable(attach->dev, sgt,
248 sg_free_table(sgt);
251 kfree(sgt);
263 struct sg_table *sgt;
273 return gntdev_dmabuf_attach->sgt;
282 sgt = dmabuf_pages_to_sgt(gntdev_dmabuf->pages,
284 if (!IS_ERR(sgt)) {
285 if (dma_map_sgtable(attach->dev, sgt, dir,
287 sg_free_table(sgt);
288 kfree(sgt);
289 sgt = ERR_PTR(-ENOMEM);
291 gntdev_dmabuf_attach->sgt = sgt;
295 if (IS_ERR(sgt))
297 return sgt;
301 struct sg_table *sgt,
572 struct sg_table *sgt;
598 sgt = dma_buf_map_attachment_unlocked(attach, DMA_BIDIRECTIONAL);
599 if (IS_ERR(sgt)) {
600 ret = ERR_CAST(sgt);
605 if (sgt->sgl->offset) {
608 sgt->sgl->offset);
620 gntdev_dmabuf->u.imp.sgt = sgt;
629 * Now convert sgt to array of gfns without accessing underlying pages.
636 for_each_sgtable_dma_page(sgt, &sg_iter, 0) {
661 dma_buf_unmap_attachment_unlocked(attach, sgt, DMA_BIDIRECTIONAL);
710 if (gntdev_dmabuf->u.imp.sgt)
711 dma_buf_unmap_attachment_unlocked(attach, gntdev_dmabuf->u.imp.sgt,