Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * These structs are used by the system-use-sharing protocol, in which the
0004  * Rock Ridge extensions are embedded.  It is quite possible that other
0005  * extensions are present on the disk, and this is fine as long as they
0006  * all use SUSP
0007  */
0008 
0009 struct SU_SP_s {
0010     __u8 magic[2];
0011     __u8 skip;
0012 } __attribute__ ((packed));
0013 
0014 struct SU_CE_s {
0015     __u8 extent[8];
0016     __u8 offset[8];
0017     __u8 size[8];
0018 };
0019 
0020 struct SU_ER_s {
0021     __u8 len_id;
0022     __u8 len_des;
0023     __u8 len_src;
0024     __u8 ext_ver;
0025     __u8 data[];
0026 } __attribute__ ((packed));
0027 
0028 struct RR_RR_s {
0029     __u8 flags[1];
0030 } __attribute__ ((packed));
0031 
0032 struct RR_PX_s {
0033     __u8 mode[8];
0034     __u8 n_links[8];
0035     __u8 uid[8];
0036     __u8 gid[8];
0037 };
0038 
0039 struct RR_PN_s {
0040     __u8 dev_high[8];
0041     __u8 dev_low[8];
0042 };
0043 
0044 struct SL_component {
0045     __u8 flags;
0046     __u8 len;
0047     __u8 text[];
0048 } __attribute__ ((packed));
0049 
0050 struct RR_SL_s {
0051     __u8 flags;
0052     struct SL_component link;
0053 } __attribute__ ((packed));
0054 
0055 struct RR_NM_s {
0056     __u8 flags;
0057     char name[];
0058 } __attribute__ ((packed));
0059 
0060 struct RR_CL_s {
0061     __u8 location[8];
0062 };
0063 
0064 struct RR_PL_s {
0065     __u8 location[8];
0066 };
0067 
0068 struct stamp {
0069     __u8 time[7];       /* actually 6 unsigned, 1 signed */
0070 } __attribute__ ((packed));
0071 
0072 struct RR_TF_s {
0073     __u8 flags;
0074     struct stamp times[];   /* Variable number of these beasts */
0075 } __attribute__ ((packed));
0076 
0077 /* Linux-specific extension for transparent decompression */
0078 struct RR_ZF_s {
0079     __u8 algorithm[2];
0080     __u8 parms[2];
0081     __u8 real_size[8];
0082 };
0083 
0084 /*
0085  * These are the bits and their meanings for flags in the TF structure.
0086  */
0087 #define TF_CREATE 1
0088 #define TF_MODIFY 2
0089 #define TF_ACCESS 4
0090 #define TF_ATTRIBUTES 8
0091 #define TF_BACKUP 16
0092 #define TF_EXPIRATION 32
0093 #define TF_EFFECTIVE 64
0094 #define TF_LONG_FORM 128
0095 
0096 struct rock_ridge {
0097     __u8 signature[2];
0098     __u8 len;
0099     __u8 version;
0100     union {
0101         struct SU_SP_s SP;
0102         struct SU_CE_s CE;
0103         struct SU_ER_s ER;
0104         struct RR_RR_s RR;
0105         struct RR_PX_s PX;
0106         struct RR_PN_s PN;
0107         struct RR_SL_s SL;
0108         struct RR_NM_s NM;
0109         struct RR_CL_s CL;
0110         struct RR_PL_s PL;
0111         struct RR_TF_s TF;
0112         struct RR_ZF_s ZF;
0113     } u;
0114 };
0115 
0116 #define RR_PX 1         /* POSIX attributes */
0117 #define RR_PN 2         /* POSIX devices */
0118 #define RR_SL 4         /* Symbolic link */
0119 #define RR_NM 8         /* Alternate Name */
0120 #define RR_CL 16        /* Child link */
0121 #define RR_PL 32        /* Parent link */
0122 #define RR_RE 64        /* Relocation directory */
0123 #define RR_TF 128       /* Timestamps */