lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150129154652.GK17652@laptop.bfoster>
Date:	Thu, 29 Jan 2015 10:46:52 -0500
From:	Brian Foster <bfoster@...hat.com>
To:	"Wang, Yalin" <Yalin.Wang@...ymobile.com>
Cc:	"'david@...morbit.com'" <david@...morbit.com>,
	"'xfs@....sgi.com'" <xfs@....sgi.com>,
	"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xfs:change kmem_free to use generic kvfree()

On Wed, Jan 28, 2015 at 02:08:47PM +0800, Wang, Yalin wrote:
> Change kmem_free to use kvfree() generic function,
> remove the duplicated code.
> 
> Signed-off-by: Yalin Wang <yalin.wang@...ymobile.com>
> ---

Looks good...

Reviewed-by: Brian Foster <bfoster@...hat.com>

>  fs/xfs/kmem.c | 10 ----------
>  fs/xfs/kmem.h |  5 ++++-
>  2 files changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/xfs/kmem.c b/fs/xfs/kmem.c
> index 53e95b2..a7a3a63 100644
> --- a/fs/xfs/kmem.c
> +++ b/fs/xfs/kmem.c
> @@ -91,16 +91,6 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags)
>  	return ptr;
>  }
>  
> -void
> -kmem_free(const void *ptr)
> -{
> -	if (!is_vmalloc_addr(ptr)) {
> -		kfree(ptr);
> -	} else {
> -		vfree(ptr);
> -	}
> -}
> -
>  void *
>  kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
>  	     xfs_km_flags_t flags)
> diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h
> index 64db0e5..cc6b768 100644
> --- a/fs/xfs/kmem.h
> +++ b/fs/xfs/kmem.h
> @@ -63,7 +63,10 @@ kmem_flags_convert(xfs_km_flags_t flags)
>  extern void *kmem_alloc(size_t, xfs_km_flags_t);
>  extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t);
>  extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t);
> -extern void  kmem_free(const void *);
> +static inline void  kmem_free(const void *ptr)
> +{
> +	kvfree(ptr);
> +}
>  
>  
>  extern void *kmem_zalloc_greedy(size_t *, size_t, size_t);
> -- 
> 2.2.2
> 
> _______________________________________________
> xfs mailing list
> xfs@....sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ