diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2005-10-30 15:03:50 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 17:37:32 -0800 |
commit | 9131dd4256f9598141ed374fcd47f6b4de8d2422 (patch) | |
tree | 03518a5de4f37619beb219eb2de2c48a572b99db /fs/msdos | |
parent | 451cbaa1c328082832a8fbcc427cd4416c602c5a (diff) | |
download | kernel_goldelico_gta04-9131dd4256f9598141ed374fcd47f6b4de8d2422.zip kernel_goldelico_gta04-9131dd4256f9598141ed374fcd47f6b4de8d2422.tar.gz kernel_goldelico_gta04-9131dd4256f9598141ed374fcd47f6b4de8d2422.tar.bz2 |
[PATCH] fat: remove the unneeded vfat_find() in vfat_rename()
Now, vfat_rename() is using vfat_find() for sanity check. This removes that
sanity check, the cost of sanity check is too high.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/msdos')
-rw-r--r-- | fs/msdos/namei.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/msdos/namei.c b/fs/msdos/namei.c index 154f511..626a367 100644 --- a/fs/msdos/namei.c +++ b/fs/msdos/namei.c @@ -454,10 +454,10 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, { struct buffer_head *dotdot_bh; struct msdos_dir_entry *dotdot_de; - loff_t dotdot_i_pos; struct inode *old_inode, *new_inode; struct fat_slot_info old_sinfo, sinfo; struct timespec ts; + loff_t dotdot_i_pos, new_i_pos; int err, old_attrs, is_dir, update_dotdot, corrupt = 0; old_sinfo.bh = sinfo.bh = dotdot_bh = NULL; @@ -516,28 +516,24 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, if (new_inode) { if (err) goto out; - if (MSDOS_I(new_inode)->i_pos != sinfo.i_pos) { - /* WTF??? Cry and fail. */ - printk(KERN_WARNING "msdos_rename: fs corrupted\n"); - goto out; - } - if (is_dir) { err = fat_dir_empty(new_inode); if (err) goto out; } + new_i_pos = MSDOS_I(new_inode)->i_pos; fat_detach(new_inode); } else { err = msdos_add_entry(new_dir, new_name, is_dir, is_hid, 0, &ts, &sinfo); if (err) goto out; + new_i_pos = sinfo.i_pos; } new_dir->i_version++; fat_detach(old_inode); - fat_attach(old_inode, sinfo.i_pos); + fat_attach(old_inode, new_i_pos); if (is_hid) MSDOS_I(old_inode)->i_attrs |= ATTR_HIDDEN; else @@ -604,7 +600,7 @@ error_inode: fat_attach(old_inode, old_sinfo.i_pos); MSDOS_I(old_inode)->i_attrs = old_attrs; if (new_inode) { - fat_attach(new_inode, sinfo.i_pos); + fat_attach(new_inode, new_i_pos); if (corrupt) corrupt |= fat_sync_inode(new_inode); } else { |