diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e336e4db..ae7807eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,12 @@ Function spdk_blobfs_bdev_detect is added to detect whether blobfs exists on the Function spdk_blobfs_bdev_create is added to create a blobfs on the given block device. +### build + +Option to build FUSE components into blobfs_bdev module for mounting a blobfs filesystem. +It requires the installation of libfuse3. By default, it is disabled. And it will be +enabled if run `./configure` with `--with-fuse` option. + ### nvme Added `no_shn_notification` to NVMe controller initialization options, users can enable diff --git a/CONFIG b/CONFIG index b01f14a81..1d6e5c909 100644 --- a/CONFIG +++ b/CONFIG @@ -153,3 +153,6 @@ CONFIG_URING=n # Path to custom built IO_URING library CONFIG_URING_PATH= + +# Build with FUSE support +CONFIG_FUSE=n diff --git a/configure b/configure index 79968950a..e4e6dae10 100755 --- a/configure +++ b/configure @@ -92,6 +92,8 @@ function usage() echo " If an argument is provided, it is considered a directory containing" echo " liburing.a and io_uring.h. Otherwise the regular system paths will" echo " be searched." + echo " fuse Build FUSE components for mounting a blobfs filesystem." + echo " No path required." echo "" echo "Environment variables:" echo "" @@ -355,6 +357,12 @@ for i in "$@"; do CONFIG[URING]=n CONFIG[URING_PATH]= ;; + --with-fuse) + CONFIG[FUSE]=y + ;; + --without-fuse) + CONFIG[FUSE]=n + ;; --) break ;; @@ -693,6 +701,14 @@ if [[ "${CONFIG[URING]}" = "y" ]]; then fi fi +if [[ "${CONFIG[FUSE]}" = "y" ]]; then + if [[ ! -d /usr/include/fuse3 ]] && [[ ! -d /usr/local/include/fuse3 ]]; then + echo "--with-fuse requires libfuse3." + echo "Please install then re-run this script." + exit 1 + fi +fi + # We are now ready to generate final configuration. But first do sanity # check to see if all keys in CONFIG array have its reflection in CONFIG file. if [ $(egrep -c "^\s*CONFIG_[[:alnum:]_]+=" $rootdir/CONFIG) -ne ${#CONFIG[@]} ]; then diff --git a/test/app/bdev_svc/Makefile b/test/app/bdev_svc/Makefile index 23dc35126..4ce725a13 100644 --- a/test/app/bdev_svc/Makefile +++ b/test/app/bdev_svc/Makefile @@ -55,4 +55,9 @@ endif SYS_LIBS += -lufc endif +# libfuse3 is required internally by blobfs_bdev +ifeq ($(CONFIG_FUSE),y) +LIBS+= -L/usr/local/lib -lfuse3 +endif + include $(SPDK_ROOT_DIR)/mk/spdk.app.mk diff --git a/test/blobfs/mkfs/Makefile b/test/blobfs/mkfs/Makefile index 7b37d7d73..81a4b944e 100644 --- a/test/blobfs/mkfs/Makefile +++ b/test/blobfs/mkfs/Makefile @@ -44,4 +44,9 @@ SPDK_LIB_LIST += event_bdev event_copy event_vmd SPDK_LIB_LIST += bdev copy event thread util conf trace \ log jsonrpc json rpc sock notify blobfs_bdev +# libfuse3 is required internally by blobfs_bdev +ifeq ($(CONFIG_FUSE),y) +LIBS+= -L/usr/local/lib -lfuse3 +endif + include $(SPDK_ROOT_DIR)/mk/spdk.app.mk diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index fdb0a176f..b5067d2a8 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -214,6 +214,14 @@ if [ $SPDK_TEST_ISAL -eq 0 ]; then config_params+=' --without-isal' fi +if [ $SPDK_TEST_BLOBFS -eq 1 ]; then + if [[ -d /usr/include/fuse3 ]] && [[ -d /usr/local/include/fuse3 ]]; then + config_params+=' --with-fuse' + else + echo "FUSE not enabled because libfuse3 is not installed." + fi +fi + # By default, --with-dpdk is not set meaning the SPDK build will use the DPDK submodule. # If a DPDK installation is found in a well-known location though, WITH_DPDK_DIR will be # set which will override the default and use that DPDK installation instead.