patch-2.1.45 linux/fs/ext2/inode.c

Next file: linux/fs/ext2/ioctl.c
Previous file: linux/fs/ext2/ialloc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/fs/ext2/inode.c linux/fs/ext2/inode.c
@@ -31,14 +31,24 @@
 
 static int ext2_update_inode(struct inode * inode, int do_sync);
 
+/*
+ * Called at each iput()
+ */
 void ext2_put_inode (struct inode * inode)
 {
 	ext2_discard_prealloc (inode);
-	if (inode->i_nlink || inode->i_ino == EXT2_ACL_IDX_INO ||
+}
+
+/*
+ * Called at the last iput() if i_nlink is zero.
+ */
+void ext2_delete_inode (struct inode * inode)
+{
+	if (inode->i_ino == EXT2_ACL_IDX_INO ||
 	    inode->i_ino == EXT2_ACL_DATA_INO)
 		return;
 	inode->u.ext2_i.i_dtime	= CURRENT_TIME;
-	inode->i_dirt = 1;
+	mark_inode_dirty(inode);
 	ext2_update_inode(inode, IS_SYNC(inode));
 	inode->i_size = 0;
 	if (inode->i_blocks)
@@ -248,7 +258,7 @@
 	if (IS_SYNC(inode) || inode->u.ext2_i.i_osync)
 		ext2_sync_inode (inode);
 	else
-		inode->i_dirt = 1;
+		mark_inode_dirty(inode);
 	return result;
 }
 
@@ -322,7 +332,7 @@
 	}
 	inode->i_ctime = CURRENT_TIME;
 	inode->i_blocks += blocks;
-	inode->i_dirt = 1;
+	mark_inode_dirty(inode);
 	inode->u.ext2_i.i_next_alloc_block = new_block;
 	inode->u.ext2_i.i_next_alloc_goal = tmp;
 	brelse (bh);
@@ -591,7 +601,6 @@
 	else for (block = 0; block < EXT2_N_BLOCKS; block++)
 		raw_inode->i_block[block] = cpu_to_le32(inode->u.ext2_i.i_data[block]);
 	mark_buffer_dirty(bh, 1);
-	inode->i_dirt = 0;
 	if (do_sync) {
 		ll_rw_block (WRITE, 1, &bh);
 		wait_on_buffer (bh);
@@ -671,7 +680,7 @@
 		inode->i_flags &= ~S_IMMUTABLE;
 		inode->u.ext2_i.i_flags &= ~EXT2_IMMUTABLE_FL;
 	}
-	inode->i_dirt = 1;
+	mark_inode_dirty(inode);
 
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov