Commit d127375a authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Linus Torvalds

[PATCH] FAT: Remove unneed mark_inode_dirty()

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: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9627dfaf
......@@ -354,7 +354,6 @@ static int msdos_rmdir(struct inode *dir, struct dentry *dentry)
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, struct dentry *dentry, int mode)
/* 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 *dir, struct dentry *dentry)
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 *old_dir, unsigned char *old_name,
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 *old_dir, unsigned char *old_name,
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);
......
......@@ -803,7 +803,6 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry)
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, struct dentry *dentry)
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, struct dentry *dentry, int mode)
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_dir, struct dentry *old_dentry,
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment