]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
udmabuf: udmabuf_create pin folio codestyle cleanup
authorHuan Yang <link@vivo.com>
Wed, 18 Sep 2024 02:52:27 +0000 (10:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:10 +0000 (14:02 +0100)
commit8e86e9909ad204c4fa2e05fb0bb6583c839a9602
tree9d12ffb78a53e606b1e8e274f66f3f4fb6a421b1
parent004da42b8e5768d194716b5050e4a2bc21381d48
udmabuf: udmabuf_create pin folio codestyle cleanup

[ Upstream commit 164fd9efd46531fddfaa933d394569259896642b ]

This patch aim to simplify the memfd folio pin during the udmabuf
create. No functional changes.

This patch create a udmabuf_pin_folios function, in this, do the memfd
pin folio and then record each pinned folio, offset.

This patch simplify the pinned folio record, iter by each pinned folio,
and then record each offset in it.

Compare to iter by pgcnt, more readable.

Suggested-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Huan Yang <link@vivo.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240918025238.2957823-5-link@vivo.com
Stable-dep-of: f49856f525ac ("udmabuf: fix memory leak on last export_udmabuf() error path")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma-buf/udmabuf.c