diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-11-08 15:41:23 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-11-13 09:38:03 +0100 |
commit | 0f0db894f76661f0108b822bf6fd15fd19eb901e (patch) | |
tree | ccc1ebf075e27b97e1d68ef332db3bc6a45b4126 /cpukit/libfs/src/dosfs/fat.h | |
parent | dosfs: Use FAT_UNDEFINED_VALUE (diff) | |
download | rtems-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/fat.h')
-rw-r--r-- | cpukit/libfs/src/dosfs/fat.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cpukit/libfs/src/dosfs/fat.h b/cpukit/libfs/src/dosfs/fat.h index 3a9c9c6e46..260d8aafd9 100644 --- a/cpukit/libfs/src/dosfs/fat.h +++ b/cpukit/libfs/src/dosfs/fat.h @@ -313,7 +313,11 @@ typedef struct fat_vol_s uint32_t rdir_cl; /* first cluster of the root directory */ uint16_t info_sec; /* FSInfo Sector Structure location */ uint32_t free_cls; /* last known free clusters count */ + uint32_t free_cls_in_fs_info; /* last known free clusters count + in FS info sector */ uint32_t next_cl; /* next free cluster number */ + uint32_t next_cl_in_fs_info; /* next free cluster number in FS + info sector */ uint8_t mirror; /* mirroring enabla/disable */ uint32_t afat_loc; /* active FAT location */ uint8_t afat; /* the number of active FAT */ @@ -500,11 +504,7 @@ fat_free_unique_ino(fat_fs_info_t *fs_info, uint32_t ino); int -fat_fat32_update_fsinfo_sector( - fat_fs_info_t *fs_info, - uint32_t free_count, - uint32_t next_free - ); +fat_sync(fat_fs_info_t *fs_info); #ifdef __cplusplus } |