Skip to content

Confusion between variable definition and declaration - __read_mostly macro not handled on Linux #211

@sk-buff

Description

@sk-buff

When I searched the identifier pfifo_fast_ops in the newest kernel v5.12-rc5, I found the result confused the definition and the declaration of the identifier. The result showed pfifo_fast_ops is defined at include/net/sch_generic.h, line 574 (as a externvar). However, it's a declaration of a extern variable instead of a definition, which is like the following:

extern struct Qdisc_ops pfifo_fast_ops;

The definition of pfifo_fast_ops actually locates in net/sched/sch_generic.c, line 782 and is showed in the Referenced part in the result.The definition is:

struct Qdisc_ops pfifo_fast_ops __read_mostly = {
	.id		=	"pfifo_fast",
	.priv_size	=	sizeof(struct pfifo_fast_priv),
	.enqueue	=	pfifo_fast_enqueue,
	.dequeue	=	pfifo_fast_dequeue,
	.peek		=	pfifo_fast_peek,
	.init		=	pfifo_fast_init,
	.destroy	=	pfifo_fast_destroy,
	.reset		=	pfifo_fast_reset,
	.dump		=	pfifo_fast_dump,
	.change_tx_queue_len =  pfifo_fast_change_tx_queue_len,
	.owner		=	THIS_MODULE,
	.static_flags	=	TCQ_F_NOLOCK | TCQ_F_CPUSTATS,
};

I don't know whether it's a mistake, plz check it :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    indexingRelated to the index content — missing definitions/references, lexer bugs, new ctags features...

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions