
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Some mark_inode_dirty() is unneeded. Those are already detached (it's
not written) or change a ->i_nlink count only (fatfs don't have).

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/msdos/namei.c |   11 +++--------
 25-akpm/fs/vfat/namei.c  |   10 +++-------
 2 files changed, 6 insertions(+), 15 deletions(-)

diff -puN fs/msdos/namei.c~fat-remove-unneed-mark_inode_dirty fs/msdos/namei.c
--- 25/fs/msdos/namei.c~fat-remove-unneed-mark_inode_dirty	Sun Mar  6 17:13:28 2005
+++ 25-akpm/fs/msdos/namei.c	Sun Mar  6 17:13:28 2005
@@ -354,7 +354,6 @@ static int msdos_rmdir(struct inode *dir
 	inode->i_nlink = 0;
 	inode->i_ctime = CURRENT_TIME_SEC;
 	fat_detach(inode);
-	mark_inode_dirty(inode);
 out:
 	unlock_kernel();
 
@@ -403,7 +402,7 @@ static int msdos_mkdir(struct inode *dir
 		/* the directory was completed, just return a error */
 		goto out;
 	}
-	inode->i_nlink = 2;	/* no need to mark them dirty */
+	inode->i_nlink = 2;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = ts;
 	/* timestamp is already written, so mark_inode_dirty() is unneeded. */
 
@@ -437,7 +436,6 @@ static int msdos_unlink(struct inode *di
 	inode->i_nlink = 0;
 	inode->i_ctime = CURRENT_TIME_SEC;
 	fat_detach(inode);
-	mark_inode_dirty(inode);
 out:
 	unlock_kernel();
 
@@ -544,7 +542,6 @@ static int do_msdos_rename(struct inode 
 	if (new_inode) {
 		new_inode->i_nlink--;
 		new_inode->i_ctime = ts;
-		mark_inode_dirty(new_inode);
 	}
 	if (is_dir) {
 		int start = MSDOS_I(new_dir)->i_logstart;
@@ -552,12 +549,10 @@ static int do_msdos_rename(struct inode 
 		dotdot_de->starthi = cpu_to_le16(start >> 16);
 		mark_buffer_dirty(dotdot_bh);
 
-		if (new_inode) {
+		if (new_inode)
 			new_inode->i_nlink--;
-		} else {
+		else
 			new_dir->i_nlink++;
-			mark_inode_dirty(new_dir);
-		}
 	}
 out:
 	brelse(dotdot_bh);
diff -puN fs/vfat/namei.c~fat-remove-unneed-mark_inode_dirty fs/vfat/namei.c
--- 25/fs/vfat/namei.c~fat-remove-unneed-mark_inode_dirty	Sun Mar  6 17:13:28 2005
+++ 25-akpm/fs/vfat/namei.c	Sun Mar  6 17:13:28 2005
@@ -803,7 +803,6 @@ static int vfat_rmdir(struct inode *dir,
 	inode->i_nlink = 0;
 	inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
 	fat_detach(inode);
-	mark_inode_dirty(inode);
 out:
 	unlock_kernel();
 
@@ -828,7 +827,6 @@ static int vfat_unlink(struct inode *dir
 	inode->i_nlink = 0;
 	inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
 	fat_detach(inode);
-	mark_inode_dirty(inode);
 out:
 	unlock_kernel();
 
@@ -865,7 +863,7 @@ static int vfat_mkdir(struct inode *dir,
 		goto out;
 	}
 	inode->i_version++;
-	inode->i_nlink = 2;	/* no need to mark them dirty */
+	inode->i_nlink = 2;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = ts;
 	/* timestamp is already written, so mark_inode_dirty() is unneeded. */
 
@@ -964,12 +962,10 @@ static int vfat_rename(struct inode *old
 		if (new_dir->i_sb->s_flags & MS_SYNCHRONOUS)
 			sync_dirty_buffer(dotdot_bh);
 
-		if (new_inode) {
+		if (new_inode)
 			new_inode->i_nlink--;
-		} else {
+		else
 			new_dir->i_nlink++;
-			mark_inode_dirty(new_dir);
-		}
 	}
 out:
 	brelse(dotdot_bh);
_
