cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-virtiofsd-support-nanosecond-resolution-for-file-tim.patch

22c213
From 1744329bcba4a3e1a82cec3b1a34b3fbf0a9d7cf Mon Sep 17 00:00:00 2001
22c213
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
22c213
Date: Mon, 27 Jan 2020 19:01:54 +0100
22c213
Subject: [PATCH 083/116] virtiofsd: support nanosecond resolution for file
22c213
 timestamp
22c213
MIME-Version: 1.0
22c213
Content-Type: text/plain; charset=UTF-8
22c213
Content-Transfer-Encoding: 8bit
22c213
22c213
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
22c213
Message-id: <20200127190227.40942-80-dgilbert@redhat.com>
22c213
Patchwork-id: 93535
22c213
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 079/112] virtiofsd: support nanosecond resolution for file timestamp
22c213
Bugzilla: 1694164
22c213
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
22c213
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
22c213
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
22c213
22c213
From: Jiufei Xue <jiufei.xue@linux.alibaba.com>
22c213
22c213
Define HAVE_STRUCT_STAT_ST_ATIM to 1 if `st_atim' is member of `struct
22c213
stat' which means support nanosecond resolution for the file timestamp
22c213
fields.
22c213
22c213
Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com>
22c213
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
22c213
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
22c213
(cherry picked from commit 8a792b034d4b315251fd842bb4c73a133aa1368f)
22c213
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
22c213
---
22c213
 configure                   | 16 ++++++++++++++++
22c213
 tools/virtiofsd/fuse_misc.h |  1 +
22c213
 2 files changed, 17 insertions(+)
22c213
22c213
diff --git a/configure b/configure
22c213
index 7831618..5120c14 100755
22c213
--- a/configure
22c213
+++ b/configure
22c213
@@ -5218,6 +5218,19 @@ if compile_prog "" "" ; then
22c213
     strchrnul=yes
22c213
 fi
22c213
 
22c213
+#########################################
22c213
+# check if we have st_atim
22c213
+
22c213
+st_atim=no
22c213
+cat > $TMPC << EOF
22c213
+#include <sys/stat.h>
22c213
+#include <stddef.h>
22c213
+int main(void) { return offsetof(struct stat, st_atim); }
22c213
+EOF
22c213
+if compile_prog "" "" ; then
22c213
+    st_atim=yes
22c213
+fi
22c213
+
22c213
 ##########################################
22c213
 # check if trace backend exists
22c213
 
22c213
@@ -6919,6 +6932,9 @@ fi
22c213
 if test "$strchrnul" = "yes" ; then
22c213
   echo "HAVE_STRCHRNUL=y" >> $config_host_mak
22c213
 fi
22c213
+if test "$st_atim" = "yes" ; then
22c213
+  echo "HAVE_STRUCT_STAT_ST_ATIM=y" >> $config_host_mak
22c213
+fi
22c213
 if test "$byteswap_h" = "yes" ; then
22c213
   echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
22c213
 fi
22c213
diff --git a/tools/virtiofsd/fuse_misc.h b/tools/virtiofsd/fuse_misc.h
22c213
index f252baa..5c618ce 100644
22c213
--- a/tools/virtiofsd/fuse_misc.h
22c213
+++ b/tools/virtiofsd/fuse_misc.h
22c213
@@ -7,6 +7,7 @@
22c213
  */
22c213
 
22c213
 #include <pthread.h>
22c213
+#include "config-host.h"
22c213
 
22c213
 /*
22c213
  * Versioned symbols cannot be used in some cases because it
22c213
-- 
22c213
1.8.3.1
22c213