Recent changes (master)

Jens Axboe <[email protected]>
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
The following changes since commit f4e54d3fa7bf94a17648a4439f06ca7dab4291c0:

  man: Fix recover_zbd_write_error option description (2025-05-09 08:40:30 -0400)

are available in the Git repository at:

  git://git.kernel.dk/fio.git master

for you to fetch changes up to 171e18146a3ea26491b087a29c6ee7b0ad21e719:

  configure: Fix libnfs cflags and libs (2025-05-14 06:56:13 -0400)

----------------------------------------------------------------
Damien Le Moal (1):
      configure: Fix libnfs cflags and libs

Shin'ichiro Kawasaki (1):
      fio_sem, diskutil: introduce fio_shared_sem and use it for diskutil lock

 Makefile              |  2 +-
 ci/actions-install.sh |  2 ++
 configure             |  4 ++--
 diskutil.c            |  4 ++--
 fio_sem.h             |  2 ++
 fio_shared_sem.c      | 42 ++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 51 insertions(+), 5 deletions(-)
 create mode 100644 fio_shared_sem.c

---

Diff of recent changes:

diff --git a/Makefile b/Makefile
index 173378fa..f3a80882 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ SOURCE :=	$(sort $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/crc/*.c)) \
 		$(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/lib/*.c))) \
 		gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \
 		eta.c verify.c memory.c io_u.c parse.c fio_sem.c rwlock.c \
-		pshared.c options.c \
+		pshared.c options.c fio_shared_sem.c \
 		smalloc.c filehash.c profile.c debug.c engines/cpu.c \
 		engines/mmap.c engines/sync.c engines/null.c engines/net.c \
 		engines/ftruncate.c engines/fileoperations.c \
diff --git a/ci/actions-install.sh b/ci/actions-install.sh
index ad352317..30b815f3 100755
--- a/ci/actions-install.sh
+++ b/ci/actions-install.sh
@@ -32,6 +32,7 @@ DPKGCFG
         libcunit1-dev
         libcurl4-openssl-dev
         libfl-dev
+	libgnutls28-dev
         libnuma-dev
 	libnfs-dev
         valgrind
@@ -106,6 +107,7 @@ install_fedora() {
         bison-devel
         git
         flex-devel
+	gnutls-devel
         gperftools
         isa-l-devel
         kernel-devel
diff --git a/configure b/configure
index 715f0602..986eb0a6 100755
--- a/configure
+++ b/configure
@@ -2361,8 +2361,8 @@ print_config "DAOS File System (dfs) Engine" "$dfs"
 if test "$libnfs" != "no" ; then
   if $(pkg-config libnfs > /dev/null 2>&1); then
     libnfs="yes"
-    libnfs_cflags=$(pkg-config --cflags libnfs)
-    libnfs_libs=$(pkg-config --libs libnfs)
+    libnfs_cflags=$(pkg-config --cflags libnfs gnutls)
+    libnfs_libs=$(pkg-config --libs libnfs gnutls)
   else
     if test "$libnfs" = "yes" ; then
       feature_not_found "libnfs" "libnfs"
diff --git a/diskutil.c b/diskutil.c
index 69b3dd26..f018015c 100644
--- a/diskutil.c
+++ b/diskutil.c
@@ -38,7 +38,7 @@ static void disk_util_free(struct disk_util *du)
 		slave->users--;
 	}
 
-	fio_sem_remove(du->lock);
+	fio_shared_sem_remove(du->lock);
 	free(du->sysfs_root);
 	sfree(du);
 }
@@ -327,7 +327,7 @@ static struct disk_util *disk_util_add(struct thread_data *td, int majdev,
 	du->minor = mindev;
 	INIT_FLIST_HEAD(&du->slavelist);
 	INIT_FLIST_HEAD(&du->slaves);
-	du->lock = fio_sem_init(FIO_SEM_UNLOCKED);
+	du->lock = fio_shared_sem_init(FIO_SEM_UNLOCKED);
 	du->users = 0;
 
 	fio_sem_down(disk_util_sem);
diff --git a/fio_sem.h b/fio_sem.h
index a796ddd7..a06f6eb7 100644
--- a/fio_sem.h
+++ b/fio_sem.h
@@ -21,8 +21,10 @@ enum {
 
 extern int __fio_sem_init(struct fio_sem *, int);
 extern struct fio_sem *fio_sem_init(int);
+extern struct fio_sem *fio_shared_sem_init(int);
 extern void __fio_sem_remove(struct fio_sem *);
 extern void fio_sem_remove(struct fio_sem *);
+extern void fio_shared_sem_remove(struct fio_sem *);
 extern void fio_sem_up(struct fio_sem *);
 extern void fio_sem_down(struct fio_sem *);
 extern bool fio_sem_down_trylock(struct fio_sem *);
diff --git a/fio_shared_sem.c b/fio_shared_sem.c
new file mode 100644
index 00000000..bc26bbe7
--- /dev/null
+++ b/fio_shared_sem.c
@@ -0,0 +1,42 @@
+/*
+ * Separate out the two helper functions for fio_sem from "fio_sem.c".
+ * These two functions depend on fio shared memory. Other fio_sem
+ * functions in "fio_sem.c" are used for fio shared memory. This file
+ * separation is required to avoid build failures caused by circular
+ * dependency.
+ */
+
+#include <stdio.h>
+
+#include "fio_sem.h"
+#include "smalloc.h"
+
+/*
+ * Allocate and initialize fio_sem lock object in the same manner as
+ * fio_sem_init(), except the lock object is allocated from the fio
+ * shared memory. This allows the parent process to free the lock
+ * allocated by child processes.
+ */
+struct fio_sem *fio_shared_sem_init(int value)
+{
+	struct fio_sem *sem;
+
+	sem = smalloc(sizeof(struct fio_sem));
+	if (!sem)
+		return NULL;
+
+	if (!__fio_sem_init(sem, value))
+		return sem;
+
+	fio_shared_sem_remove(sem);
+	return NULL;
+}
+
+/*
+ * Free the fio_sem lock object allocated by fio_shared_sem_init().
+ */
+void fio_shared_sem_remove(struct fio_sem *sem)
+{
+	__fio_sem_remove(sem);
+	sfree(sem);
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.