diff options
author | Stefan Brüns <stefan.bruens@rwth-aachen.de> | 2016-09-11 22:51:40 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-09-23 08:55:56 -0400 |
commit | 3c0ed9c3a561ca744b2b76921bb8352ba2340669 (patch) | |
tree | 96eaf61ad2db6e61e4b17944aa222c914cb07b49 /include/fat.h | |
parent | ed76f912777066c788ae7e9cfb1d5e19e8c35274 (diff) | |
download | u-boot-3c0ed9c3a561ca744b2b76921bb8352ba2340669.tar.gz |
fs/fat: Do not write unmodified fat entries to disk
The code caches 6 sectors of the FAT. On FAT traversal, the old contents
needs to be flushed to disk, but only if any FAT entries had been modified.
Explicitly flag the buffer on modification.
Currently, creating a new file traverses the whole FAT up to the first
free cluster and rewrites the on-disk blocks.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'include/fat.h')
-rw-r--r-- | include/fat.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/fat.h b/include/fat.h index 9d053e6fa6..8ec91cda75 100644 --- a/include/fat.h +++ b/include/fat.h @@ -169,6 +169,7 @@ typedef struct { int fatsize; /* Size of FAT in bits */ __u32 fatlength; /* Length of FAT in sectors */ __u16 fat_sect; /* Starting sector of the FAT */ + __u8 fat_dirty; /* Set if fatbuf has been modified */ __u32 rootdir_sect; /* Start sector of root directory */ __u16 sect_size; /* Size of sectors in bytes */ __u16 clust_size; /* Size of clusters in sectors */ |