aboutsummaryrefslogtreecommitdiffstats
path: root/fs/msdos
diff options
context:
space:
mode:
authorChris Mason <mason@suse.com>2006-09-29 05:00:03 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:12 -0400
commitae78bf9c4f5fde3c67e2829505f195d7347ce3e4 (patch)
treeb9376237e596ed7e95db35b9ccf1ad3177b10460 /fs/msdos
parent6b77df08a36d989f7dd00ccb6a026a0e96170d16 (diff)
[PATCH] add -o flush for fat
Fat is commonly used on removable media. Mounting with -o flush tells the FS to write things to disk as quickly as possible. It is like -o sync, but much faster (and not as safe). Signed-off-by: Chris Mason <mason@suse.com> Cc: 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.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/msdos/namei.c b/fs/msdos/namei.c
index 9e44158a7540..d220165d4918 100644
--- a/fs/msdos/namei.c
+++ b/fs/msdos/namei.c
@@ -280,7 +280,7 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, int mode,
280 struct nameidata *nd) 280 struct nameidata *nd)
281{ 281{
282 struct super_block *sb = dir->i_sb; 282 struct super_block *sb = dir->i_sb;
283 struct inode *inode; 283 struct inode *inode = NULL;
284 struct fat_slot_info sinfo; 284 struct fat_slot_info sinfo;
285 struct timespec ts; 285 struct timespec ts;
286 unsigned char msdos_name[MSDOS_NAME]; 286 unsigned char msdos_name[MSDOS_NAME];
@@ -316,6 +316,8 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, int mode,
316 d_instantiate(dentry, inode); 316 d_instantiate(dentry, inode);
317out: 317out:
318 unlock_kernel(); 318 unlock_kernel();
319 if (!err)
320 err = fat_flush_inodes(sb, dir, inode);
319 return err; 321 return err;
320} 322}
321 323
@@ -348,6 +350,8 @@ static int msdos_rmdir(struct inode *dir, struct dentry *dentry)
348 fat_detach(inode); 350 fat_detach(inode);
349out: 351out:
350 unlock_kernel(); 352 unlock_kernel();
353 if (!err)
354 err = fat_flush_inodes(inode->i_sb, dir, inode);
351 355
352 return err; 356 return err;
353} 357}
@@ -401,6 +405,7 @@ static int msdos_mkdir(struct inode *dir, struct dentry *dentry, int mode)
401 d_instantiate(dentry, inode); 405 d_instantiate(dentry, inode);
402 406
403 unlock_kernel(); 407 unlock_kernel();
408 fat_flush_inodes(sb, dir, inode);
404 return 0; 409 return 0;
405 410
406out_free: 411out_free:
@@ -430,6 +435,8 @@ static int msdos_unlink(struct inode *dir, struct dentry *dentry)
430 fat_detach(inode); 435 fat_detach(inode);
431out: 436out:
432 unlock_kernel(); 437 unlock_kernel();
438 if (!err)
439 err = fat_flush_inodes(inode->i_sb, dir, inode);
433 440
434 return err; 441 return err;
435} 442}
@@ -635,6 +642,8 @@ static int msdos_rename(struct inode *old_dir, struct dentry *old_dentry,
635 new_dir, new_msdos_name, new_dentry, is_hid); 642 new_dir, new_msdos_name, new_dentry, is_hid);
636out: 643out:
637 unlock_kernel(); 644 unlock_kernel();
645 if (!err)
646 err = fat_flush_inodes(old_dir->i_sb, old_dir, new_dir);
638 return err; 647 return err;
639} 648}
640 649