Re: [PATCH] backport: add some new kv[mz]alloc function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/21/2017 08:55 AM, AceLan Kao wrote:
> add some new kv[mz]alloc functions which introduced after v4.12
> by this commit
> 
> commit a7c3e901a46ff54c016d040847eda598a9e3e653
> Author: Michal Hocko <mhocko@xxxxxxxx>
> Date:   Mon May 8 15:57:09 2017 -0700
> 
>     mm: introduce kv[mz]alloc helpers
> 
> Signed-off-by: AceLan Kao <acelan.kao@xxxxxxxxxxxxx>
> ---
>  backport/backport-include/linux/mm.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
> index 3234b37..8125310 100644
> --- a/backport/backport-include/linux/mm.h
> +++ b/backport/backport-include/linux/mm.h
> @@ -123,4 +123,20 @@ static inline bool page_is_pfmemalloc(struct page *page)
>  }
>  #endif /* < 4.2 */
>  
> +#if LINUX_VERSION_IS_LESS(4,12,0)
> +extern void *kvmalloc_node(size_t size, gfp_t flags, int node);

Is kvmalloc_node() implemented somewhere? It was added in kernel 4.12
and is not available in older mainline kernel versions.

> +static inline void *kvmalloc(size_t size, gfp_t flags)
> +{
> +	return kvmalloc_node(size, flags, NUMA_NO_NODE);
> +}
> +static inline void *kvzalloc_node(size_t size, gfp_t flags, int node)
> +{
> +	return kvmalloc_node(size, flags | __GFP_ZERO, node);
> +}
> +static inline void *kvzalloc(size_t size, gfp_t flags)
> +{
> +	return kvmalloc(size, flags | __GFP_ZERO);
> +}
> +#endif /* < 4.12.0 */
> +
>  #endif /* __BACKPORT_MM_H */
> 

Hauke

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux