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.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 E4C5AC41514 for ; Sun, 1 Sep 2019 05:52:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B98B22339D for ; Sun, 1 Sep 2019 05:52:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=aol.com header.i=@aol.com header.b="rl4KOY4l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbfIAFwq (ORCPT ); Sun, 1 Sep 2019 01:52:46 -0400 Received: from sonic304-23.consmr.mail.gq1.yahoo.com ([98.137.68.204]:36318 "EHLO sonic304-23.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbfIAFwq (ORCPT ); Sun, 1 Sep 2019 01:52:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1567317165; bh=bYGgbUkpYatgcwL6URU/dubCdNrEU0TuOnNro854EfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject; b=rl4KOY4lM7ZrLdBU0izAjz+sU2EuhRICXLFz2E2MLdnwpp7Mn9fIPGus8pvS29wUbe8i+yrIWGD/2oSAK+SCGyFpP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h3qVMcVpcXTPg_xFk6pDcfFr3N4jXotsGAe5kYSboV _kEThYWrTZxGrRfzd8i86Wn5zI6sGDivNiQBjiNtmvpn_LJHLOA6CwsLCEgl6I4S.Tc4VpaUBKE9 NtzAvHx6bvt19ApGdmdbZdxOUzbT9Xlxe2M.NgD1231_D1KjXfNSbizhfNUoryJwGgjCLKxuHKGl 0RG_CrHnYnI3czEeaPPK4IbJv84bVZtIGlUr1TTSiUaBX6_QGwdwihR2GPJd54U.KHi7aYr7CNlm 6wHwrKM8Cxyput4UkuRAyUr5un_ovBkib0hHG0gM9j5lA.h_xwqIJS3xsmJP8bOgMqFAjwVtmAIy YtwcnV9anlraMRpnb8ehmcEE9Q3dSkWyo9zlUQgJMMcYaHUcWg05arPcuesg0FuBSmEizQIFWup. sSJK7YX9860s2C69O2kx6KQ5W0gZAYWOhmtK0F3xDyK2ZO3EgNntVQViD3pk.3.WRDrojkT62zXA 4pMEVL5rv6IGFG.OUYA1D5ip3ogrR.oV2GBXP.g-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Sun, 1 Sep 2019 05:52:45 +0000 Received: by smtp406.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 426e3b5ec1af9e36f409445c51071a70; Sun, 01 Sep 2019 05:52:43 +0000 (UTC) From: Gao Xiang To: Christoph Hellwig , Chao Yu , Greg Kroah-Hartman Cc: linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org, linux-erofs@lists.ozlabs.org, Chao Yu , Gao Xiang Subject: [PATCH 11/21] erofs: use dsb instead of layout for ondisk super_block Date: Sun, 1 Sep 2019 13:51:20 +0800 Message-Id: <20190901055130.30572-12-hsiangkao@aol.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190901055130.30572-1-hsiangkao@aol.com> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190901055130.30572-1-hsiangkao@aol.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Gao Xiang As Christoph pointed out [1], "Why is the variable name for the on-disk subperblock layout? We usually still calls this something with sb in the name, e.g. dsb. for disksuper block. " Let's fix it. [1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/ Signed-off-by: Gao Xiang --- fs/erofs/super.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 8c43af5d5e57..c1a42ea7b72f 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -47,9 +47,9 @@ static void free_inode(struct inode *inode) } static bool check_layout_compatibility(struct super_block *sb, - struct erofs_super_block *layout) + struct erofs_super_block *dsb) { - const unsigned int requirements = le32_to_cpu(layout->requirements); + const unsigned int requirements = le32_to_cpu(dsb->requirements); EROFS_SB(sb)->requirements = requirements; @@ -66,7 +66,7 @@ static int superblock_read(struct super_block *sb) { struct erofs_sb_info *sbi; struct buffer_head *bh; - struct erofs_super_block *layout; + struct erofs_super_block *dsb; unsigned int blkszbits; int ret; @@ -78,16 +78,16 @@ static int superblock_read(struct super_block *sb) } sbi = EROFS_SB(sb); - layout = (struct erofs_super_block *)((u8 *)bh->b_data - + EROFS_SUPER_OFFSET); + dsb = (struct erofs_super_block *)((u8 *)bh->b_data + + EROFS_SUPER_OFFSET); ret = -EINVAL; - if (le32_to_cpu(layout->magic) != EROFS_SUPER_MAGIC_V1) { + if (le32_to_cpu(dsb->magic) != EROFS_SUPER_MAGIC_V1) { errln("cannot find valid erofs superblock"); goto out; } - blkszbits = layout->blkszbits; + blkszbits = dsb->blkszbits; /* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */ if (blkszbits != LOG_BLOCK_SIZE) { errln("blksize %u isn't supported on this platform", @@ -95,25 +95,25 @@ static int superblock_read(struct super_block *sb) goto out; } - if (!check_layout_compatibility(sb, layout)) + if (!check_layout_compatibility(sb, dsb)) goto out; - sbi->blocks = le32_to_cpu(layout->blocks); - sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr); + sbi->blocks = le32_to_cpu(dsb->blocks); + sbi->meta_blkaddr = le32_to_cpu(dsb->meta_blkaddr); #ifdef CONFIG_EROFS_FS_XATTR - sbi->xattr_blkaddr = le32_to_cpu(layout->xattr_blkaddr); + sbi->xattr_blkaddr = le32_to_cpu(dsb->xattr_blkaddr); #endif sbi->islotbits = ffs(sizeof(struct erofs_inode_v1)) - 1; - sbi->root_nid = le16_to_cpu(layout->root_nid); - sbi->inos = le64_to_cpu(layout->inos); + sbi->root_nid = le16_to_cpu(dsb->root_nid); + sbi->inos = le64_to_cpu(dsb->inos); - sbi->build_time = le64_to_cpu(layout->build_time); - sbi->build_time_nsec = le32_to_cpu(layout->build_time_nsec); + sbi->build_time = le64_to_cpu(dsb->build_time); + sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec); - memcpy(&sb->s_uuid, layout->uuid, sizeof(layout->uuid)); + memcpy(&sb->s_uuid, dsb->uuid, sizeof(dsb->uuid)); - ret = strscpy(sbi->volume_name, layout->volume_name, - sizeof(layout->volume_name)); + ret = strscpy(sbi->volume_name, dsb->volume_name, + sizeof(dsb->volume_name)); if (ret < 0) { /* -E2BIG */ errln("bad volume name without NIL terminator"); ret = -EFSCORRUPTED; -- 2.17.1