]> git.ipfire.org Git - thirdparty/linux.git/commit
dma-buf: Make .invalidate_mapping() truly optional
authorLeon Romanovsky <leonro@nvidia.com>
Sat, 31 Jan 2026 05:34:15 +0000 (07:34 +0200)
committerChristian König <christian.koenig@amd.com>
Mon, 23 Feb 2026 18:51:06 +0000 (19:51 +0100)
commit575157b1b5fcfcdd0f9c42d635dcf8219f8c86dc
tree2a45c4051e84bdfde3718a60ecb363a22dbd6a1d
parent1a8a5227f22996d3e503c60569b1813a404da033
dma-buf: Make .invalidate_mapping() truly optional

The .invalidate_mapping() callback is documented as optional, yet it
effectively became mandatory whenever importer_ops were provided. This
led to cases where RDMA non-ODP code had to supply an empty stub.

Relax the checks in the dma-buf core so the callback can be omitted,
allowing RDMA code to drop the unnecessary function.

Removing the stub allows the next patch to tell that RDMA does not support
.invalidate_mapping() by checking for a NULL op.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20260131-dmabuf-revoke-v7-5-463d956bd527@nvidia.com
drivers/dma-buf/dma-buf.c
drivers/infiniband/core/umem_dmabuf.c