patch-2.1.45 linux/fs/sysv/truncate.c

Next file: linux/fs/ufs/ufs_file.c
Previous file: linux/fs/sysv/symlink.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/fs/sysv/truncate.c linux/fs/sysv/truncate.c
@@ -64,7 +64,7 @@
 			continue;
 		}
 		*p = 0;
-		inode->i_dirt = 1;
+		mark_inode_dirty(inode);
 		brelse(bh);
 		sysv_free_block(sb,block);
 	}
@@ -257,12 +257,14 @@
 static int trunc_all(struct inode * inode)
 {
 	struct super_block * sb;
+	char * res;
 
 	sb = inode->i_sb;
+	res = (char *)test_bit(I_DIRTY,&inode->i_state);
 	return trunc_direct(inode)
-	     | trunc_indirect(inode,sb->sv_ind0_size,&inode->u.sysv_i.i_data[10],0,&inode->i_dirt)
-	     | trunc_dindirect(inode,sb->sv_ind1_size,&inode->u.sysv_i.i_data[11],0,&inode->i_dirt)
-	     | trunc_tindirect(inode,sb->sv_ind2_size,&inode->u.sysv_i.i_data[12],0,&inode->i_dirt);
+	     | trunc_indirect(inode,sb->sv_ind0_size,&inode->u.sysv_i.i_data[10],0,res)
+	     | trunc_dindirect(inode,sb->sv_ind1_size,&inode->u.sysv_i.i_data[11],0,res)
+	     | trunc_tindirect(inode,sb->sv_ind2_size,&inode->u.sysv_i.i_data[12],0,res);
 }
 
 
@@ -285,5 +287,5 @@
 		schedule();
 	}
 	inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-	inode->i_dirt = 1;
+	mark_inode_dirty(inode);
 }

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