summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs/msdos_file.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-08 15:41:23 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-13 09:38:03 +0100
commit0f0db894f76661f0108b822bf6fd15fd19eb901e (patch)
treeccc1ebf075e27b97e1d68ef332db3bc6a45b4126 /cpukit/libfs/src/dosfs/msdos_file.c
parentdosfs: Use FAT_UNDEFINED_VALUE (diff)
downloadrtems-0f0db894f76661f0108b822bf6fd15fd19eb901e.tar.bz2
dosfs: Lazy update of FAT32 FS info sector
The FAT32 FS info sector contains hints for the free cluster count and the next free cluster. The previous code read these values during mount and replaced them with invalid values. The shutdown operation updated them with the current values. These values are only hints. Every FAT implementation must cope with arbitrary values. They are intended to speed up certain operations. Now we update the free cluster count and next free culster in the FAT32 FS info sector only during unmount or sync operations and only if the values have changed. This avoids writes to the FS info sector and conforms to the behaviour of Linux and Windows. The application can force an update of these values now with the fsync() and fdatasync() operations. Applications that only read will perform not write operations to the FAT32 FS info sector. The new fat_sync() function performs all non-file specific synchronizations.
Diffstat (limited to 'cpukit/libfs/src/dosfs/msdos_file.c')
-rw-r--r--cpukit/libfs/src/dosfs/msdos_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c
index 595bd3fabc..0406be0f58 100644
--- a/cpukit/libfs/src/dosfs/msdos_file.c
+++ b/cpukit/libfs/src/dosfs/msdos_file.c
@@ -290,7 +290,7 @@ msdos_file_sync(rtems_libio_t *iop)
return rc;
}
- rc = msdos_sync_unprotected(fs_info);
+ rc = fat_sync(&fs_info->fat);
rtems_semaphore_release(fs_info->vol_sema);
return RC_OK;