diff options
| author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-11-26 16:57:30 +0000 |
|---|---|---|
| committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-11-26 16:57:30 +0000 |
| commit | d052ced874172e95fdc1d096205ac4dfe38907f3 (patch) | |
| tree | 2f05046952b93c1fa4345421dd28d4795fe8dfb9 /firmware/drivers/fat.c | |
| parent | b2dc7f004ef2a9fe81d93acc7810ed16bebb42f6 (diff) | |
| download | rockbox-d052ced874172e95fdc1d096205ac4dfe38907f3.zip rockbox-d052ced874172e95fdc1d096205ac4dfe38907f3.tar.gz rockbox-d052ced874172e95fdc1d096205ac4dfe38907f3.tar.bz2 rockbox-d052ced874172e95fdc1d096205ac4dfe38907f3.tar.xz | |
Merge branch 'hotswap'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23759 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/fat.c')
| -rw-r--r-- | firmware/drivers/fat.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index b5f6e77..169672f 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -458,11 +458,15 @@ int fat_mount(IF_MV2(int volume,) IF_MD2(int drive,) long startsector) int fat_unmount(int volume, bool flush) { int rc; +#ifdef HAVE_MULTIVOLUME struct bpb* fat_bpb = &fat_bpbs[volume]; +#else + (void)volume; +#endif if(flush) { - rc = flush_fat(fat_bpb); /* the clean way, while still alive */ + rc = flush_fat(IF_MV(fat_bpb)); /* the clean way, while still alive */ } else { /* volume is not accessible any more, e.g. MMC removed */ @@ -471,7 +475,11 @@ int fat_unmount(int volume, bool flush) for(i = 0;i < FAT_CACHE_SIZE;i++) { struct fat_cache_entry *fce = &fat_cache[i]; - if(fce->inuse && fce->fat_vol == fat_bpb) + if(fce->inuse +#ifdef HAVE_MULTIVOLUME + && fce->fat_vol == fat_bpb +#endif + ) { fce->inuse = false; /* discard all from that volume */ fce->dirty = false; @@ -480,7 +488,9 @@ int fat_unmount(int volume, bool flush) mutex_unlock(&cache_mutex); rc = 0; } +#ifdef HAVE_MULTIVOLUME fat_bpb->mounted = false; +#endif return rc; } #endif /* #ifdef HAVE_HOTSWAP */ |