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