[PATCH 27/29] FAT: Use synchronous update for{vfat,msdos}_add_entry()

From: OGAWA Hirofumi
Date: Sat Mar 05 2005 - 15:03:54 EST



Use the synchronous updates, in order to guarantee that the writing to
a disk is completeing when a system call returns.

Signed-off-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
---

fs/msdos/namei.c | 5 ++++-
fs/vfat/namei.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)

diff -puN fs/msdos/namei.c~sync08-fat_tweak7 fs/msdos/namei.c
--- linux-2.6.11/fs/msdos/namei.c~sync08-fat_tweak7 2005-03-06 02:37:29.000000000 +0900
+++ linux-2.6.11-hirofumi/fs/msdos/namei.c 2005-03-06 02:37:29.000000000 +0900
@@ -278,7 +278,10 @@ static int msdos_add_entry(struct inode
return err;

dir->i_ctime = dir->i_mtime = *ts;
- mark_inode_dirty(dir);
+ if (IS_DIRSYNC(dir))
+ (void)fat_sync_inode(dir);
+ else
+ mark_inode_dirty(dir);

return 0;
}
diff -puN fs/vfat/namei.c~sync08-fat_tweak7 fs/vfat/namei.c
--- linux-2.6.11/fs/vfat/namei.c~sync08-fat_tweak7 2005-03-06 02:37:29.000000000 +0900
+++ linux-2.6.11-hirofumi/fs/vfat/namei.c 2005-03-06 02:37:29.000000000 +0900
@@ -684,7 +684,10 @@ static int vfat_add_entry(struct inode *

/* update timestamp */
dir->i_ctime = dir->i_mtime = dir->i_atime = *ts;
- mark_inode_dirty(dir);
+ if (IS_DIRSYNC(dir))
+ (void)fat_sync_inode(dir);
+ else
+ mark_inode_dirty(dir);
cleanup:
kfree(slots);
return err;
_
-
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/