Skip to contentSkip to conversation

tools: Split <linux/gfp_types.h> out of <linux/gfp.h>

PATCH In review Wei Yang 2 participants 2 messages Sep 9, 2022

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 tools: Split <linux/gfp_types.h> out of <linux/gfp.h>

Commit 9f162193d6e4 ("radix-tree: replace gfp.h inclusion with gfp_types.h") change the include file, which is introduced in commit cb5a065b4ea9c ("headers/deps: mm: Split <linux/gfp_types.h> out of <linux/gfp.h>"). Since we don't do the split for test, current build for radix-tree would fail.

Let's do the same as in commit cb5a065b4ea9c ("headers/deps: mm:
Split <linux/gfp_types.h> out of <linux/gfp.h>").

CC Yury Norov <[email protected]>
CC Mike Rapoport <[email protected]>
CC Matthew Wilcox (Oracle) <[email protected]>
---
 tools/include/linux/gfp.h       | 21 +--------------------
 tools/include/linux/gfp_types.h | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 20 deletions(-)
 create mode 100644 tools/include/linux/gfp_types.h
tools/include/linux/gfp.h +1 -20
index b238dbc9eb85..6a10ff5f5be9 100644
@@ -3,26 +3,7 @@
 #define _TOOLS_INCLUDE_LINUX_GFP_H
 
 #include <linux/types.h>
-
-#define __GFP_BITS_SHIFT 26
-#define __GFP_BITS_MASK ((gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
-
-#define __GFP_HIGH		0x20u
-#define __GFP_IO		0x40u
-#define __GFP_FS		0x80u
-#define __GFP_NOWARN		0x200u
-#define __GFP_ZERO		0x8000u
-#define __GFP_ATOMIC		0x80000u
-#define __GFP_ACCOUNT		0x100000u
-#define __GFP_DIRECT_RECLAIM	0x400000u
-#define __GFP_KSWAPD_RECLAIM	0x2000000u
-
-#define __GFP_RECLAIM	(__GFP_DIRECT_RECLAIM | __GFP_KSWAPD_RECLAIM)
-
-#define GFP_ZONEMASK	0x0fu
-#define GFP_ATOMIC	(__GFP_HIGH | __GFP_ATOMIC | __GFP_KSWAPD_RECLAIM)
-#define GFP_KERNEL	(__GFP_RECLAIM | __GFP_IO | __GFP_FS)
-#define GFP_NOWAIT	(__GFP_KSWAPD_RECLAIM)
+#include <linux/gfp_types.h>
 
 static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
 {
tools/include/linux/gfp_types.h new file +27 -0
new file mode 100644
index 000000000000..cfeea788f273
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _TOOLS_INCLUDE_LINUX_GFP_TYPES_H
+#define _TOOLS_INCLUDE_LINUX_GFP_TYPES_H
+
+#include <linux/types.h>
+
+#define __GFP_BITS_SHIFT 26
+#define __GFP_BITS_MASK ((gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
+
+#define __GFP_HIGH		0x20u
+#define __GFP_IO		0x40u
+#define __GFP_FS		0x80u
+#define __GFP_NOWARN		0x200u
+#define __GFP_ZERO		0x8000u
+#define __GFP_ATOMIC		0x80000u
+#define __GFP_ACCOUNT		0x100000u
+#define __GFP_DIRECT_RECLAIM	0x400000u
+#define __GFP_KSWAPD_RECLAIM	0x2000000u
+
+#define __GFP_RECLAIM	(__GFP_DIRECT_RECLAIM | __GFP_KSWAPD_RECLAIM)
+
+#define GFP_ZONEMASK	0x0fu
+#define GFP_ATOMIC	(__GFP_HIGH | __GFP_ATOMIC | __GFP_KSWAPD_RECLAIM)
+#define GFP_KERNEL	(__GFP_RECLAIM | __GFP_IO | __GFP_FS)
+#define GFP_NOWAIT	(__GFP_KSWAPD_RECLAIM)
+
+#endif /* _TOOLS_INCLUDE_LINUX_GFP_TYPES_H */
Signature · 1 line
2.33.1
#1 lore raw
Quoted 5 lines · Wei Yang

Commit 9f162193d6e4 ("radix-tree: replace gfp.h inclusion with gfp_types.h") change the include file, which is introduced in commit cb5a065b4ea9c ("headers/deps: mm: Split <linux/gfp_types.h> out of <linux/gfp.h>"). Since we don't do the split for test, current build for radix-tree would fail.

https://lore.kernel.org/lkml/[email protected]/