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
+2
-2
@@ -40,7 +40,7 @@ void reiserfsck_insert_item(struct reiserfs_path *path, struct item_head *ih,
|
||||
|
||||
static void free_unformatted_nodes(struct item_head *ih, struct buffer_head *bh)
|
||||
{
|
||||
__u32 *punfm = (__u32 *) ih_item_body(bh, ih);
|
||||
__le32 *punfm = (__le32 *) ih_item_body(bh, ih);
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM(ih); i++) {
|
||||
@@ -90,7 +90,7 @@ void reiserfsck_cut_from_item(struct reiserfs_path *path, int cut_size)
|
||||
if (is_indirect_ih(ih = tp_item_head(path))) {
|
||||
struct buffer_head *bh = PATH_PLAST_BUFFER(path);
|
||||
__u32 unfm_ptr =
|
||||
d32_get((__u32 *) ih_item_body(bh, ih), I_UNFM_NUM(ih) - 1);
|
||||
d32_get((__le32 *)ih_item_body(bh, ih), I_UNFM_NUM(ih) - 1);
|
||||
if (unfm_ptr != 0) {
|
||||
struct buffer_head *to_be_forgotten;
|
||||
|
||||
|
||||
Reference in new issue
Block a user