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.tar.gz rockbox-d052ced874172e95fdc1d096205ac4dfe38907f3.zip |
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 b5f6e77837..169672f08e 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) | |||
458 | int fat_unmount(int volume, bool flush) | 458 | int fat_unmount(int volume, bool flush) |
459 | { | 459 | { |
460 | int rc; | 460 | int rc; |
461 | #ifdef HAVE_MULTIVOLUME | ||
461 | struct bpb* fat_bpb = &fat_bpbs[volume]; | 462 | struct bpb* fat_bpb = &fat_bpbs[volume]; |
463 | #else | ||
464 | (void)volume; | ||
465 | #endif | ||
462 | 466 | ||
463 | if(flush) | 467 | if(flush) |
464 | { | 468 | { |
465 | rc = flush_fat(fat_bpb); /* the clean way, while still alive */ | 469 | rc = flush_fat(IF_MV(fat_bpb)); /* the clean way, while still alive */ |
466 | } | 470 | } |
467 | else | 471 | else |
468 | { /* volume is not accessible any more, e.g. MMC removed */ | 472 | { /* volume is not accessible any more, e.g. MMC removed */ |
@@ -471,7 +475,11 @@ int fat_unmount(int volume, bool flush) | |||
471 | for(i = 0;i < FAT_CACHE_SIZE;i++) | 475 | for(i = 0;i < FAT_CACHE_SIZE;i++) |
472 | { | 476 | { |
473 | struct fat_cache_entry *fce = &fat_cache[i]; | 477 | struct fat_cache_entry *fce = &fat_cache[i]; |
474 | if(fce->inuse && fce->fat_vol == fat_bpb) | 478 | if(fce->inuse |
479 | #ifdef HAVE_MULTIVOLUME | ||
480 | && fce->fat_vol == fat_bpb | ||
481 | #endif | ||
482 | ) | ||
475 | { | 483 | { |
476 | fce->inuse = false; /* discard all from that volume */ | 484 | fce->inuse = false; /* discard all from that volume */ |
477 | fce->dirty = false; | 485 | fce->dirty = false; |
@@ -480,7 +488,9 @@ int fat_unmount(int volume, bool flush) | |||
480 | mutex_unlock(&cache_mutex); | 488 | mutex_unlock(&cache_mutex); |
481 | rc = 0; | 489 | rc = 0; |
482 | } | 490 | } |
491 | #ifdef HAVE_MULTIVOLUME | ||
483 | fat_bpb->mounted = false; | 492 | fat_bpb->mounted = false; |
493 | #endif | ||
484 | return rc; | 494 | return rc; |
485 | } | 495 | } |
486 | #endif /* #ifdef HAVE_HOTSWAP */ | 496 | #endif /* #ifdef HAVE_HOTSWAP */ |