[PATCH 24/29] FAT: Remove unneed mark_inode_dirty()
From: OGAWA Hirofumi
Date: Sat Mar 05 2005 - 14:43:04 EST
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@xxxxxxxxxxxxxxxxxx>
---
fs/msdos/namei.c | 11 +++--------
fs/vfat/namei.c | 10 +++-------
2 files changed, 6 insertions(+), 15 deletions(-)
diff -puN fs/msdos/namei.c~sync08-fat_tweak4 fs/msdos/namei.c
--- linux-2.6.11/fs/msdos/namei.c~sync08-fat_tweak4 2005-03-06 02:37:21.000000000 +0900
+++ linux-2.6.11-hirofumi/fs/msdos/namei.c 2005-03-06 02:37:21.000000000 +0900
@@ -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~sync08-fat_tweak4 fs/vfat/namei.c
--- linux-2.6.11/fs/vfat/namei.c~sync08-fat_tweak4 2005-03-06 02:37:21.000000000 +0900
+++ linux-2.6.11-hirofumi/fs/vfat/namei.c 2005-03-06 02:37:21.000000000 +0900
@@ -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);
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/