Lines 769-786
Link Here
|
769 |
size_fat = 32; |
769 |
size_fat = 32; |
770 |
} |
770 |
} |
771 |
if (size_fat == 32) { |
771 |
if (size_fat == 32) { |
772 |
/* For FAT32, try to do the same as M$'s format command: |
772 |
/* For FAT32, try to do the same as M$'s format command |
773 |
* fs size < 256M: 0.5k clusters |
773 |
* (see http://www.win.tue.nl/~aeb/linux/fs/fat/fatgen103.pdf p. 20): |
774 |
* fs size < 8G: 4k clusters |
774 |
* fs size <= 260M: 0.5k clusters |
775 |
* fs size < 16G: 8k clusters |
775 |
* fs size <= 8G: 4k clusters |
776 |
* fs size >= 16G: 16k clusters |
776 |
* fs size <= 16G: 8k clusters |
|
|
777 |
* fs size > 16G: 16k clusters |
777 |
*/ |
778 |
*/ |
778 |
unsigned long sz_mb = |
779 |
unsigned long sz_mb = |
779 |
(blocks+(1<<(20-BLOCK_SIZE_BITS))-1) >> (20-BLOCK_SIZE_BITS); |
780 |
(blocks+(1<<(20-BLOCK_SIZE_BITS))-1) >> (20-BLOCK_SIZE_BITS); |
780 |
bs.cluster_size = sz_mb >= 16*1024 ? 32 : |
781 |
bs.cluster_size = sz_mb > 16*1024 ? 32 : |
781 |
sz_mb >= 8*1024 ? 16 : |
782 |
sz_mb > 8*1024 ? 16 : |
782 |
sz_mb >= 256 ? 8 : |
783 |
sz_mb > 260 ? 8 : |
783 |
1; |
784 |
1; |
784 |
} |
785 |
} |
785 |
else { |
786 |
else { |
786 |
/* FAT12 and FAT16: start at 4 sectors per cluster */ |
787 |
/* FAT12 and FAT16: start at 4 sectors per cluster */ |
Lines 1036-1041
Link Here
|
1036 |
break; |
1037 |
break; |
1037 |
|
1038 |
|
1038 |
case 32: |
1039 |
case 32: |
|
|
1040 |
if (clust32 < MIN_CLUST_32) |
1041 |
fprintf(stderr, "WARNING: Not enough clusters for a 32 bit FAT!\n"); |
1039 |
cluster_count = clust32; |
1042 |
cluster_count = clust32; |
1040 |
fat_length = fatlength32; |
1043 |
fat_length = fatlength32; |
1041 |
bs.fat_length = CT_LE_W(0); |
1044 |
bs.fat_length = CT_LE_W(0); |