Re: [PATCH 09/21] binder: split up binder_update_page_range()

From: Carlos Llamas
Date: Fri Dec 01 2023 - 02:03:23 EST


On Tue, Nov 07, 2023 at 09:08:15AM +0000, Alice Ryhl wrote:
> Carlos Llamas <cmllamas@xxxxxxxxxx> writes:
> > The binder_update_page_range() function performs both allocation and
> > freeing of binder pages. However, these two operations are unrelated and
> > have no common logic. In fact, when a free operation is requested, the
> > allocation logic is skipped entirely. This behavior makes the error path
> > unnecessarily complex. To improve readability of the code, this patch
> > splits the allocation and freeing operations into separate functions.
> >
> > No functional changes are introduced by this patch.
> >
> > Signed-off-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
>
> The part below err_vm_insert_page_failed was a bit tricky, but I agree
> that this is correct.

Yes, this was a big reason behind this patch.

--
Carlos Llamas