diff options
author | Dan Williams <dan.j.williams@intel.com> | 2019-11-06 17:43:31 -0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-11-07 15:44:29 +0100 |
commit | 33dd70752cd76f4d883a165a674f13121a4155ed (patch) | |
tree | fd7d361649e73adafe59ade9db9429a1be4e0516 /include/linux/memregion.h | |
parent | 199c8471761273b7e287914cee968ddf21dfbfe0 (diff) | |
download | lwn-33dd70752cd76f4d883a165a674f13121a4155ed.tar.gz lwn-33dd70752cd76f4d883a165a674f13121a4155ed.zip |
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>
Diffstat (limited to 'include/linux/memregion.h')
-rw-r--r-- | include/linux/memregion.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/memregion.h b/include/linux/memregion.h new file mode 100644 index 000000000000..7de7c0a1444e --- /dev/null +++ b/include/linux/memregion.h @@ -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_ */ |