diff mbox series

[v14,033/138] mm: Add folio_nid()

Message ID 20210715033704.692967-34-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series Memory folios | expand

Commit Message

Matthew Wilcox July 15, 2021, 3:35 a.m. UTC
This is the folio equivalent of page_to_nid().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/mm.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Mike Rapoport July 21, 2021, 9:31 a.m. UTC | #1
On Thu, Jul 15, 2021 at 04:35:19AM +0100, Matthew Wilcox (Oracle) wrote:
> This is the folio equivalent of page_to_nid().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
>  include/linux/mm.h | 5 +++++
>  1 file changed, 5 insertions(+)

Acked-by: Mike Rapoport <rppt@linux.ibm.com>
David Howells Aug. 10, 2021, 8:01 p.m. UTC | #2
Matthew Wilcox (Oracle) <willy@infradead.org> wrote:

> This is the folio equivalent of page_to_nid().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: David Howells <dhowells@redhat.com>
Vlastimil Babka Aug. 11, 2021, 9:37 a.m. UTC | #3
On 7/15/21 5:35 AM, Matthew Wilcox (Oracle) wrote:
> This is the folio equivalent of page_to_nid().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  include/linux/mm.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 8b79d9dfa6cb..c6e2a1682a6d 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1428,6 +1428,11 @@ static inline int page_to_nid(const struct page *page)
>  }
>  #endif
>  
> +static inline int folio_nid(const struct folio *folio)
> +{
> +	return page_to_nid(&folio->page);
> +}
> +
>  #ifdef CONFIG_NUMA_BALANCING
>  static inline int cpu_pid_to_cpupid(int cpu, int pid)
>  {
>
diff mbox series

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8b79d9dfa6cb..c6e2a1682a6d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1428,6 +1428,11 @@  static inline int page_to_nid(const struct page *page)
 }
 #endif
 
+static inline int folio_nid(const struct folio *folio)
+{
+	return page_to_nid(&folio->page);
+}
+
 #ifdef CONFIG_NUMA_BALANCING
 static inline int cpu_pid_to_cpupid(int cpu, int pid)
 {