2024-03-07 13:13:35

by Hao Ge

[permalink] [raw]
Subject: [PATCH] mm/page-flags: make PageMappingFlags return bool

make PageMappingFlags return bool like folio_mapping_flags

Signed-off-by: Hao Ge <[email protected]>
---
include/linux/page-flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 735cddc13d20..30740304059f 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -642,7 +642,7 @@ static __always_inline bool folio_mapping_flags(struct folio *folio)
return ((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS) != 0;
}

-static __always_inline int PageMappingFlags(struct page *page)
+static __always_inline bool PageMappingFlags(struct page *page)
{
return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) != 0;
}
--
2.25.1



2024-03-21 03:12:38

by Hao Ge

[permalink] [raw]
Subject: [PATCH v2] mm/page-flags: make PageMappingFlags return bool

make PageMappingFlags return bool like folio_mapping_flags

Signed-off-by: Hao Ge <[email protected]>

---
v2: Send this patch on the latest version
---
include/linux/page-flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 652d77805e99..5ee2d0ab62c6 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -668,7 +668,7 @@ static __always_inline bool folio_mapping_flags(const struct folio *folio)
return ((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS) != 0;
}

-static __always_inline int PageMappingFlags(const struct page *page)
+static __always_inline bool PageMappingFlags(const struct page *page)
{
return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) != 0;
}
--
2.25.1


2024-03-21 03:12:53

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH v2] mm/page-flags: make PageMappingFlags return bool

On Thu, Mar 21, 2024 at 11:07:12AM +0800, Hao Ge wrote:
> make PageMappingFlags return bool like folio_mapping_flags
>
> Signed-off-by: Hao Ge <[email protected]>
>
> ---
> v2: Send this patch on the latest version

I don't see v1 in my inbox. Regardless, this is clearly the right
thing.

Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>


2024-04-04 19:33:53

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH v2] mm/page-flags: make PageMappingFlags return bool

On 21.03.24 04:07, Hao Ge wrote:
> make PageMappingFlags return bool like folio_mapping_flags
>
> Signed-off-by: Hao Ge <[email protected]>
>
> ---
> v2: Send this patch on the latest version
> ---
> include/linux/page-flags.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index 652d77805e99..5ee2d0ab62c6 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -668,7 +668,7 @@ static __always_inline bool folio_mapping_flags(const struct folio *folio)
> return ((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS) != 0;
> }
>
> -static __always_inline int PageMappingFlags(const struct page *page)
> +static __always_inline bool PageMappingFlags(const struct page *page)
> {
> return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) != 0;
> }

Reviewed-by: David Hildenbrand <[email protected]>

--
Cheers,

David / dhildenb