Skip to content

Commit 00ff8f5

Browse files
committed
fix compilcation for linux 5.15
Signed-off-by: YangKeao <[email protected]>
1 parent 6e13aa7 commit 00ff8f5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

driver/ioem.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ struct request;
1616
#include <linux/sched.h>
1717
#include <linux/sched/task.h>
1818

19+
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 0)
20+
#include <linux/backing-dev-defs.h>
21+
#endif
22+
1923
#include "ioem.h"
2024
#include "comp.h"
2125

@@ -524,7 +528,9 @@ static int ioem_mq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
524528
ioem_data_init(id, ioem_mq_timer, hctx->queue->elevator->elevator_data);
525529
id->hctx = hctx;
526530

527-
#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 0, 0)
531+
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 0)
532+
id->device = hctx->queue->disk->bdi->dev->devt;
533+
#elif LINUX_VERSION_CODE > KERNEL_VERSION(4, 0, 0)
528534
id->device = hctx->queue->backing_dev_info->dev->devt;
529535
#else
530536
id->device = hctx->queue->backing_dev_info.dev->devt;
@@ -1187,4 +1193,4 @@ static void ioem_data_sync_with_injections(struct ioem_data* data)
11871193

11881194
read_unlock(&ioem_injections.lock);
11891195
}
1190-
}
1196+
}

0 commit comments

Comments
 (0)