Messages in this thread Patch in this message | | | Subject | [PATCH 20/29] FAT: Use fat_remove_entries() for msdos | From | OGAWA Hirofumi <> | Date | Sun, 06 Mar 2005 03:55:00 +0900 |
| |
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> ---
fs/msdos/namei.c | 37 +++++++++++++++++-------------------- 1 files changed, 17 insertions(+), 20 deletions(-)
diff -puN fs/msdos/namei.c~sync07-fat_dir7 fs/msdos/namei.c --- linux-2.6.11/fs/msdos/namei.c~sync07-fat_dir7 2005-03-06 02:37:00.000000000 +0900 +++ linux-2.6.11-hirofumi/fs/msdos/namei.c 2005-03-06 02:37:00.000000000 +0900 @@ -346,16 +346,15 @@ static int msdos_rmdir(struct inode *dir if (err) goto out; - sinfo.de->name[0] = DELETED_FLAG; - mark_buffer_dirty(sinfo.bh); - brelse(sinfo.bh); - fat_detach(inode); + err = fat_remove_entries(dir, &sinfo); /* and releases bh */ + if (err) + goto out; + dir->i_nlink--; + inode->i_nlink = 0; - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; + inode->i_ctime = CURRENT_TIME_SEC; + fat_detach(inode); mark_inode_dirty(inode); - - dir->i_nlink--; - mark_inode_dirty(dir); out: unlock_kernel(); @@ -430,18 +429,16 @@ static int msdos_unlink(struct inode *di lock_kernel(); err = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo); if (err) - goto unlink_done; + goto out; - sinfo.de->name[0] = DELETED_FLAG; - mark_buffer_dirty(sinfo.bh); - brelse(sinfo.bh); - fat_detach(inode); + err = fat_remove_entries(dir, &sinfo); /* and releases bh */ + if (err) + goto out; inode->i_nlink = 0; - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; + inode->i_ctime = CURRENT_TIME_SEC; + fat_detach(inode); mark_inode_dirty(inode); - - mark_inode_dirty(dir); -unlink_done: +out: unlock_kernel(); return err; @@ -526,10 +523,10 @@ static int do_msdos_rename(struct inode } new_dir->i_version++; - old_sinfo.de->name[0] = DELETED_FLAG; - mark_buffer_dirty(old_sinfo.bh); - brelse(old_sinfo.bh); + err = fat_remove_entries(old_dir, &old_sinfo); /* and releases bh */ old_sinfo.bh = NULL; + if (err) + goto out; if (is_dir) old_dir->i_nlink--; fat_detach(old_inode); _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |