Skip to content

Commit 19c8e49

Browse files
committed
work around API+ABI break in the so-called “stable” Linux kernel
1 parent 7933035 commit 19c8e49

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

sch_jens/Kbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@ else
66
obj-m := sch_jens.o sch_jhtb.o
77
#ccflags-y += -fverbose-asm -save-temps=obj
88
endif
9+
10+
# work around stable kernel API+ABI breakage
11+
ifeq (4,$(strip ${VERSION}))
12+
ifeq (19,$(strip ${PATCHLEVEL}))
13+
ccflags-y += -DJENS_LINUX_4_19_SL=$(strip ${SUBLEVEL})
14+
endif
15+
endif

sch_jens/sch_jhtb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,8 @@ static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)
12731273
{
12741274
if (!cl->level) {
12751275
WARN_ON(!cl->leaf.q);
1276-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
1276+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)) && \
1277+
(!defined(JENS_LINUX_4_19_SL) || (JENS_LINUX_4_19_SL < 221))
12771278
qdisc_destroy(cl->leaf.q);
12781279
#else
12791280
qdisc_put(cl->leaf.q);
@@ -1588,7 +1589,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
15881589
cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer);
15891590

15901591
sch_tree_unlock(sch);
1591-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
1592+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)) && \
1593+
(!defined(JENS_LINUX_4_19_SL) || (JENS_LINUX_4_19_SL < 221))
15921594
qdisc_destroy(parent_qdisc);
15931595
#else
15941596
qdisc_put(parent_qdisc);

0 commit comments

Comments
 (0)