Skip to content

Commit 2bf1aa0

Browse files
keithbuschkawasaki
authored andcommitted
block: add test of io_uring user metadata offsets
For devices with metadata, tests various userspace offsets with io_uring capabilities. If the metadata is formatted with ref tag protection information, test various seed offsets as well. Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent a37b49d commit 2bf1aa0

5 files changed

Lines changed: 532 additions & 8 deletions

File tree

src/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/loblksize
44
/loop_change_fd
55
/loop_get_status_null
6+
/metadata
67
/mount_clear_sock
78
/nbdsetsize
89
/openclose

src/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ C_TARGETS := \
2222
sg/syzkaller1 \
2323
zbdioctl
2424

25-
C_MINIUBLK := miniublk
25+
C_URING_TARGETS := miniublk \
26+
metadata
2627

2728
HAVE_LIBURING := $(call HAVE_C_MACRO,liburing.h,IORING_OP_URING_CMD)
2829
HAVE_UBLK_HEADER := $(call HAVE_C_HEADER,linux/ublk_cmd.h,1)
@@ -31,9 +32,9 @@ CXX_TARGETS := \
3132
discontiguous-io
3233

3334
ifeq ($(HAVE_LIBURING)$(HAVE_UBLK_HEADER), 11)
34-
TARGETS := $(C_TARGETS) $(CXX_TARGETS) $(C_MINIUBLK)
35+
TARGETS := $(C_TARGETS) $(CXX_TARGETS) $(C_URING_TARGETS)
3536
else
36-
$(info Skip $(C_MINIUBLK) build due to missing kernel header(v6.0+) or liburing(2.2+))
37+
$(info Skip $(C_URING_TARGETS) build due to missing kernel header(v6.0+) or liburing(2.2+))
3738
TARGETS := $(C_TARGETS) $(CXX_TARGETS)
3839
endif
3940

@@ -42,8 +43,8 @@ CONFIG_DEFS := $(call HAVE_C_HEADER,linux/blkzoned.h,-DHAVE_LINUX_BLKZONED_H)
4243
override CFLAGS := -O2 -Wall -Wshadow $(CFLAGS) $(CONFIG_DEFS)
4344
override CXXFLAGS := -O2 -std=c++11 -Wall -Wextra -Wshadow -Wno-sign-compare \
4445
-Werror $(CXXFLAGS) $(CONFIG_DEFS)
45-
MINIUBLK_FLAGS := -D_GNU_SOURCE
46-
MINIUBLK_LIBS := -lpthread -luring
46+
URING_FLAGS := -D_GNU_SOURCE
47+
URING_LIBS := -lpthread -luring
4748
LDFLAGS ?=
4849

4950
all: $(TARGETS)
@@ -61,8 +62,7 @@ $(C_TARGETS): %: %.c
6162
$(CXX_TARGETS): %: %.cpp
6263
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
6364

64-
$(C_MINIUBLK): %: miniublk.c
65-
$(CC) $(CFLAGS) $(LDFLAGS) $(MINIUBLK_FLAGS) -o $@ miniublk.c \
66-
$(MINIUBLK_LIBS)
65+
$(C_URING_TARGETS): %: %.c
66+
$(CC) $(CFLAGS) $(LDFLAGS) $(URING_FLAGS) -o $@ $^ $(URING_LIBS)
6767

6868
.PHONY: all clean install

0 commit comments

Comments
 (0)