summaryrefslogtreecommitdiff
path: root/fs/erofs
diff options
context:
space:
mode:
authorGao Xiang <gaoxiang25@huawei.com>2019-09-04 05:08:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-05 21:10:07 +0300
commited34aa4a8a7d41ce0a160ccec0fd4f6b44a79c15 (patch)
tree28adb4382a5595997ca64a1bd57ca60bcb0268c7 /fs/erofs
parentb6796abd3cc155eb5d49b9a7600a26f503b62da7 (diff)
downloadlinux-ed34aa4a8a7d41ce0a160ccec0fd4f6b44a79c15.tar.xz
erofs: kill __packed for on-disk structures
As Christoph suggested "Please don't add __packed" [1], remove all __packed except struct erofs_dirent here. Note that all on-disk fields except struct erofs_dirent (12 bytes with a 8-byte nid) in EROFS are naturally aligned. [1] https://lore.kernel.org/r/20190829095954.GB20598@infradead.org/ Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Link: https://lore.kernel.org/r/20190904020912.63925-5-gaoxiang25@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/erofs')
-rw-r--r--fs/erofs/erofs_fs.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_fs.h
index c1220b0f26e0..59dcc2e8cb02 100644
--- a/fs/erofs/erofs_fs.h
+++ b/fs/erofs/erofs_fs.h
@@ -38,7 +38,7 @@ struct erofs_super_block {
__le32 requirements; /* (aka. feature_incompat) */
__u8 reserved2[44];
-} __packed;
+};
/*
* erofs inode data mapping:
@@ -91,12 +91,12 @@ struct erofs_inode_v1 {
/* for device files, used to indicate old/new device # */
__le32 rdev;
- } i_u __packed;
+ } i_u;
__le32 i_ino; /* only used for 32-bit stat compatibility */
__le16 i_uid;
__le16 i_gid;
__le32 i_reserved2;
-} __packed;
+};
/* 32 bytes on-disk inode */
#define EROFS_INODE_LAYOUT_V1 0
@@ -119,7 +119,7 @@ struct erofs_inode_v2 {
/* for device files, used to indicate old/new device # */
__le32 rdev;
- } i_u __packed;
+ } i_u;
/* only used for 32-bit stat compatibility */
__le32 i_ino;
@@ -130,7 +130,7 @@ struct erofs_inode_v2 {
__le32 i_ctime_nsec;
__le32 i_nlink;
__u8 i_reserved2[16];
-} __packed;
+};
#define EROFS_MAX_SHARED_XATTRS (128)
/* h_shared_count between 129 ... 255 are special # */
@@ -152,7 +152,7 @@ struct erofs_xattr_ibody_header {
__u8 h_shared_count;
__u8 h_reserved2[7];
__le32 h_shared_xattrs[0]; /* shared xattr id array */
-} __packed;
+};
/* Name indexes */
#define EROFS_XATTR_INDEX_USER 1
@@ -169,7 +169,7 @@ struct erofs_xattr_entry {
__le16 e_value_size; /* size of attribute value */
/* followed by e_name and e_value */
char e_name[0]; /* attribute name */
-} __packed;
+};
static inline unsigned int erofs_xattr_ibody_size(__le16 i_xattr_icount)
{
@@ -273,8 +273,8 @@ struct z_erofs_vle_decompressed_index {
* [1] - pointing to the tail cluster
*/
__le16 delta[2];
- } di_u __packed;
-} __packed;
+ } di_u;
+};
#define Z_EROFS_VLE_LEGACY_INDEX_ALIGN(size) \
(round_up(size, sizeof(struct z_erofs_vle_decompressed_index)) + \