lib: Uplevel the pmem "region" ida to a global allocator
In preparation for handling platform differentiated memory types beyond persistent memory, uplevel the "region" identifier to a global number space. This enables a device-dax instance to be registered to any memory type with guaranteed unique names. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
199c847176
commit
33dd70752c
19
include/linux/memregion.h
Normal file
19
include/linux/memregion.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _MEMREGION_H_
|
||||
#define _MEMREGION_H_
|
||||
#include <linux/types.h>
|
||||
#include <linux/errno.h>
|
||||
|
||||
#ifdef CONFIG_MEMREGION
|
||||
int memregion_alloc(gfp_t gfp);
|
||||
void memregion_free(int id);
|
||||
#else
|
||||
static inline int memregion_alloc(gfp_t gfp)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
void memregion_free(int id)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif /* _MEMREGION_H_ */
|
Reference in New Issue
Block a user