spl: Fix mtime going backwards in time

Fixes #5652.
This commit is contained in:
Ricardo M. Correia 2015-01-11 05:17:58 +01:00
parent 58513cc380
commit e0336a504e
2 changed files with 19 additions and 1 deletions

View File

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "0id0m3sfpkz8w7b2pc51px8kvz8xnaf8msps57ddarxidmxvb45g";
};
patches = [ ./install_prefix.patch ./const.patch ];
patches = [ ./install_prefix.patch ./const.patch ./time.patch ];
buildInputs = [ perl autoconf automake libtool ];

View File

@ -0,0 +1,18 @@
diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c
index 0ed49cc..b0fad4f 100644
--- a/module/spl/spl-time.c
+++ b/module/spl/spl-time.c
@@ -40,12 +40,7 @@ extern unsigned long long monotonic_clock(void);
void
__gethrestime(timestruc_t *ts)
{
- struct timespec tspec;
-
- getnstimeofday(&tspec);
-
- ts->tv_sec = tspec.tv_sec;
- ts->tv_nsec = tspec.tv_nsec;
+ *ts = current_kernel_time();
}
EXPORT_SYMBOL(__gethrestime);