mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
sctp: remove extern from stream sched
Now each stream sched ops is defined in different .c file and added into the global ops in another .c file, it uses extern to make this work. However extern is not good coding style to get them in and even make C=2 reports errors for this. This patch adds sctp_sched_ops_xxx_init for each stream sched ops in their .c file, then get them into the global ops by calling them when initializing sctp module. Fixes:637784ade2
("sctp: introduce priority based stream scheduler") Fixes:ac1ed8b82c
("sctp: introduce round robin stream scheduler") Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
af2697a027
commit
1ba896f6f5
6 changed files with 41 additions and 9 deletions
|
@ -119,16 +119,27 @@ static struct sctp_sched_ops sctp_sched_fcfs = {
|
|||
.unsched_all = sctp_sched_fcfs_unsched_all,
|
||||
};
|
||||
|
||||
static void sctp_sched_ops_fcfs_init(void)
|
||||
{
|
||||
sctp_sched_ops_register(SCTP_SS_FCFS, &sctp_sched_fcfs);
|
||||
}
|
||||
|
||||
/* API to other parts of the stack */
|
||||
|
||||
extern struct sctp_sched_ops sctp_sched_prio;
|
||||
extern struct sctp_sched_ops sctp_sched_rr;
|
||||
static struct sctp_sched_ops *sctp_sched_ops[SCTP_SS_MAX + 1];
|
||||
|
||||
static struct sctp_sched_ops *sctp_sched_ops[] = {
|
||||
&sctp_sched_fcfs,
|
||||
&sctp_sched_prio,
|
||||
&sctp_sched_rr,
|
||||
};
|
||||
void sctp_sched_ops_register(enum sctp_sched_type sched,
|
||||
struct sctp_sched_ops *sched_ops)
|
||||
{
|
||||
sctp_sched_ops[sched] = sched_ops;
|
||||
}
|
||||
|
||||
void sctp_sched_ops_init(void)
|
||||
{
|
||||
sctp_sched_ops_fcfs_init();
|
||||
sctp_sched_ops_prio_init();
|
||||
sctp_sched_ops_rr_init();
|
||||
}
|
||||
|
||||
int sctp_sched_set_sched(struct sctp_association *asoc,
|
||||
enum sctp_sched_type sched)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue