Re: ext2_set_link()->ext2_put_page() question

From: Jan Kara
Date: Thu Mar 25 2021 - 10:55:55 EST


On Mon 22-03-21 17:49:48, Ira Weiny wrote:
> Jan,
>
> Why does ext2_set_link() need to call ext2_put_page()?
>
> I don't see any reason that we could not match up the ext2_put_page() calls
> with the ext2_find_entry().
>
> Similarly am I missing something by moving the ext2_put_page() out of
> ext2_delete_entry()?
>
> See below patch.

I agree that your patch improves readability. But please fixup comments
about releasing a page as well. Thanks!

> I'm in the process of changing the kmap() calls in ext2_[get|put]_page() into
> kmap_local_page() and I noticed this imbalance. It does not really save me
> anything because I need to pass the kaddr into these calls but IMO it makes the
> code a bit easier to follow.
>
> If you agree I will get a patch together to submit with the kmap_local_page()
> patch.

OK :).

Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR