Skip to content

Commit 85ea6bd

Browse files
lorenzo-stoakesakpm00
authored andcommitted
mm/mremap: refactor mremap() system call implementation
Place checks into a separate function so the mremap() system call is less egregiously long, remove unnecessary mremap_to() offset_in_page() check and just check that earlier so we keep all such basic checks together. Separate out the VMA in-place expansion, hugetlb and expand/move logic into separate, readable functions. De-duplicate code where possible, add comments and ensure that all error handling explicitly specifies the error at the point of it occurring rather than setting a prefixed error value and implicitly setting (which is bug prone). This lays the groundwork for subsequent patches further simplifying and extending the mremap() implementation. Link: https://lkml.kernel.org/r/fc4a925396dc3cc36791ec92c4d329209e816308.1741639347.git.lorenzo.stoakes@oracle.com Signed-off-by: Lorenzo Stoakes <[email protected]> Reviewed-by: Harry Yoo <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Cc: Liam R. Howlett <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 937582e commit 85ea6bd

File tree

1 file changed

+251
-154
lines changed

1 file changed

+251
-154
lines changed

0 commit comments

Comments
 (0)