From d44e91e37614ac9e598986d8f2030eeddf5f543c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 28 Aug 2006 12:35:01 +0000 Subject: [PATCH] we need to call put_vnode on unmount dos_fsync now uses file_cache_sync(), should be better. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18667 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/dos/dosfs.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/file_systems/dos/dosfs.c b/src/add-ons/kernel/file_systems/dos/dosfs.c index 83e2bd7259..2311a1e7e3 100644 --- a/src/add-ons/kernel/file_systems/dos/dosfs.c +++ b/src/add-ons/kernel/file_systems/dos/dosfs.c @@ -741,6 +741,9 @@ dosfs_unmount(void *_vol) DPRINTF(0, ("dosfs_unmount volume %lx\n", vol->id)); update_fsinfo(vol); + + // Unlike in BeOS, we need to put the reference to our root node ourselves + put_vnode(vol->id, vol->root_vnode.vnid); block_cache_delete(vol->fBlockCache, true); #if DEBUG @@ -1051,11 +1054,23 @@ dosfs_sync(void *_vol) static status_t -dosfs_fsync(void *vol, void *node) +dosfs_fsync(void *_vol, void *_node) { - TOUCH(node); + nspace *vol = (nspace *)vol; + vnode *node = (vnode *)_node; + status_t err; - return dosfs_sync(vol); + LOCK_VOL(vol); + + if (check_vnode_magic(node, "dosfs_fsync")) { + UNLOCK_VOL(vol); + return EINVAL; + } + + err = file_cache_sync(node->cache); + + UNLOCK_VOL(vol); + return err; }