summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/msdosfs_denode.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2007-10-19 12:23:25 +0000
committerbde <bde@FreeBSD.org>2007-10-19 12:23:25 +0000
commitc590272b42e93312c35e2c65311528e435564f7c (patch)
treee84a4ea00d6316f70a28395022018de01e8f9ddc /sys/fs/msdosfs/msdosfs_denode.c
parent6447f9aa646b2b502fd5d41a1f2c0de50090b3dd (diff)
downloadFreeBSD-src-c590272b42e93312c35e2c65311528e435564f7c.zip
FreeBSD-src-c590272b42e93312c35e2c65311528e435564f7c.tar.gz
Implement the async (really, delayed-write) mount option for msdosfs.
This is much simpler than for ffs since there are many fewer places where we need to choose between a delayed write and a sync write -- just 5 in msdosfs and more than 30 in ffs. This is more complete and correct than in ffs. Several places in ffs are are still missing the choice. ffs_update() has a layering violation that breaks callers which want to force a sync update (mainly fsync(2) and O_SYNC write(2)). However, fsync(2) and O_SYNC write(2) are still more broken than in ffs, since they are broken for default (non-sync non-async) mounts too. Both fail to sync the FAT in all cases, and both fail to sync the directory entry in some cases after losing a race. Async everything is probably safer than the half-baked sync of metadata given by default mounts.
Diffstat (limited to 'sys/fs/msdosfs/msdosfs_denode.c')
-rw-r--r--sys/fs/msdosfs/msdosfs_denode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c
index 37f1433..e3b962a 100644
--- a/sys/fs/msdosfs/msdosfs_denode.c
+++ b/sys/fs/msdosfs/msdosfs_denode.c
@@ -429,7 +429,7 @@ detrunc(dep, length, flags, cred, td)
if (allerror)
printf("detrunc(): vtruncbuf error %d\n", allerror);
#endif
- error = deupdat(dep, 1);
+ error = deupdat(dep, !(DETOV(dep)->v_mount->mnt_flag & MNT_ASYNC));
if (error != 0 && allerror == 0)
allerror = error;
#ifdef MSDOSFS_DEBUG
@@ -508,7 +508,7 @@ deextend(dep, length, cred)
}
dep->de_FileSize = length;
dep->de_flag |= DE_UPDATE | DE_MODIFIED;
- return (deupdat(dep, 1));
+ return (deupdat(dep, !(DETOV(dep)->v_mount->mnt_flag & MNT_ASYNC)));
}
/*
OpenPOWER on IntegriCloud