aboutsummaryrefslogtreecommitdiffstats
path: root/fs/freevxfs/vxfs_inode.h
diff options
context:
space:
mode:
authorKrzysztof Błaszkowski <kb@sysmikro.com.pl>2016-05-31 02:45:13 -0400
committerChristoph Hellwig <hch@lst.de>2016-06-01 03:01:28 -0400
commit0d83f7fc83f77d1cc8395b9e851325d8cc1892e3 (patch)
tree9cfc6aef0a098884097fd37bb413639e8e76f461 /fs/freevxfs/vxfs_inode.h
parent6b15d6650c5301ce023d8df0cc3a60b1a76d377e (diff)
freevxfs: handle big endian HP-UX file systems
To support VxFS filesystems from HP-UX on x86 systems we need to implement byte swapping, and to keep support for Unixware filesystems it needs to be the complicated dual-endian kind ala sysvfs. To do this properly we have to split the on disk and in-core inode so that we can keep the in-core one in native endianness. All other structures are byteswapped on demand. Signed-off-by: Krzysztof Błaszkowski <kb@sysmikro.com.pl> [hch: make spare happy] Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/freevxfs/vxfs_inode.h')
-rw-r--r--fs/freevxfs/vxfs_inode.h138
1 files changed, 72 insertions, 66 deletions
diff --git a/fs/freevxfs/vxfs_inode.h b/fs/freevxfs/vxfs_inode.h
index 240aeb11263f..93d01148e5db 100644
--- a/fs/freevxfs/vxfs_inode.h
+++ b/fs/freevxfs/vxfs_inode.h
@@ -66,74 +66,74 @@ enum {
66 * Data stored immediately in the inode. 66 * Data stored immediately in the inode.
67 */ 67 */
68struct vxfs_immed { 68struct vxfs_immed {
69 u_int8_t vi_immed[VXFS_NIMMED]; 69 __u8 vi_immed[VXFS_NIMMED];
70}; 70};
71 71
72struct vxfs_ext4 { 72struct vxfs_ext4 {
73 u_int32_t ve4_spare; /* ?? */ 73 __fs32 ve4_spare; /* ?? */
74 u_int32_t ve4_indsize; /* Indirect extent size */ 74 __fs32 ve4_indsize; /* Indirect extent size */
75 vx_daddr_t ve4_indir[VXFS_NIADDR]; /* Indirect extents */ 75 __fs32 ve4_indir[VXFS_NIADDR]; /* Indirect extents */
76 struct direct { /* Direct extents */ 76 struct direct { /* Direct extents */
77 vx_daddr_t extent; /* Extent number */ 77 __fs32 extent; /* Extent number */
78 int32_t size; /* Size of extent */ 78 __fs32 size; /* Size of extent */
79 } ve4_direct[VXFS_NDADDR]; 79 } ve4_direct[VXFS_NDADDR];
80}; 80};
81 81
82struct vxfs_typed { 82struct vxfs_typed {
83 u_int64_t vt_hdr; /* Header, 0xTTOOOOOOOOOOOOOO; T=type,O=offs */ 83 __fs64 vt_hdr; /* Header, 0xTTOOOOOOOOOOOOOO; T=type,O=offs */
84 vx_daddr_t vt_block; /* Extent block */ 84 __fs32 vt_block; /* Extent block */
85 int32_t vt_size; /* Size in blocks */ 85 __fs32 vt_size; /* Size in blocks */
86}; 86};
87 87
88struct vxfs_typed_dev4 { 88struct vxfs_typed_dev4 {
89 u_int64_t vd4_hdr; /* Header, 0xTTOOOOOOOOOOOOOO; T=type,O=offs */ 89 __fs64 vd4_hdr; /* Header, 0xTTOOOOOOOOOOOOOO; T=type,O=offs */
90 u_int64_t vd4_block; /* Extent block */ 90 __fs64 vd4_block; /* Extent block */
91 u_int64_t vd4_size; /* Size in blocks */ 91 __fs64 vd4_size; /* Size in blocks */
92 int32_t vd4_dev; /* Device ID */ 92 __fs32 vd4_dev; /* Device ID */
93 u_int32_t __pad1; 93 __u8 __pad1;
94}; 94};
95 95
96/* 96/*
97 * The inode as contained on the physical device. 97 * The inode as contained on the physical device.
98 */ 98 */
99struct vxfs_dinode { 99struct vxfs_dinode {
100 int32_t vdi_mode; 100 __fs32 vdi_mode;
101 u_int32_t vdi_nlink; /* Link count */ 101 __fs32 vdi_nlink; /* Link count */
102 u_int32_t vdi_uid; /* UID */ 102 __fs32 vdi_uid; /* UID */
103 u_int32_t vdi_gid; /* GID */ 103 __fs32 vdi_gid; /* GID */
104 u_int64_t vdi_size; /* Inode size in bytes */ 104 __fs64 vdi_size; /* Inode size in bytes */
105 u_int32_t vdi_atime; /* Last time accessed - sec */ 105 __fs32 vdi_atime; /* Last time accessed - sec */
106 u_int32_t vdi_autime; /* Last time accessed - usec */ 106 __fs32 vdi_autime; /* Last time accessed - usec */
107 u_int32_t vdi_mtime; /* Last modify time - sec */ 107 __fs32 vdi_mtime; /* Last modify time - sec */
108 u_int32_t vdi_mutime; /* Last modify time - usec */ 108 __fs32 vdi_mutime; /* Last modify time - usec */
109 u_int32_t vdi_ctime; /* Create time - sec */ 109 __fs32 vdi_ctime; /* Create time - sec */
110 u_int32_t vdi_cutime; /* Create time - usec */ 110 __fs32 vdi_cutime; /* Create time - usec */
111 u_int8_t vdi_aflags; /* Allocation flags */ 111 __u8 vdi_aflags; /* Allocation flags */
112 u_int8_t vdi_orgtype; /* Organisation type */ 112 __u8 vdi_orgtype; /* Organisation type */
113 u_int16_t vdi_eopflags; 113 __fs16 vdi_eopflags;
114 u_int32_t vdi_eopdata; 114 __fs32 vdi_eopdata;
115 union { 115 union {
116 u_int32_t rdev; 116 __fs32 rdev;
117 u_int32_t dotdot; 117 __fs32 dotdot;
118 struct { 118 struct {
119 u_int32_t reserved; 119 __u32 reserved;
120 u_int32_t fixextsize; 120 __fs32 fixextsize;
121 } i_regular; 121 } i_regular;
122 struct { 122 struct {
123 u_int32_t matchino; 123 __fs32 matchino;
124 u_int32_t fsetindex; 124 __fs32 fsetindex;
125 } i_vxspec; 125 } i_vxspec;
126 u_int64_t align; 126 __u64 align;
127 } vdi_ftarea; 127 } vdi_ftarea;
128 u_int32_t vdi_blocks; /* How much blocks does inode occupy */ 128 __fs32 vdi_blocks; /* How much blocks does inode occupy */
129 u_int32_t vdi_gen; /* Inode generation */ 129 __fs32 vdi_gen; /* Inode generation */
130 u_int64_t vdi_version; /* Version */ 130 __fs64 vdi_version; /* Version */
131 union { 131 union {
132 struct vxfs_immed immed; 132 struct vxfs_immed immed;
133 struct vxfs_ext4 ext4; 133 struct vxfs_ext4 ext4;
134 struct vxfs_typed typed[VXFS_NTYPED]; 134 struct vxfs_typed typed[VXFS_NTYPED];
135 } vdi_org; 135 } vdi_org;
136 u_int32_t vdi_iattrino; 136 __fs32 vdi_iattrino;
137}; 137};
138 138
139#define vdi_rdev vdi_ftarea.rdev 139#define vdi_rdev vdi_ftarea.rdev
@@ -149,32 +149,38 @@ struct vxfs_dinode {
149 149
150/* 150/*
151 * The inode as represented in the main memory. 151 * The inode as represented in the main memory.
152 *
153 * TBD: This should become a separate structure...
154 */ 152 */
155#define vxfs_inode_info vxfs_dinode 153struct vxfs_inode_info {
156 154 __u32 vii_mode;
157#define vii_mode vdi_mode 155 __u32 vii_nlink; /* Link count */
158#define vii_uid vdi_uid 156 __u32 vii_uid; /* UID */
159#define vii_gid vdi_gid 157 __u32 vii_gid; /* GID */
160#define vii_nlink vdi_nlink 158 __u64 vii_size; /* Inode size in bytes */
161#define vii_size vdi_size 159 __u32 vii_atime; /* Last time accessed - sec */
162#define vii_atime vdi_atime 160 __u32 vii_autime; /* Last time accessed - usec */
163#define vii_ctime vdi_ctime 161 __u32 vii_mtime; /* Last modify time - sec */
164#define vii_mtime vdi_mtime 162 __u32 vii_mutime; /* Last modify time - usec */
165#define vii_blocks vdi_blocks 163 __u32 vii_ctime; /* Create time - sec */
166#define vii_org vdi_org 164 __u32 vii_cutime; /* Create time - usec */
167#define vii_orgtype vdi_orgtype 165 __u8 vii_orgtype; /* Organisation type */
168#define vii_gen vdi_gen 166 union {
169 167 __u32 rdev;
170#define vii_rdev vdi_ftarea.rdev 168 __u32 dotdot;
171#define vii_dotdot vdi_ftarea.dotdot 169 } vii_ftarea;
172#define vii_fixextsize vdi_ftarea.regular.fixextsize 170 __u32 vii_blocks; /* How much blocks does inode occupy */
173#define vii_matchino vdi_ftarea.vxspec.matchino 171 __u32 vii_gen; /* Inode generation */
174#define vii_fsetindex vdi_ftarea.vxspec.fsetindex 172 union {
175 173 struct vxfs_immed immed;
176#define vii_immed vdi_org.immed 174 struct vxfs_ext4 ext4;
177#define vii_ext4 vdi_org.ext4 175 struct vxfs_typed typed[VXFS_NTYPED];
178#define vii_typed vdi_org.typed 176 } vii_org;
177};
178
179#define vii_rdev vii_ftarea.rdev
180#define vii_dotdot vii_ftarea.dotdot
181
182#define vii_immed vii_org.immed
183#define vii_ext4 vii_org.ext4
184#define vii_typed vii_org.typed
179 185
180#endif /* _VXFS_INODE_H_ */ 186#endif /* _VXFS_INODE_H_ */