[PATCH v15 01/43] llist: move llist_{head,node} definition to types.h

Byungchul Park posted 43 patches 9 months ago
There is a newer version of this series
[PATCH v15 01/43] llist: move llist_{head,node} definition to types.h
Posted by Byungchul Park 9 months ago
llist_head and llist_node can be used by very primitives. For example,
dept for tracking dependencies uses llist in its header. To avoid header
dependency, move those to types.h.

Signed-off-by: Byungchul Park <byungchul@sk.com>
---
 include/linux/llist.h | 8 --------
 include/linux/types.h | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/linux/llist.h b/include/linux/llist.h
index 2c982ff7475a..3ac071857612 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -53,14 +53,6 @@
 #include <linux/stddef.h>
 #include <linux/types.h>
 
-struct llist_head {
-	struct llist_node *first;
-};
-
-struct llist_node {
-	struct llist_node *next;
-};
-
 #define LLIST_HEAD_INIT(name)	{ NULL }
 #define LLIST_HEAD(name)	struct llist_head name = LLIST_HEAD_INIT(name)
 
diff --git a/include/linux/types.h b/include/linux/types.h
index 49b79c8bb1a9..c727cc2249e8 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -204,6 +204,14 @@ struct hlist_node {
 	struct hlist_node *next, **pprev;
 };
 
+struct llist_head {
+	struct llist_node *first;
+};
+
+struct llist_node {
+	struct llist_node *next;
+};
+
 struct ustat {
 	__kernel_daddr_t	f_tfree;
 #ifdef CONFIG_ARCH_32BIT_USTAT_F_TINODE
-- 
2.17.1
Re: [PATCH v15 01/43] llist: move llist_{head,node} definition to types.h
Posted by Waiman Long 9 months ago
On 5/13/25 6:06 AM, Byungchul Park wrote:
> llist_head and llist_node can be used by very primitives. For example,

I suppose you mean "every primitives". Right? However, the term 
"primitive" may sound strange. Maybe just saying that it is used by some 
other header files.

Cheers,
Longman

> dept for tracking dependencies uses llist in its header. To avoid header
> dependency, move those to types.h.
>
> Signed-off-by: Byungchul Park <byungchul@sk.com>
> ---
>   include/linux/llist.h | 8 --------
>   include/linux/types.h | 8 ++++++++
>   2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/llist.h b/include/linux/llist.h
> index 2c982ff7475a..3ac071857612 100644
> --- a/include/linux/llist.h
> +++ b/include/linux/llist.h
> @@ -53,14 +53,6 @@
>   #include <linux/stddef.h>
>   #include <linux/types.h>
>   
> -struct llist_head {
> -	struct llist_node *first;
> -};
> -
> -struct llist_node {
> -	struct llist_node *next;
> -};
> -
>   #define LLIST_HEAD_INIT(name)	{ NULL }
>   #define LLIST_HEAD(name)	struct llist_head name = LLIST_HEAD_INIT(name)
>   
> diff --git a/include/linux/types.h b/include/linux/types.h
> index 49b79c8bb1a9..c727cc2249e8 100644
> --- a/include/linux/types.h
> +++ b/include/linux/types.h
> @@ -204,6 +204,14 @@ struct hlist_node {
>   	struct hlist_node *next, **pprev;
>   };
>   
> +struct llist_head {
> +	struct llist_node *first;
> +};
> +
> +struct llist_node {
> +	struct llist_node *next;
> +};
> +
>   struct ustat {
>   	__kernel_daddr_t	f_tfree;
>   #ifdef CONFIG_ARCH_32BIT_USTAT_F_TINODE
Re: [PATCH v15 01/43] llist: move llist_{head,node} definition to types.h
Posted by Byungchul Park 9 months ago
On Wed, May 14, 2025 at 08:14:26PM -0400, Waiman Long wrote:
> On 5/13/25 6:06 AM, Byungchul Park wrote:
> > llist_head and llist_node can be used by very primitives. For example,
> 
> I suppose you mean "every primitives". Right? However, the term "primitive"
> may sound strange. Maybe just saying that it is used by some other header
> files.

Thank you.  I will apply it.

	Byungchul
> 
> Cheers,
> Longman
> 
> > dept for tracking dependencies uses llist in its header. To avoid header
> > dependency, move those to types.h.
> > 
> > Signed-off-by: Byungchul Park <byungchul@sk.com>
> > ---
> >   include/linux/llist.h | 8 --------
> >   include/linux/types.h | 8 ++++++++
> >   2 files changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/include/linux/llist.h b/include/linux/llist.h
> > index 2c982ff7475a..3ac071857612 100644
> > --- a/include/linux/llist.h
> > +++ b/include/linux/llist.h
> > @@ -53,14 +53,6 @@
> >   #include <linux/stddef.h>
> >   #include <linux/types.h>
> > -struct llist_head {
> > -	struct llist_node *first;
> > -};
> > -
> > -struct llist_node {
> > -	struct llist_node *next;
> > -};
> > -
> >   #define LLIST_HEAD_INIT(name)	{ NULL }
> >   #define LLIST_HEAD(name)	struct llist_head name = LLIST_HEAD_INIT(name)
> > diff --git a/include/linux/types.h b/include/linux/types.h
> > index 49b79c8bb1a9..c727cc2249e8 100644
> > --- a/include/linux/types.h
> > +++ b/include/linux/types.h
> > @@ -204,6 +204,14 @@ struct hlist_node {
> >   	struct hlist_node *next, **pprev;
> >   };
> > +struct llist_head {
> > +	struct llist_node *first;
> > +};
> > +
> > +struct llist_node {
> > +	struct llist_node *next;
> > +};
> > +
> >   struct ustat {
> >   	__kernel_daddr_t	f_tfree;
> >   #ifdef CONFIG_ARCH_32BIT_USTAT_F_TINODE
>