summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs/msdos_dir.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-09 14:33:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-11 13:58:43 +0200
commit86ef0df976faf1b060347a07744814458aa42619 (patch)
treed001b836005d059b5aa11cf541093f5027c50d28 /cpukit/libfs/src/dosfs/msdos_dir.c
parentlibblock: Add RTEMS_BLKIO_PURGEDEV (diff)
downloadrtems-86ef0df976faf1b060347a07744814458aa42619.tar.bz2
dosfs: Remove fat_file_datasync()
The fat_file_datasync() read every cluster of the file into the cache and then synchronized it step-by-step. For unmodified buffers this is a non-operation. For modified buffers this will wake-up the swapout task which performs then a single buffer write operation. This is usually quite inefficient. Firstly we do single buffer writes, secondly we may perform a lot of unnecessary read operations (for huge files this is really bad), and thirdly this leads likely to cache evictions. The synchronization procedure is replaced by a simple rtems_bdbuf_sync_dev(). This has the side-effect that also buffers not related to the file are synchronized, but since the modified list is normally short this should be acceptable.
Diffstat (limited to 'cpukit/libfs/src/dosfs/msdos_dir.c')
-rw-r--r--cpukit/libfs/src/dosfs/msdos_dir.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c
index 38ea6675f7..8bd807dc1b 100644
--- a/cpukit/libfs/src/dosfs/msdos_dir.c
+++ b/cpukit/libfs/src/dosfs/msdos_dir.c
@@ -457,34 +457,3 @@ msdos_dir_stat(
* RETURNS:
*
*/
-
-/* msdos_dir_sync --
- * The following routine does a syncronization on a MSDOS directory node.
- * DIR_WrtTime, DIR_WrtDate and DIR_fileSize fields of 32 Bytes Directory
- * Entry Structure should not be updated for directories, so only call
- * to corresponding fat-file routine.
- *
- * PARAMETERS:
- * iop - file control block
- *
- * RETURNS:
- * RC_OK on success, or -1 if error occured (errno set apropriately).
- */
-int
-msdos_dir_sync(rtems_libio_t *iop)
-{
- int rc = RC_OK;
- rtems_status_code sc = RTEMS_SUCCESSFUL;
- fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
- msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
-
- sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
- MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_set_errno_and_return_minus_one(EIO);
-
- rc = fat_file_datasync(iop->pathinfo.mt_entry, fat_fd);
-
- rtems_semaphore_release(fs_info->vol_sema);
- return rc;
-}