• Vivek Kasireddy's avatar
    udmabuf: convert udmabuf driver to use folios · 5e72b2b4
    Vivek Kasireddy authored
    This is mainly a preparatory patch to use memfd_pin_folios() API for
    pinning folios.  Using folios instead of pages makes sense as the udmabuf
    driver needs to handle both shmem and hugetlb cases.  And, using the
    memfd_pin_folios() API makes this easier as we no longer need to
    separately handle shmem vs hugetlb cases in the udmabuf driver.
    
    Note that, the function vmap_udmabuf() still needs a list of pages; so, we
    collect all the head pages into a local array in this case.
    
    Other changes in this patch include the addition of helpers for checking
    the memfd seals and exporting dmabuf.  Moving code from udmabuf_create()
    into these helpers improves readability given that udmabuf_create() is a
    bit long.
    
    Link: https://lkml.kernel.org/r/20240624063952.1572359-8-vivek.kasireddy@intel.comSigned-off-by: default avatarVivek Kasireddy <vivek.kasireddy@intel.com>
    Acked-by: default avatarDave Airlie <airlied@redhat.com>
    Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Peter Xu <peterx@redhat.com>
    Cc: Jason Gunthorpe <jgg@nvidia.com>
    Cc: Dongwon Kim <dongwon.kim@intel.com>
    Cc: Junxiao Chang <junxiao.chang@intel.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Mike Kravetz <mike.kravetz@oracle.com>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Shuah Khan <shuah@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    5e72b2b4
udmabuf.c 11.1 KB