Skip to content

Commit

Permalink
xfs: remove __arch_pack
Browse files Browse the repository at this point in the history
Instead we always declare struct xfs_dir2_sf_hdr as packed.  That's
the expected layout, and while most major architectures do the packing
by default the new structure size and offset checker showed that not
only the ARM old ABI got this wrong, but various minor embedded
architectures did as well.

[Verified that no code change on x86-64 results from this change]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
  • Loading branch information
Christoph Hellwig authored and Dave Chinner committed Jul 20, 2016
1 parent 266b696 commit aa2dd0a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion fs/xfs/libxfs/xfs_da_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ typedef struct xfs_dir2_sf_hdr {
__uint8_t count; /* count of entries */
__uint8_t i8count; /* count of 8-byte inode #s */
__uint8_t parent[8]; /* parent dir inode number */
} __arch_pack xfs_dir2_sf_hdr_t;
} __packed xfs_dir2_sf_hdr_t;

typedef struct xfs_dir2_sf_entry {
__u8 namelen; /* actual name length */
Expand Down
7 changes: 0 additions & 7 deletions fs/xfs/xfs_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,6 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
return x;
}

/* ARM old ABI has some weird alignment/padding */
#if defined(__arm__) && !defined(__ARM_EABI__)
#define __arch_pack __attribute__((packed))
#else
#define __arch_pack
#endif

#define ASSERT_ALWAYS(expr) \
(unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))

Expand Down

0 comments on commit aa2dd0a

Please sign in to comment.