]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
selftests: ublk: fix build failure
authorMing Lei <ming.lei@redhat.com>
Mon, 3 Mar 2025 12:43:12 +0000 (20:43 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 10 Mar 2025 15:17:13 +0000 (09:17 -0600)
Fixes the following build failure:

ublk//file_backed.c: In function ‘backing_file_tgt_init’:
ublk//file_backed.c:28:42: error: ‘O_DIRECT’ undeclared (first use in this function); did you mean ‘O_DIRECTORY’?
   28 |                 fd = open(file, O_RDWR | O_DIRECT);
      |                                          ^~~~~~~~
      |                                          O_DIRECTORY

when trying to reuse this same utility for liburing test.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20250303124324.3563605-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/kublk.h

index 8e43aebf7dfc32f032e597a63e6f76095a3208fa..8f48eb8568ab4154656acc58a1744c3f75619aff 100644 (file)
@@ -12,6 +12,7 @@
 #include <getopt.h>
 #include <limits.h>
 #include <poll.h>
+#include <fcntl.h>
 #include <sys/syscall.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>