fatformat.h 843 B

12345678910111213141516171819202122
  1. /* Create a fresh FAT filesystem on a block device (floppy = FAT12 superfloppy,
  2. * IDE = MBR + single FAT16/32 partition). */
  3. #ifndef FATFORMAT_H
  4. #define FATFORMAT_H
  5. #include "blkdev.h"
  6. /* Format device d. Returns 0 on success, -1 on error. `limit_sectors`
  7. * (0 = the whole device) caps the partition size; useful for testing or for
  8. * reserving part of a large disk for another filesystem. */
  9. int fat_format(blk_dev_t *d);
  10. int fat_format_limited(blk_dev_t *d, unsigned int limit_sectors);
  11. /* Decimal helper for the format messages (terminal + netlog mirror). */
  12. void format_putdec(unsigned int v);
  13. /* Set while a destructive format owns the disks. Filesystem syscalls wait
  14. * for it instead of touching a half-written FAT; the owner is exempt. */
  15. extern volatile int format_busy;
  16. extern volatile unsigned int format_owner_pid;
  17. #endif