peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0085-virtiofsd-support-nanosecond-resolution-for-file-tim.patch

1d442b
From: Jiufei Xue <jiufei.xue@linux.alibaba.com>
1d442b
Date: Mon, 27 Jan 2020 19:01:54 +0000
1d442b
Subject: [PATCH] virtiofsd: support nanosecond resolution for file timestamp
1d442b
MIME-Version: 1.0
1d442b
Content-Type: text/plain; charset=UTF-8
1d442b
Content-Transfer-Encoding: 8bit
1d442b
1d442b
Define HAVE_STRUCT_STAT_ST_ATIM to 1 if `st_atim' is member of `struct
1d442b
stat' which means support nanosecond resolution for the file timestamp
1d442b
fields.
1d442b
1d442b
Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com>
1d442b
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit 8a792b034d4b315251fd842bb4c73a133aa1368f)
1d442b
---
1d442b
 configure                   | 16 ++++++++++++++++
1d442b
 tools/virtiofsd/fuse_misc.h |  1 +
1d442b
 2 files changed, 17 insertions(+)
1d442b
1d442b
diff --git a/configure b/configure
1d442b
index afe9393f04..dd50b03b01 100755
1d442b
--- a/configure
1d442b
+++ b/configure
1d442b
@@ -5217,6 +5217,19 @@ if compile_prog "" "" ; then
1d442b
     strchrnul=yes
1d442b
 fi
1d442b
 
1d442b
+#########################################
1d442b
+# check if we have st_atim
1d442b
+
1d442b
+st_atim=no
1d442b
+cat > $TMPC << EOF
1d442b
+#include <sys/stat.h>
1d442b
+#include <stddef.h>
1d442b
+int main(void) { return offsetof(struct stat, st_atim); }
1d442b
+EOF
1d442b
+if compile_prog "" "" ; then
1d442b
+    st_atim=yes
1d442b
+fi
1d442b
+
1d442b
 ##########################################
1d442b
 # check if trace backend exists
1d442b
 
1d442b
@@ -6918,6 +6931,9 @@ fi
1d442b
 if test "$strchrnul" = "yes" ; then
1d442b
   echo "HAVE_STRCHRNUL=y" >> $config_host_mak
1d442b
 fi
1d442b
+if test "$st_atim" = "yes" ; then
1d442b
+  echo "HAVE_STRUCT_STAT_ST_ATIM=y" >> $config_host_mak
1d442b
+fi
1d442b
 if test "$byteswap_h" = "yes" ; then
1d442b
   echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
1d442b
 fi
1d442b
diff --git a/tools/virtiofsd/fuse_misc.h b/tools/virtiofsd/fuse_misc.h
1d442b
index f252baa752..5c618ce21f 100644
1d442b
--- a/tools/virtiofsd/fuse_misc.h
1d442b
+++ b/tools/virtiofsd/fuse_misc.h
1d442b
@@ -7,6 +7,7 @@
1d442b
  */
1d442b
 
1d442b
 #include <pthread.h>
1d442b
+#include "config-host.h"
1d442b
 
1d442b
 /*
1d442b
  * Versioned symbols cannot be used in some cases because it