summaryrefslogtreecommitdiff
path: root/ufs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-16 19:35:27 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-16 19:35:27 +0000
commitd56d056ed3f1b88cb5d2afb9e4d4c9105aafea31 (patch)
treeae532b1cd1d47b4298a1abf39bf42cf15ba7b6f8 /ufs
parent0ee7091bde027b6abdafa1117cdde8e67c6b5908 (diff)
(diskfs_lookup_hard): Set atime appropriately, and sync the new atime
if we are running synchronously (!). (diskfs_dirempty): Likewise. (diskfs_direnter_hard): Set mtime appropriately. (diskfs_dirremove_hard): Likewise. (diskfs_dirrewrite_hard): Likewise.
Diffstat (limited to 'ufs')
-rw-r--r--ufs/dir.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/ufs/dir.c b/ufs/dir.c
index 136b470f..67b3645e 100644
--- a/ufs/dir.c
+++ b/ufs/dir.c
@@ -153,6 +153,9 @@ diskfs_lookup_hard (struct node *dp, char *name, enum lookup_type type,
inum = 0;
+ if (!diskfs_readonly)
+ dp->dn_set_atime = 1;
+
for (blockaddr = buf, idx = 0;
blockaddr - buf < dp->dn_stat.st_size;
blockaddr += DIRBLKSIZ, idx++)
@@ -167,6 +170,11 @@ diskfs_lookup_hard (struct node *dp, char *name, enum lookup_type type,
}
}
+ if (!diskfs_readonly)
+ dp->dn_set_atime = 1;
+ if (diskfs_synchronous)
+ diskfs_node_update (dp, 1);
+
/* If err is set here, it's ENOENT, and we don't want to
think about that as an error yet. */
err = 0;
@@ -466,6 +474,8 @@ diskfs_direnter_hard(struct node *dp,
assert (ds->type == CREATE);
+ dp->dn_set_mtime = 1;
+
switch (ds->stat)
{
case TAKE:
@@ -568,6 +578,8 @@ diskfs_direnter_hard(struct node *dp,
assert (0);
}
+ dp->dn_set_mtime = 1;
+
vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent);
if (ds->stat != EXTEND)
@@ -614,6 +626,8 @@ diskfs_dirremove_hard(struct node *dp,
assert (ds->type == REMOVE);
assert (ds->stat == HERE_TIS);
+ dp->dn_set_mtime = 1;
+
if (ds->preventry == 0)
ds->entry->d_ino = 0;
else
@@ -623,6 +637,8 @@ diskfs_dirremove_hard(struct node *dp,
ds->preventry->d_reclen += ds->entry->d_reclen;
}
+ dp->dn_set_mtime = 1;
+
vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent);
/* If we are keeping count of this block, then keep the count up
@@ -650,9 +666,11 @@ diskfs_dirrewrite_hard(struct node *dp,
assert (ds->type == RENAME);
assert (ds->stat == HERE_TIS);
+ dp->dn_set_mtime = 1;
ds->entry->d_ino = np->dn->number;
if (direct_symlink_extension)
ds->entry->d_type = IFTODT (np->dn_stat.st_mode);
+ dp->dn_set_mtime = 1;
vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent);
@@ -681,6 +699,9 @@ diskfs_dirempty(struct node *dp,
mach_port_deallocate (mach_task_self (), memobj);
assert (!err);
+ if (!diskfs_readonly)
+ dp->dn_set_atime = 1;
+
for (curoff = buf;
curoff < buf + dp->dn_stat.st_size;
curoff += entry->d_reclen)
@@ -694,9 +715,17 @@ diskfs_dirempty(struct node *dp,
&& entry->d_name[1] != '\0')))
{
vm_deallocate (mach_task_self (), buf, dp->dn_stat.st_size);
+ if (!diskfs_readonly)
+ dp->dn_set_atime = 1;
+ if (diskfs_synchronous)
+ node_update (dp, 1);
return 0;
}
}
+ if (!diskfs_readonly)
+ dp->dn_set_atime = 1;
+ if (diskfs_synchronous)
+ node_update (dp, 1);
vm_deallocate (mach_task_self (), buf, dp->dn_stat.st_size);
return 1;
}