Skip to contentSkip to conversation

kernfs: Replace kernel.h with the necessary inclusions

PATCH In review Andy Shevchenko 2 participants 2 messages Dec 9, 2021 kernfs

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernfs: Replace kernel.h with the necessary inclusions

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

---
 include/linux/kernfs.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/kernfs.h +3 -1
index 9f650986a81b..861c4f0f8a29 100644
@@ -6,7 +6,6 @@
 #ifndef __LINUX_KERNFS_H
 #define __LINUX_KERNFS_H
 
-#include <linux/kernel.h>
 #include <linux/err.h>
 #include <linux/list.h>
 #include <linux/mutex.h>
@@ -14,6 +13,8 @@
 #include <linux/lockdep.h>
 #include <linux/rbtree.h>
 #include <linux/atomic.h>
+#include <linux/bug.h>
+#include <linux/types.h>
 #include <linux/uidgid.h>
 #include <linux/wait.h>
 #include <linux/rwsem.h>
@@ -23,6 +24,7 @@ struct dentry;
 struct iattr;
 struct seq_file;
 struct vm_area_struct;
+struct vm_operations_struct;
 struct super_block;
 struct file_system_type;
 struct poll_table_struct;
Signature · 1 line
2.33.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Andy Shevchenko

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Thanks.

Signature · 1 line
tejun