disklabel.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef __disklabel_h__
  2. #define __disklabel_h__
  3. #ifndef __KERNEL_STRICT_NAMES
  4. /* ask kernel to be careful about name-space pollution: */
  5. # define __KERNEL_STRICT_NAMES
  6. # define fd_set kernel_fd_set
  7. #endif
  8. #include <linux/types.h>
  9. #define DISKLABELMAGIC (0x82564557UL)
  10. #define LABELSECTOR 0 /* sector containing label */
  11. #define LABELOFFSET 64 /* offset of label in sector */
  12. #define MAXPARTITIONS 8 /* max. # of partitions */
  13. /*
  14. * Filesystem type and version. Used to interpret other
  15. * filesystem-specific per-partition information.
  16. */
  17. #define FS_UNUSED 0 /* unused */
  18. #define FS_SWAP 1 /* swap */
  19. #define FS_V6 2 /* Sixth Edition */
  20. #define FS_V7 3 /* Seventh Edition */
  21. #define FS_SYSV 4 /* System V */
  22. #define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */
  23. #define FS_V8 6 /* Eighth Edition, 4K blocks */
  24. #define FS_BSDFFS 7 /* 4.2BSD fast file system */
  25. #define FS_EXT2 8 /* Linux ext2 file system */
  26. /* OSF will reserve 16--31 for vendor-specific entries */
  27. #define FS_ADVFS 16 /* Digital Advanced File System */
  28. #define FS_LSMpubl 17 /* Digital Log Strg public region */
  29. #define FS_LSMpriv 18 /* Digital Log Strg private region */
  30. #define FS_LSMsimp 19 /* Digital Log Strg simple disk */
  31. struct disklabel {
  32. __u32 d_magic; /* must be DISKLABELMAGIC */
  33. __u16 d_type, d_subtype;
  34. __u8 d_typename[16];
  35. __u8 d_packname[16];
  36. __u32 d_secsize;
  37. __u32 d_nsectors;
  38. __u32 d_ntracks;
  39. __u32 d_ncylinders;
  40. __u32 d_secpercyl;
  41. __u32 d_secprtunit;
  42. __u16 d_sparespertrack;
  43. __u16 d_sparespercyl;
  44. __u32 d_acylinders;
  45. __u16 d_rpm, d_interleave, d_trackskew, d_cylskew;
  46. __u32 d_headswitch, d_trkseek, d_flags;
  47. __u32 d_drivedata[5];
  48. __u32 d_spare[5];
  49. __u32 d_magic2; /* must be DISKLABELMAGIC */
  50. __u16 d_checksum;
  51. __u16 d_npartitions;
  52. __u32 d_bbsize, d_sbsize;
  53. struct d_partition {
  54. __u32 p_size;
  55. __u32 p_offset;
  56. __u32 p_fsize;
  57. __u8 p_fstype;
  58. __u8 p_frag;
  59. __u16 p_cpg;
  60. } d_partitions[MAXPARTITIONS];
  61. };
  62. #define DTYPE_SMD 1
  63. #define DTYPE_MSCP 2
  64. #define DTYPE_DEC 3
  65. #define DTYPE_SCSI 4
  66. #define DTYPE_ESDI 5
  67. #define DTYPE_ST506 6
  68. #define DTYPE_FLOPPY 10
  69. #ifdef DKTYPENAMES
  70. static char *fstypenames[] = {
  71. "unused",
  72. "swap",
  73. "Version 6",
  74. "Version 7",
  75. "System V",
  76. "4.1BSD",
  77. "Eighth Edition",
  78. "4.2BSD",
  79. "ext2", /* is this a good choice for ext2?? */
  80. "resrvd9",
  81. "resrvd10",
  82. "resrvd11",
  83. "resrvd12",
  84. "resrvd13",
  85. "resrvd14",
  86. "resrvd15",
  87. "ADVfs",
  88. "LSMpubl",
  89. "LSMpriv",
  90. "LSMsimp",
  91. 0
  92. };
  93. #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)
  94. #endif
  95. #endif /* __disklabel_h__ */