summaryrefslogtreecommitdiff
path: root/libdiskfs/node-times.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/node-times.c')
-rw-r--r--libdiskfs/node-times.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/libdiskfs/node-times.c b/libdiskfs/node-times.c
index 720c85e0..968cfb2f 100644
--- a/libdiskfs/node-times.c
+++ b/libdiskfs/node-times.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994, 1996 Free Software Foundation
+ Copyright (C) 1994,96,99 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -8,7 +8,7 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-The GNU Hurd is distributed in the hope that it will be useful,
+The GNU Hurd is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -29,6 +29,14 @@ diskfs_set_node_times (struct node *np)
{
struct timeval t;
+ if (_diskfs_noatime /* Globally disabled for the filesystem. */
+ && !np->dn_set_mtime
+ && !np->dn_set_ctime)
+ np->dn_set_atime = 0;
+
+ if (!np->dn_set_mtime && !np->dn_set_atime && !np->dn_set_ctime)
+ return;
+
maptime_read (diskfs_mtime, &t);
if (np->dn_set_mtime)
@@ -39,7 +47,7 @@ diskfs_set_node_times (struct node *np)
#else
np->dn_stat.st_mtime = t.tv_sec;
np->dn_stat.st_mtime_usec = t.tv_usec;
-#endif
+#endif
}
if (np->dn_set_atime)
{
@@ -49,19 +57,19 @@ diskfs_set_node_times (struct node *np)
#else
np->dn_stat.st_atime = t.tv_sec;
np->dn_stat.st_atime_usec = t.tv_usec;
-#endif
+#endif
}
if (np->dn_set_ctime)
{
-#ifdef notyet
+#ifdef notyet
np->dn_stat.st_ctimespec.ts_sec = t.tv_sec;
np->dn_stat.st_ctimespec.ts_nsec = t.tv_usec * 1000;
#else
np->dn_stat.st_ctime = t.tv_sec;
np->dn_stat.st_ctime_usec = t.tv_usec;
-#endif
+#endif
}
-
+
if (np->dn_set_mtime || np->dn_set_atime || np->dn_set_ctime)
np->dn_stat_dirty = 1;
np->dn_set_mtime = np->dn_set_atime = np->dn_set_ctime = 0;