[Tux3] [PATCH 3/3] Add billionths() and use it, instead of millionths()

OGAWA Hirofumi hirofumi at mail.parknet.co.jp
Mon Nov 10 21:35:39 PST 2008


# HG changeset patch
# User OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>
# Date 1226380749 -32400
# Node ID daac4717e4cc70df5efde5bf82df1841dcc99537
# Parent  55013c67b722e7b218c348f7cda68c766c62fd31
Add billionths() and use it, instead of millionths()

diff -r 55013c67b722 -r daac4717e4cc user/tux3.h
--- a/user/tux3.h	Tue Nov 11 14:18:53 2008 +0900
+++ b/user/tux3.h	Tue Nov 11 14:19:09 2008 +0900
@@ -254,9 +254,9 @@
 	return tuxtimeval(now.tv_sec, now.tv_usec);
 }
 
-static inline unsigned millionths(fixed32 val)
+static inline unsigned billionths(fixed32 val)
 {
-	return (((val & 0xffffffff) * 1000000) + 0x80000000) >> 32;
+	return ((((val & 0xffffffff) * 1000000) + 0x80000000) >> 32) * 1000;
 }
 
 static inline u32 high32(fixed32 val)
diff -r 55013c67b722 -r daac4717e4cc user/tux3fuse.c
--- a/user/tux3fuse.c	Tue Nov 11 14:18:53 2008 +0900
+++ b/user/tux3fuse.c	Tue Nov 11 14:19:09 2008 +0900
@@ -87,15 +87,15 @@
 #if 1
 				.st_atim  = {
 					.tv_sec  = high32(inode->i_atime),
-					.tv_nsec = millionths(inode->i_atime) * 1000,
+					.tv_nsec = billionths(inode->i_atime),
 				},
 				.st_mtim  = {
 					.tv_sec  = high32(inode->i_mtime),
-					.tv_nsec = millionths(inode->i_mtime) * 1000,
+					.tv_nsec = billionths(inode->i_mtime),
 				},
 				.st_ctim  = {
 					.tv_sec  = high32(inode->i_ctime),
-					.tv_nsec = millionths(inode->i_ctime) * 1000,
+					.tv_nsec = billionths(inode->i_ctime),
 				},
 #else
 				.st_atime = high32(inode->i_atime),
@@ -187,15 +187,15 @@
 #if 1
 				.st_atim  = {
 					.tv_sec  = high32(inode->i_atime),
-					.tv_nsec = millionths(inode->i_atime) * 1000,
+					.tv_nsec = billionths(inode->i_atime),
 				},
 				.st_mtim  = {
 					.tv_sec  = high32(inode->i_mtime),
-					.tv_nsec = millionths(inode->i_mtime) * 1000,
+					.tv_nsec = billionths(inode->i_mtime),
 				},
 				.st_ctim  = {
 					.tv_sec  = high32(inode->i_ctime),
-					.tv_nsec = millionths(inode->i_ctime) * 1000,
+					.tv_nsec = billionths(inode->i_ctime),
 				},
 #else
 				.st_atime = high32(inode->i_atime),
@@ -269,15 +269,15 @@
 #if 1
 		.st_atim  = {
 			.tv_sec  = high32(inode->i_atime),
-			.tv_nsec = millionths(inode->i_atime) * 1000,
+			.tv_nsec = billionths(inode->i_atime),
 		},
 		.st_ctim  = {
 			.tv_sec  = high32(inode->i_ctime),
-			.tv_nsec = millionths(inode->i_ctime) * 1000,
+			.tv_nsec = billionths(inode->i_ctime),
 		},
 		.st_mtim  = {
 			.tv_sec  = high32(inode->i_mtime),
-			.tv_nsec = millionths(inode->i_mtime) * 1000,
+			.tv_nsec = billionths(inode->i_mtime),
 		},
 #else
 		.st_atime = high32(inode->i_atime),
-- 
OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list