# HG changeset patch
# User OGAWA Hirofumi
# Date 1226387681 -32400
# Node ID 6b615de4d62bea052bb57474e754233f911edf1e
# Parent dab895e2e896189f1764a7ec3330b6473757138e
Use tuxtime() to update timestampAnd this moves time functions to tux3.h to use those without including
inode.cdiff -r dab895e2e896 -r 6b615de4d62b user/dir.c
--- a/user/dir.c Mon Nov 10 20:15:37 2008 -0800
+++ b/user/dir.c Tue Nov 11 16:14:41 2008 +0900
@@ -194,7 +194,7 @@
memcpy(entry->name, name, len);
entry->inum = cpu_to_le32(inum);
entry->type = ext2_type_by_mode[(mode & S_IFMT) >> STAT_SHIFT];
- dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
+ dir->i_mtime = dir->i_ctime = tuxtime();
mark_inode_dirty(dir);
offset = (void *)entry - buffer->data;
brelse_dirty(buffer);
diff -r dab895e2e896 -r 6b615de4d62b user/inode.c
--- a/user/inode.c Mon Nov 10 20:15:37 2008 -0800
+++ b/user/inode.c Tue Nov 11 16:14:41 2008 +0900
@@ -16,26 +16,6 @@
#define filemap_included
#include "filemap.c"
#undef main
-
-#include
-#include
-
-fixed32 tuxtime(void)
-{
- struct timeval now;
- gettimeofday(&now, NULL);
- return tuxtimeval(now.tv_sec, now.tv_usec);
-}
-
-unsigned millionths(fixed32 val)
-{
- return (((val & 0xffffffff) * 1000000) + 0x80000000) >> 32;
-}
-
-u32 high32(fixed32 val)
-{
- return val >> 32;
-}struct inode *new_inode(SB, inum_t inum)
{
diff -r dab895e2e896 -r 6b615de4d62b user/tux3.h
--- a/user/tux3.h Mon Nov 10 20:15:37 2008 -0800
+++ b/user/tux3.h Tue Nov 11 16:14:41 2008 +0900
@@ -7,6 +7,8 @@
#include
#include
#include
+#include
+#include
#include "err.h"
#include "trace.h"
#include "buffer.h"
@@ -245,6 +247,23 @@
return ((u64)sec << 32) + ((u64)usec << 32) / 1000000;
}+static inline fixed32 tuxtime(void)
+{
+ struct timeval now;
+ gettimeofday(&now, NULL);
+ return tuxtimeval(now.tv_sec, now.tv_usec);
+}
+
+static inline unsigned millionths(fixed32 val)
+{
+ return (((val & 0xffffffff) * 1000000) + 0x80000000) >> 32;
+}
+
+static inline u32 high32(fixed32 val)
+{
+ return val >> 32;
+}
+
struct iattr {
u64 isize, mtime, ctime, atime;
unsigned mode, uid, gid, links;--
OGAWA Hirofumi_______________________________________________
Tux3 mailing list
Tux3@tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Jeff Garzik | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Paul E. McKenney | [PATCH RFC 3/9] RCU: Preemptible RCU |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Gerrit Renker | [PATCH 13/37] dccp: Deprecate Ack Ratio sysctl |
| Patrick McHardy | Re: [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
