rock.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * These structs are used by the system-use-sharing protocol, in which the
  4. * Rock Ridge extensions are embedded. It is quite possible that other
  5. * extensions are present on the disk, and this is fine as long as they
  6. * all use SUSP
  7. */
  8. struct SU_SP_s {
  9. __u8 magic[2];
  10. __u8 skip;
  11. } __attribute__ ((packed));
  12. struct SU_CE_s {
  13. __u8 extent[8];
  14. __u8 offset[8];
  15. __u8 size[8];
  16. };
  17. struct SU_ER_s {
  18. __u8 len_id;
  19. __u8 len_des;
  20. __u8 len_src;
  21. __u8 ext_ver;
  22. __u8 data[0];
  23. } __attribute__ ((packed));
  24. struct RR_RR_s {
  25. __u8 flags[1];
  26. } __attribute__ ((packed));
  27. struct RR_PX_s {
  28. __u8 mode[8];
  29. __u8 n_links[8];
  30. __u8 uid[8];
  31. __u8 gid[8];
  32. };
  33. struct RR_PN_s {
  34. __u8 dev_high[8];
  35. __u8 dev_low[8];
  36. };
  37. struct SL_component {
  38. __u8 flags;
  39. __u8 len;
  40. __u8 text[0];
  41. } __attribute__ ((packed));
  42. struct RR_SL_s {
  43. __u8 flags;
  44. struct SL_component link;
  45. } __attribute__ ((packed));
  46. struct RR_NM_s {
  47. __u8 flags;
  48. char name[0];
  49. } __attribute__ ((packed));
  50. struct RR_CL_s {
  51. __u8 location[8];
  52. };
  53. struct RR_PL_s {
  54. __u8 location[8];
  55. };
  56. struct stamp {
  57. __u8 time[7]; /* actually 6 unsigned, 1 signed */
  58. } __attribute__ ((packed));
  59. struct RR_TF_s {
  60. __u8 flags;
  61. struct stamp times[0]; /* Variable number of these beasts */
  62. } __attribute__ ((packed));
  63. /* Linux-specific extension for transparent decompression */
  64. struct RR_ZF_s {
  65. __u8 algorithm[2];
  66. __u8 parms[2];
  67. __u8 real_size[8];
  68. };
  69. /*
  70. * These are the bits and their meanings for flags in the TF structure.
  71. */
  72. #define TF_CREATE 1
  73. #define TF_MODIFY 2
  74. #define TF_ACCESS 4
  75. #define TF_ATTRIBUTES 8
  76. #define TF_BACKUP 16
  77. #define TF_EXPIRATION 32
  78. #define TF_EFFECTIVE 64
  79. #define TF_LONG_FORM 128
  80. struct rock_ridge {
  81. __u8 signature[2];
  82. __u8 len;
  83. __u8 version;
  84. union {
  85. struct SU_SP_s SP;
  86. struct SU_CE_s CE;
  87. struct SU_ER_s ER;
  88. struct RR_RR_s RR;
  89. struct RR_PX_s PX;
  90. struct RR_PN_s PN;
  91. struct RR_SL_s SL;
  92. struct RR_NM_s NM;
  93. struct RR_CL_s CL;
  94. struct RR_PL_s PL;
  95. struct RR_TF_s TF;
  96. struct RR_ZF_s ZF;
  97. } u;
  98. };
  99. #define RR_PX 1 /* POSIX attributes */
  100. #define RR_PN 2 /* POSIX devices */
  101. #define RR_SL 4 /* Symbolic link */
  102. #define RR_NM 8 /* Alternate Name */
  103. #define RR_CL 16 /* Child link */
  104. #define RR_PL 32 /* Parent link */
  105. #define RR_RE 64 /* Relocation directory */
  106. #define RR_TF 128 /* Timestamps */