aboutsummaryrefslogtreecommitdiff
path: root/fs/fat/fat.c
diff options
context:
space:
mode:
authorStefan Brüns2016-09-11 22:51:40 +0200
committerTom Rini2016-09-23 08:55:56 -0400
commit3c0ed9c3a561ca744b2b76921bb8352ba2340669 (patch)
tree96eaf61ad2db6e61e4b17944aa222c914cb07b49 /fs/fat/fat.c
parented76f912777066c788ae7e9cfb1d5e19e8c35274 (diff)
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 'fs/fat/fat.c')
-rw-r--r--fs/fat/fat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 826bd852860..df9f2b56562 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -876,6 +876,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
}
mydata->fatbufnum = -1;
+ mydata->fat_dirty = 0;
mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
if (mydata->fatbuf == NULL) {
debug("Error: allocating memory\n");