diff mbox series

[v7,06/17] xfs: use kmem functions for struct xfs_mount

Message ID 157190346680.27074.12024650426066059590.stgit@fedora-28 (mailing list archive)
State Superseded
Headers show
Series xfs: mount API patch series | expand

Commit Message

Ian Kent Oct. 24, 2019, 7:51 a.m. UTC
The remount function uses the kmem functions for allocating and freeing
struct xfs_mount, for consistency use the kmem functions everwhere for
struct xfs_mount.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 fs/xfs/xfs_super.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Darrick J. Wong Oct. 24, 2019, 3:26 p.m. UTC | #1
On Thu, Oct 24, 2019 at 03:51:06PM +0800, Ian Kent wrote:
> The remount function uses the kmem functions for allocating and freeing
> struct xfs_mount, for consistency use the kmem functions everwhere for
> struct xfs_mount.
> 
> Signed-off-by: Ian Kent <raven@themaw.net>

Looks fine (there are direct callers of kmalloc for anyone who wants to
take on a small cleanup...)

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_super.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index a0805b74256c..896609827e3c 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1535,7 +1535,7 @@ xfs_mount_alloc(
>  {
>  	struct xfs_mount	*mp;
>  
> -	mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
> +	mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO);
>  	if (!mp)
>  		return NULL;
>  
> @@ -1749,7 +1749,7 @@ xfs_fs_fill_super(
>   out_free_names:
>  	sb->s_fs_info = NULL;
>  	xfs_free_names(mp);
> -	kfree(mp);
> +	kmem_free(mp);
>   out:
>  	return error;
>  
> @@ -1781,7 +1781,7 @@ xfs_fs_put_super(
>  
>  	sb->s_fs_info = NULL;
>  	xfs_free_names(mp);
> -	kfree(mp);
> +	kmem_free(mp);
>  }
>  
>  STATIC struct dentry *
>
Christoph Hellwig Oct. 25, 2019, 1:53 p.m. UTC | #2
On Thu, Oct 24, 2019 at 03:51:06PM +0800, Ian Kent wrote:
> The remount function uses the kmem functions for allocating and freeing
> struct xfs_mount, for consistency use the kmem functions everwhere for
> struct xfs_mount.
> 
> Signed-off-by: Ian Kent <raven@themaw.net>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index a0805b74256c..896609827e3c 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1535,7 +1535,7 @@  xfs_mount_alloc(
 {
 	struct xfs_mount	*mp;
 
-	mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
+	mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO);
 	if (!mp)
 		return NULL;
 
@@ -1749,7 +1749,7 @@  xfs_fs_fill_super(
  out_free_names:
 	sb->s_fs_info = NULL;
 	xfs_free_names(mp);
-	kfree(mp);
+	kmem_free(mp);
  out:
 	return error;
 
@@ -1781,7 +1781,7 @@  xfs_fs_put_super(
 
 	sb->s_fs_info = NULL;
 	xfs_free_names(mp);
-	kfree(mp);
+	kmem_free(mp);
 }
 
 STATIC struct dentry *