--- linux-2.4.24/fs/Config.in 2003-11-28 18:26:21.000000000 +0000 +++ linux-2.4.24/fs/Config.in-ext3-privacy 2004-01-27 21:57:22.000000000 +0000 @@ -34,6 +34,7 @@ # dep_tristate ' Journal Block Device support (JBD for ext3)' CONFIG_JBD $CONFIG_EXT3_FS define_bool CONFIG_JBD $CONFIG_EXT3_FS dep_mbool ' JBD (ext3) debugging support' CONFIG_JBD_DEBUG $CONFIG_JBD +dep_mbool ' ext3 privacy support' CONFIG_EXT3_FS_PRIVACY $CONFIG_EXT3_FS # msdos file systems tristate 'DOS FAT fs support' CONFIG_FAT_FS --- linux-2.4.24/fs/ext3/balloc.c 2003-06-13 15:51:37.000000000 +0100 +++ linux-2.4.24/fs/ext3-privacy/balloc.c 2004-01-28 00:44:56.000000000 +0000 @@ -252,6 +252,23 @@ return slot; } +static inline void destroy_block(struct inode *inode, unsigned long block) +{ +#ifdef CONFIG_EXT3_FS_PRIVACY + struct buffer_head * bh; + + bh = sb_getblk(inode->i_sb, block); + + memset(bh->b_data, 0x00, bh->b_size); + + mark_buffer_dirty(bh); + wait_on_buffer(bh); + brelse(bh); + + return; +#endif +} + /* Free given blocks, update quota and i_blocks field */ void ext3_free_blocks (handle_t *handle, struct inode * inode, unsigned long block, unsigned long count) @@ -370,6 +387,7 @@ BUFFER_TRACE(bitmap_bh, "bit already cleared"); } else { dquot_freed_blocks++; + destroy_block(sb, block); gdp->bg_free_blocks_count = cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count)+1); es->s_free_blocks_count = --- linux-2.4.24/fs/ext3/inode.c 2003-08-25 12:44:43.000000000 +0100 +++ linux-2.4.24/fs/ext3-privacy/inode.c 2004-01-27 21:48:54.000000000 +0000 @@ -172,6 +172,28 @@ ext3_discard_prealloc (inode); } +static inline void delete_inode(struct inode *inode) +{ +#ifndef CONFIG_EXT3_FS_PRIVACY + inode->u.ext3_i.i_dtime = CURRENT_TIME; +#else + inode->i_mode = 0; + inode->i_uid = 0; + inode->i_gid = 0; + inode->i_nlink = 0; + inode->i_size = 0; + inode->i_blocks = 0; + inode->i_atime = 0; + inode->i_ctime = 0; + inode->i_mtime = 0; + inode->u.ext3_i.i_dtime = 0; + inode->u.ext3_i.i_flags = 0; + inode->u.ext3_i.i_file_acl = 0; + inode->i_generation = 0; + memset(&inode->u.ext3_i.i_data, 0x00, sizeof(inode->u.ext3_i.i_data)); +#endif +} + /* * Called at the last iput() if i_nlink is zero. */ @@ -211,7 +233,7 @@ * (Well, we could do this if we need to, but heck - it works) */ ext3_orphan_del(handle, inode); - inode->u.ext3_i.i_dtime = CURRENT_TIME; + delete_inode(inode); /* * One subtle ordering requirement: if anything has gone wrong