[Tux3] [PATCH 3/3] Add billionths() and use it, instead of millionths()
OGAWA Hirofumi
hirofumi at mail.parknet.co.jp
Mon Nov 10 23:19:43 PST 2008
# HG changeset patch
# User OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>
# Date 1226387771 -32400
# Node ID e50b06dfcea7f1d56578e12e91d50e5de47983cc
# Parent d680e7bc61353f6c4de5ef24e30b4f5d8245150d
Add billionths() and use it, instead of millionths()
diff -r d680e7bc6135 -r e50b06dfcea7 user/tux3.h
--- a/user/tux3.h Tue Nov 11 16:15:46 2008 +0900
+++ b/user/tux3.h Tue Nov 11 16:16:11 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 d680e7bc6135 -r e50b06dfcea7 user/tux3fuse.c
--- a/user/tux3fuse.c Tue Nov 11 16:15:46 2008 +0900
+++ b/user/tux3fuse.c Tue Nov 11 16:16:11 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