Re: [PATCH v4 10/25] mm/util: Add folio_mapping and folio_file_mapping

From: Christoph Hellwig
Date: Wed Mar 17 2021 - 13:27:11 EST


> +struct address_space *page_mapping(struct page *);
> +struct address_space *folio_mapping(struct folio *);
> +struct address_space *__folio_file_mapping(struct folio *);
> +
> +static inline struct address_space *folio_file_mapping(struct folio *folio)
> +{
> + if (unlikely(FolioSwapCache(folio)))
> + return __folio_file_mapping(folio);

I think __folio_file_mapping is badly misnamed as it only deals with
swapcache folios. Maybe that should be reflected in the name?

Also for all these funtions documentation would be very helpful, even if
the existing struct page based helpers don't have that either.