From 806cc284ef99f1657d61eae66c51c291d690ce84 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 25 Apr 1995 01:10:40 +0000 Subject: Formerly inode.c.~17~ --- ext2fs/inode.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ext2fs/inode.c') diff --git a/ext2fs/inode.c b/ext2fs/inode.c index b7119ce0..3103c410 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -339,6 +339,9 @@ write_node (struct node *np) di->i_blocks = st->st_blocks >> log2_stat_blocks_per_fs_block; di->i_flags = st->st_flags; + /* Set dtime non-zero to indicate a deleted file. */ + di->i_dtime = (st->st_mode ? 0 : di->i_mtime); + if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) di->i_block[0] = st->st_rdev; else @@ -350,7 +353,7 @@ write_node (struct node *np) diskfs_end_catch_exception (); np->dn_stat_dirty = 0; - pokel_add (&np->dn->pokel, di, sizeof (struct ext2_inode)); + record_global_poke (di); } } @@ -433,16 +436,18 @@ diskfs_set_translator (struct node *np, char *name, unsigned namelen, } di->i_translator = blkno; - pokel_add (&np->dn->pokel, di, sizeof (struct ext2_inode)); + record_global_poke (di); + np->dn_stat.st_blocks += 1 << log2_stat_blocks_per_fs_block; np->dn_set_ctime = 1; } else if (!namelen && blkno) { /* Clear block for translator going away. */ - ext2_free_blocks (blkno, 1); di->i_translator = 0; - pokel_add (&np->dn->pokel, di, sizeof (struct ext2_inode)); + record_global_poke (di); + ext2_free_blocks (blkno, 1); + np->dn_stat.st_blocks -= 1 << log2_stat_blocks_per_fs_block; np->istranslated = 0; np->dn_set_ctime = 1; -- cgit v1.2.3