diff options
author | bde <bde@FreeBSD.org> | 2007-10-19 12:23:25 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2007-10-19 12:23:25 +0000 |
commit | c590272b42e93312c35e2c65311528e435564f7c (patch) | |
tree | e84a4ea00d6316f70a28395022018de01e8f9ddc /sys/fs/msdosfs/msdosfs_denode.c | |
parent | 6447f9aa646b2b502fd5d41a1f2c0de50090b3dd (diff) | |
download | FreeBSD-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.c | 4 |
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))); } /* |