diff mbox series

[03/12] xfs: move kmem_to_page()

Message ID 20240115230113.4080105-4-david@fromorbit.com (mailing list archive)
State New
Headers show
Series xfs: remove remaining kmem interfaces and GFP_NOFS usage | expand

Commit Message

Dave Chinner Jan. 15, 2024, 10:59 p.m. UTC
From: Dave Chinner <dchinner@redhat.com>

Move it to the general xfs linux wrapper header file so we can
prepare to remove kmem.h

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 fs/xfs/kmem.h      | 11 -----------
 fs/xfs/xfs_linux.h | 11 +++++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

Comments

Darrick J. Wong Jan. 18, 2024, 10:50 p.m. UTC | #1
On Tue, Jan 16, 2024 at 09:59:41AM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Move it to the general xfs linux wrapper header file so we can
> prepare to remove kmem.h
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/kmem.h      | 11 -----------
>  fs/xfs/xfs_linux.h | 11 +++++++++++
>  2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h
> index 1343f1a6f99b..48e43f29f2a0 100644
> --- a/fs/xfs/kmem.h
> +++ b/fs/xfs/kmem.h
> @@ -20,15 +20,4 @@ static inline void  kmem_free(const void *ptr)
>  	kvfree(ptr);
>  }
>  
> -/*
> - * Zone interfaces
> - */
> -static inline struct page *
> -kmem_to_page(void *addr)
> -{
> -	if (is_vmalloc_addr(addr))
> -		return vmalloc_to_page(addr);
> -	return virt_to_page(addr);
> -}
> -
>  #endif /* __XFS_SUPPORT_KMEM_H__ */
> diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
> index d7873e0360f0..666618b463c9 100644
> --- a/fs/xfs/xfs_linux.h
> +++ b/fs/xfs/xfs_linux.h
> @@ -269,4 +269,15 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
>  # define PTR_FMT "%p"
>  #endif
>  
> +/*
> + * Helper for IO routines to grab backing pages from allocated kernel memory.
> + */
> +static inline struct page *
> +kmem_to_page(void *addr)
> +{
> +	if (is_vmalloc_addr(addr))
> +		return vmalloc_to_page(addr);
> +	return virt_to_page(addr);
> +}
> +
>  #endif /* __XFS_LINUX__ */
> -- 
> 2.43.0
> 
>
diff mbox series

Patch

diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h
index 1343f1a6f99b..48e43f29f2a0 100644
--- a/fs/xfs/kmem.h
+++ b/fs/xfs/kmem.h
@@ -20,15 +20,4 @@  static inline void  kmem_free(const void *ptr)
 	kvfree(ptr);
 }
 
-/*
- * Zone interfaces
- */
-static inline struct page *
-kmem_to_page(void *addr)
-{
-	if (is_vmalloc_addr(addr))
-		return vmalloc_to_page(addr);
-	return virt_to_page(addr);
-}
-
 #endif /* __XFS_SUPPORT_KMEM_H__ */
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
index d7873e0360f0..666618b463c9 100644
--- a/fs/xfs/xfs_linux.h
+++ b/fs/xfs/xfs_linux.h
@@ -269,4 +269,15 @@  int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
 # define PTR_FMT "%p"
 #endif
 
+/*
+ * Helper for IO routines to grab backing pages from allocated kernel memory.
+ */
+static inline struct page *
+kmem_to_page(void *addr)
+{
+	if (is_vmalloc_addr(addr))
+		return vmalloc_to_page(addr);
+	return virt_to_page(addr);
+}
+
 #endif /* __XFS_LINUX__ */