Fix a mbuf circular dependency issue.

mbuf.h->cgroup.h->cgroup-defs.h
   ^                    |
   |                    |
   ----------------------

May led below warning/error:
In file included from /virtual/main.c:7:
In file included from include/linux/cgroup-defs.h:25:
In file included from include/linux/mbuf.h:6:
include/linux/cgroup.h:115:61: warning: declaration of 'struct cftype'
will not be visible outside of this function [-Wvisibility]
int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
                                                            ^
...
include/linux/cgroup.h:318:11: error: incomplete definition of type
'struct cgroup_subsys_state'
        if (!(css->flags & CSS_NO_REF))
              ~~~^
This commit is contained in:
Haisu Wang 2022-05-05 10:49:37 +08:00 committed by Miao Yan
parent 97c33475c7
commit 32eeb0052e
2 changed files with 3 additions and 4 deletions

View File

@ -21,7 +21,6 @@
#include <linux/workqueue.h>
#include <linux/bpf-cgroup.h>
#include <linux/psi_types.h>
#include <linux/mbuf.h>
#ifdef CONFIG_CGROUPS

View File

@ -3,12 +3,12 @@
* Copyright (C) 2021 bauerchen <bauerchen@tencent.com>
*/
#include <linux/cgroup.h>
#include <linux/rwsem.h>
#ifndef _CGROUP_MBUF_H
#define _CGROUP_MBUF_H
#include <linux/cgroup.h>
#include <linux/rwsem.h>
struct mbuf_struct {
u32 mbuf_len;
u32 mbuf_max_slots;