Skip to content

Commit

Permalink
tools: include blk-mq.h in bio tools
Browse files Browse the repository at this point in the history
Kernel commit 24b83deb29b ("block: move struct request to blk-mq.h")
has moved struct request  from blkdev.h to blk-mq.h. It results in
several bio tools to fail with errors of the following type:

error: incomplete definition of type 'struct request'

Since blk-mq.h had always included blkdev.h. it is safe to simply
replace the inclusion of blkdev.h by blk-mq-h. It works on both older
and newer kernel.

Fixes: iovisor#3869

Signed-off-by: Jerome Marchand <[email protected]>
  • Loading branch information
jeromemarchand authored and yonghong-song committed Feb 23, 2022
1 parent 6361855 commit ee81072
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/biolatency.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# define BPF program
bpf_text = """
#include <uapi/linux/ptrace.h>
#include <linux/blkdev.h>
#include <linux/blk-mq.h>
typedef struct disk_key {
char disk[DISK_NAME_LEN];
Expand Down
2 changes: 1 addition & 1 deletion tools/biosnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# define BPF program
bpf_text="""
#include <uapi/linux/ptrace.h>
#include <linux/blkdev.h>
#include <linux/blk-mq.h>
// for saving the timestamp and __data_len of each request
struct start_req_t {
Expand Down
2 changes: 1 addition & 1 deletion tools/biotop.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# load BPF program
bpf_text = """
#include <uapi/linux/ptrace.h>
#include <linux/blkdev.h>
#include <linux/blk-mq.h>
// for saving the timestamp and __data_len of each request
struct start_req_t {
Expand Down

0 comments on commit ee81072

Please sign in to comment.