[PATCH] wrong unix timestamp calculation in hadoop lib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrey Stepachev <octo@xxxxxxxxxxxxxx>

Hadoop always see wrong dates due of wrong timestamp calculation.
Possibly fixes #1666.

Signed-off-by: Andrey Stepachev <octo@xxxxxxxxxxxxxx>

---
 src/client/hadoop/CephFSInterface.cc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/client/hadoop/CephFSInterface.cc b/src/client/hadoop/CephFSInterface.cc
index 4a050f2..c8378c2 100644
--- a/src/client/hadoop/CephFSInterface.cc
+++ b/src/client/hadoop/CephFSInterface.cc
@@ -672,14 +672,14 @@ JNIEXPORT jboolean JNICALL Java_org_apache_hadoop_fs_ceph_CephTalker_ceph_1stat
   env->SetBooleanField(j_stat, c_dir_id, (0 != S_ISDIR(st.st_mode)));
   env->SetLongField(j_stat, c_block_id, st.st_blksize);
 
-  long long java_mtime(st.st_mtime);
+  long long java_mtime(st.st_mtim.tv_sec);
   java_mtime *= 1000;
-  java_mtime += st.st_mtim.tv_nsec;
+  java_mtime += st.st_mtim.tv_nsec / 1000;
   env->SetLongField(j_stat, c_mod_id, java_mtime);
 
-  long long java_atime(st.st_atime);
+  long long java_atime(st.st_atim.tv_sec);
   java_atime *= 1000;
-  java_atime += st.st_atim.tv_nsec;
+  java_atime += st.st_atim.tv_nsec / 1000;
   env->SetLongField(j_stat, c_access_id, java_atime);
 
   env->SetIntField(j_stat, c_mode_id, (int)st.st_mode);
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux