Skip to content

Commit bda76cd

Browse files
committed
Try a few new things
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
1 parent 684c348 commit bda76cd

6 files changed

+131
-32
lines changed

0000RWF_NOWAIT.patch

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
diff --git a/CONFIG b/CONFIG
2+
index 89c34e90b..02ce04692 100644
3+
--- a/CONFIG
4+
+++ b/CONFIG
5+
@@ -256,3 +256,6 @@ CONFIG_COPY_FILE_RANGE=n
6+
7+
# liblz4 is available
8+
CONFIG_HAVE_LZ4=n
9+
+
10+
+# aio_rw_flags are enabled
11+
+CONFIG_HAVE_AIO_RW_FLAGS=n
12+
diff --git a/configure b/configure
13+
index 26c9b0f4d..d8daedc37 100755
14+
--- a/configure
15+
+++ b/configure
16+
@@ -860,6 +860,22 @@ if [[ $sys_name != "Linux" ]]; then
17+
fi
18+
fi
19+
20+
+if echo -e '#include <linux/fs.h>\n' \
21+
+ '#include <libaio.h>\n' \
22+
+ '#include <stddef.h>\n' \
23+
+ '#ifndef RWF_NOWAIT\n' \
24+
+ '#error "No RWF_NOWAIT is defined"\n' \
25+
+ '#endif\n' \
26+
+ 'int main(int argc, char **argv) {\n' \
27+
+ 'return offsetof(struct iocb, aio_rw_flags);\n}\n' \
28+
+ | "${BUILD_CMD[@]}" -c - ; then
29+
+ echo HAVE_AIO_RW_FLAGS=YES
30+
+ CONFIG[HAVE_AIO_RW_FLAGS]="y"
31+
+else
32+
+ echo HAVE_AIO_RW_FLAGS=NO
33+
+ CONFIG[HAVE_AIO_RW_FLAGS]="n"
34+
+fi
35+
+
36+
if [ "${CONFIG[RDMA]}" = "y" ]; then
37+
if [[ ! "${CONFIG[RDMA_PROV]}" == "verbs" ]] && [[ ! "${CONFIG[RDMA_PROV]}" == "mlx5_dv" ]]; then
38+
echo "Invalid RDMA provider specified, must be \"verbs\" or \"mlx5_dv\""
39+
diff --git a/module/bdev/aio/bdev_aio.c b/module/bdev/aio/bdev_aio.c
40+
index b51d6c83a..01914fb9d 100644
41+
--- a/module/bdev/aio/bdev_aio.c
42+
+++ b/module/bdev/aio/bdev_aio.c
43+
@@ -64,7 +64,7 @@ struct file_disk {
44+
struct spdk_bdev disk;
45+
char *filename;
46+
int fd;
47+
-#ifdef RWF_NOWAIT
48+
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
49+
bool use_nowait;
50+
#endif
51+
TAILQ_ENTRY(file_disk) link;
52+
@@ -116,7 +116,7 @@ bdev_aio_open(struct file_disk *disk)
53+
{
54+
int fd;
55+
int io_flag = disk->readonly ? O_RDONLY : O_RDWR;
56+
-#ifdef RWF_NOWAIT
57+
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
58+
struct stat st;
59+
#endif
60+
61+
@@ -134,7 +134,7 @@ bdev_aio_open(struct file_disk *disk)
62+
63+
disk->fd = fd;
64+
65+
-#ifdef RWF_NOWAIT
66+
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
67+
/* Some aio operations can block, for example if number outstanding
68+
* I/O exceeds number of block layer tags. But not all files can
69+
* support RWF_NOWAIT flag. So use RWF_NOWAIT on block devices only.
70+
@@ -212,7 +212,7 @@ bdev_aio_submit_io(enum spdk_bdev_io_type type, struct file_disk *fdisk,
71+
io_set_eventfd(iocb, aio_ch->group_ch->efd);
72+
}
73+
iocb->data = aio_task;
74+
-#ifdef RWF_NOWAIT
75+
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
76+
if (fdisk->use_nowait) {
77+
iocb->aio_rw_flags = RWF_NOWAIT;
78+
}

0000RemoveBrokenMockLib.patch

-26
This file was deleted.

0001use_python3_pip.patch renamed to 0001PythonPip.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/python/Makefile b/python/Makefile
2-
index 8e3492bff..85689d824 100644
2+
index b45c42328..4a5fb474b 100644
33
--- a/python/Makefile
44
+++ b/python/Makefile
55
@@ -7,7 +7,7 @@

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: BSD-2-Clause-Patent
22
# Copyright (c) 2019-2024 Intel Corporation
3+
# Copyright (c) 2025 Google LLC
34

45
NAME := spdk
56
SRC_EXT := gz
@@ -35,7 +36,7 @@ $(NAME)-$(VERSION).tar.gz: $(shell git ls-files src --recurse-submodules)
3536
echo Creating $@
3637
echo $(basename $@)
3738
rm -f $@
38-
git submodule update --init --recursive
39-
git ls-files --recurse-submodules src | tar --transform='s/^src/$(NAME)-$(VERSION)/' --hard-dereference -hczf $(NAME)-$(VERSION).tar.gz -T -
39+
./archive.sh . $(NAME) $(VERSION) tar
40+
gzip $(basename $@)
4041

41-
tarball: $(NAME)-$(VERSION).tar.gz
42+
tarball: $(NAME)-$(VERSION).tar.tz

archive.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
#
3+
# Usage: archive.sh <dir> <name> <version> <extension>
4+
#
5+
# Create an archive of the HEAD commit of a local Git repository, including
6+
# submodules.
7+
#
8+
# - Must run at the root of the Git repository.
9+
# - Must have all submodules recursively initialized and updated.
10+
# - Whitespaces are prohibited in any of the parameters.
11+
#
12+
# For example,
13+
#
14+
# archive.sh /a/b/c daos 1.2.3 tar
15+
#
16+
# produces /a/b/c/daos-1.2.3.tar.
17+
#
18+
19+
set -e
20+
21+
dir=$1
22+
name=$2
23+
version=$3
24+
ext=$4
25+
26+
# Use a temporary directory for all intermediate files.
27+
unset tmp
28+
trap 'if [ -n "${tmp}" ]; then rm -rf "${tmp}"; fi' EXIT
29+
tmp=$(mktemp -d)
30+
31+
file_extless="${name}-${version}"
32+
file="${file_extless}.${ext}"
33+
sm_file_prefix="${file_extless}-submodule"
34+
35+
# Create an archive, which doesn't include any submodule.
36+
git archive --prefix "${name}-${version}/" -o "${tmp}/${file}" HEAD
37+
38+
# Add all submodules to the archive.
39+
# shellcheck disable=SC2086,SC2016
40+
git submodule --quiet foreach --recursive \
41+
'tarfile='${tmp}/${sm_file_prefix}'-$name.'${ext}' && \
42+
git archive --prefix '${name}-${version}'/$displaypath/ -o ${tarfile} $sha1 && \
43+
tar -Af '"${tmp}/${file}"' ${tarfile}'
44+
45+
# Publish the archive.
46+
mv "${tmp}/${file}" "${dir}/${file}"

spdk.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Summary: Set of libraries and utilities for high performance user-mode storage
2323
License: BSD
2424
URL: http://spdk.io
2525
Source0: %{name}-%{version}.tar.gz
26-
Patch0: 0000RemoveBrokenMockLib.patch
27-
Patch1: 0001use_python3_pip.patch
26+
Patch0: 0000RWF_NOWAIT.patch
27+
Patch1: 0001PythonPip.patch
2828

2929
%define package_version %{epoch}:%{version}-%{release}
3030

0 commit comments

Comments
 (0)