You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

  1. From 1e76e5778a1885452939a79d9145b80634a5b023 Mon Sep 17 00:00:00 2001
  2. From: Andreas Bombe <aeb@debian.org>
  3. Date: Wed, 11 May 2016 03:44:58 +0200
  4. Subject: [PATCH] mkfs: Default to 64/32 heads/sectors for targets smaller than
  5. 512 MB
  6. This may put defaults in certain use cases a little bit more in line
  7. with the old defaults in versions up to 3.0.28. It has mostly aesthetic
  8. value in most cases.
  9. Signed-off-by: Andreas Bombe <aeb@debian.org>
  10. ---
  11. src/mkfs.fat.c | 10 ++++++++++
  12. 1 file changed, 10 insertions(+)
  13. --- a/src/mkfs.fat.c
  14. +++ b/src/mkfs.fat.c
  15. @@ -519,6 +519,16 @@ static void establish_params(struct devi
  16. unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
  17. int def_root_dir_entries = 512;
  18. + if (info->size < 512 * 1024 * 1024) {
  19. + /*
  20. + * These values are more or less meaningless, but we can at least
  21. + * use less extreme values for smaller filesystems where the large
  22. + * dummy values signifying LBA only access are not needed.
  23. + */
  24. + sec_per_track = 32;
  25. + heads = 64;
  26. + }
  27. +
  28. if (info->type != TYPE_FIXED) {
  29. /* enter default parameters for floppy disks if the size matches */
  30. switch (info->size / 1024) {