patch-2.1.130 linux/include/linux/hfs_sysdep.h

Next file: linux/include/linux/loop.h
Previous file: linux/include/linux/hfs_fs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.129/linux/include/linux/hfs_sysdep.h linux/include/linux/hfs_sysdep.h
@@ -25,6 +25,7 @@
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
 
+extern struct timezone sys_tz;
 
 #undef offsetof
 #define offsetof(TYPE, MEMB) ((size_t) &((TYPE *)0)->MEMB)
@@ -68,8 +69,24 @@
 }
 
 
+/* handle conversion between times. 
+ *
+ * NOTE: hfs+ doesn't need this. also, we don't use tz_dsttime as that's
+ *       not a good thing to do. instead, we depend upon tz_minuteswest
+ *       having the correct daylight savings correction. 
+ */
+extern inline hfs_u32 hfs_from_utc(hfs_s32 time)
+{
+	return time - sys_tz.tz_minuteswest*60; 
+}
+
+extern inline hfs_s32 hfs_to_utc(hfs_u32 time)
+{
+	return time + sys_tz.tz_minuteswest*60;
+}
+
 extern inline hfs_u32 hfs_time(void) {
-	return htonl(CURRENT_TIME+2082844800U);
+	return htonl(hfs_from_utc(CURRENT_TIME)+2082844800U);
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov