From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E536FC48BD7 for ; Wed, 4 Sep 2019 02:10:22 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C22462339E for ; Wed, 4 Sep 2019 02:10:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C22462339E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9D2C68034E; Wed, 4 Sep 2019 02:10:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KHBcemegg2yt; Wed, 4 Sep 2019 02:10:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0988485644; Wed, 4 Sep 2019 02:10:22 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id AE04D1BF4DB for ; Wed, 4 Sep 2019 02:10:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AB02E869BB for ; Wed, 4 Sep 2019 02:10:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7aHd4_lD9cPn for ; Wed, 4 Sep 2019 02:10:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 86C8985644 for ; Wed, 4 Sep 2019 02:10:17 +0000 (UTC) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4D35536BA690EBFB9591; Wed, 4 Sep 2019 10:10:15 +0800 (CST) Received: from architecture4.huawei.com (10.140.130.215) by smtp.huawei.com (10.3.19.211) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 10:10:08 +0800 From: Gao Xiang To: Chao Yu , Greg Kroah-Hartman , Christoph Hellwig , Subject: [PATCH v2 04/25] erofs: kill __packed for on-disk structures Date: Wed, 4 Sep 2019 10:08:51 +0800 Message-ID: <20190904020912.63925-5-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190904020912.63925-1-gaoxiang25@huawei.com> References: <20190901055130.30572-1-hsiangkao@aol.com> <20190904020912.63925-1-gaoxiang25@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.140.130.215] X-CFilter-Loop: Reflected X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, Miao Xie , Chao Yu , linux-erofs@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" 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 Signed-off-by: Gao Xiang --- fs/erofs/erofs_fs.h | 18 +++++++++--------- 1 file 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)) + \ -- 2.17.1 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel