]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove __arch_pack
authorChristoph Hellwig <hch@lst.de>
Wed, 10 Aug 2016 01:29:36 +0000 (11:29 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 10 Aug 2016 01:29:36 +0000 (11:29 +1000)
Source kernel commit: aa2dd0ad4d6d7dd85bb13ed64b872803be046f96

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>
include/xfs.h
include/xfs_arch.h
libxfs/xfs_da_format.h

index 7bed9573397424d41c8dd6699bbf200d6162b5d8..c878b2470cec07bab234927c4d31f3cd0285971e 100644 (file)
 #define __user
 #endif
 
+/*
+ * kernel struct packing shortcut
+ */
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
 #include <xfs/xfs_types.h>
 #include <xfs/xfs_fs.h>
 
index 87650f100c03c0995f15fa32beebf2714ca98356..6e3172c67bb2f8ba0bb924b2c99ee7ff6d066a95 100644 (file)
@@ -278,11 +278,4 @@ static inline void put_unaligned_be64(__uint64_t val, void *p)
        put_unaligned_be32(val, p + 4);
 }
 
-/* ARM old ABI has some weird alignment/padding */
-#if defined(__arm__) && !defined(__ARM_EABI__)
-#define __arch_pack __attribute__((packed))
-#else
-#define __arch_pack
-#endif
-
 #endif /* __XFS_ARCH_H__ */
index f877bb17c6c349e1ad2a47a79991921834a6adaf..685f23b670568ea3df1f2944d70ac6e3ea2cc238 100644 (file)
@@ -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 */