Advertisement
Guest User

Untitled

a guest
Jan 10th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.95 KB | None | 0 0
  1. Index: firmware/common/disk.c
  2. ===================================================================
  3. --- firmware/common/disk.c  (revision 29021)
  4. +++ firmware/common/disk.c  (working copy)
  5. @@ -263,19 +263,23 @@
  6.  
  7.  int disk_unmount_all(void)
  8.  {
  9. -#ifndef HAVE_MULTIDRIVE
  10. -    return disk_unmount(0);
  11. -#else  /* HAVE_MULTIDRIVE */
  12.      int unmounted = 0;
  13.      int i;
  14. -    for (i = 0; i < NUM_DRIVES; i++)
  15. +#ifdef HAVE_HOTSWAP
  16. +    mutex_lock(&disk_mutex);
  17. +#endif
  18. +    for (i=0; i<NUM_VOLUMES; i++)
  19.      {
  20. +        if(vol_drive[i] >= 0)
  21. +        {
  22. +            vol_drive[i] = -1; /* mark unused */
  23. +            unmounted++;
  24. +            release_files(i);
  25. +            release_dirs(i);
  26. +            fat_unmount(i, true);
  27. +        }
  28. +    }
  29.  #ifdef HAVE_HOTSWAP
  30. -        if (storage_present(i))
  31. +    mutex_unlock(&disk_mutex);
  32.  #endif
  33. -            unmounted += disk_unmount(i);
  34. -    }
  35.  
  36.      return unmounted;
  37. -#endif  /* HAVE_MULTIDRIVE */
  38.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement