reiserfsprogs: annotate for endian safeness
By annotating structure members and other on-disk structures as little endian, we can catch bugs more easily. The code was already endian safe except for three minor spots: 1) The badblock list code was initializing its key in an endian-unsafe way. 2) Indirect block pointer sequence printing was treating cpu-order values as little endian. 3) reiserfsck was trying to do endian switching on the lost+found key, but it was before it was even initialized to anything, so we can just remove that completely. These issues were fixed as part of this commit. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
1 parent
767f7b85df
commit
81aeadf510
26 files changed
+241
-220
No files matched your search
@@ -134,21 +134,21 @@ struct packed_dir_entry {
|
||||
|
||||
#define fread_le16(pv)\
|
||||
{\
|
||||
__u16 tmp; \
|
||||
__le16 tmp; \
|
||||
fread16(&tmp); \
|
||||
*pv = le16_to_cpu(tmp); \
|
||||
}
|
||||
|
||||
#define fread_le32(pv)\
|
||||
{\
|
||||
__u32 tmp; \
|
||||
__le32 tmp; \
|
||||
fread32(&tmp); \
|
||||
*pv = le32_to_cpu(tmp); \
|
||||
}
|
||||
|
||||
#define fread_le64(pv)\
|
||||
{\
|
||||
__u64 tmp; \
|
||||
__le64 tmp; \
|
||||
fread64(&tmp); \
|
||||
*pv = le64_to_cpu(tmp); \
|
||||
}
|
||||
@@ -160,19 +160,19 @@ struct packed_dir_entry {
|
||||
|
||||
#define fwrite_le16(pv)\
|
||||
{\
|
||||
__u16 tmp = cpu_to_le16(*(pv));\
|
||||
__le16 tmp = cpu_to_le16(*(pv));\
|
||||
fwrite16(&tmp);\
|
||||
}
|
||||
|
||||
#define fwrite_le32(pv)\
|
||||
{\
|
||||
__u32 tmp = cpu_to_le32(*(pv));\
|
||||
__le32 tmp = cpu_to_le32(*(pv));\
|
||||
fwrite32(&tmp);\
|
||||
}
|
||||
|
||||
#define fwrite_le64(pv)\
|
||||
{\
|
||||
__u64 tmp = cpu_to_le64(*(pv));\
|
||||
__le64 tmp = cpu_to_le64(*(pv));\
|
||||
fwrite64(&tmp);\
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user