Re: [PATCH 00/16] expand mmap_prepare functionality, port more users

Jason Gunthorpe
2025-09-08T15:04:09Z

On Mon, Sep 08, 2025 at 03:48:36PM +0100, Lorenzo Stoakes wrote:
> But sadly some _do need_ to do extra work afterwards, most notably,
> prepopulation.

I think Jan is suggesting something more like

mmap_op()
{
struct vma_desc desc = {};

desc.[..] = x
desc.[..] = y
desc.[..] = z
vma = vma_alloc(desc);

ret = remap_pfn(vma)
if (ret) goto err_vma;

return vma_commit(vma);

err_va:
vma_dealloc(vma);
return ERR_PTR(ret);
}

Jason