Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp129762rdh; Wed, 25 Oct 2023 19:16:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt68C/Mj8cxQi6EO57KAUe9xIHtOHKU77ZlKS6cOeNe3I+XTIQS+P3iAz6wXasd+i/OfF6 X-Received: by 2002:a0d:d810:0:b0:5a7:cfdc:d7b1 with SMTP id a16-20020a0dd810000000b005a7cfdcd7b1mr19024130ywe.4.1698286608547; Wed, 25 Oct 2023 19:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698286608; cv=none; d=google.com; s=arc-20160816; b=RslxX29SgGVX45p5bR3CBGRDqVSeqOu8F6ajIIgR3AkmCpwtGM5RDQuFuUk+n4ayKn gaNQuSjwQrx3aXJgwqtyQ2AcN54NoHHXQDZIYO4G+H+HdQg0CgR/hGU2PYf7uDZwdbSc e87ynz6jckutba4bQEqSVAT7zJKCLaBdr1Ee+blxTeBIGuSgCbeYAd4yKUeNXhObkmGI 8cHcvr4TXUuH1A47JbDFDGJUErs9nuHOePKg/XTmUHdOLvIdbZ3Lo0VQD1l0peu2E1ZF dGGLymakQ6GgtvzZmT0TLgpa7OpCEVEcGHDWqunEt/zrQPnzLzBWwQLS6YuAugBsBZCc hF7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ZtAIKpy4miLbdE8gy8txYOSm+vJq7ZdB6KKoQ+Tu9nE=; fh=HccedMhTcgJEpddp7zhnrxHwiSZ6Rr6gaM0rzJCqVjU=; b=ndYjk+YPxwXrangsg6qfKR2BaUU/2JGutkA0VJbmAHWTVk//mygAuj2nsvrMjBXrFq +Dp1SJ5j/3mm67GWQEZQvsfXAX31ffQ2DaQ5GuxKBSit36BMl1PKX8NgxOL+C+la+uEb 3r3RfhZKtiFxRTCof+INjewTKa20HBx0m3vsW3tzPdjAEpF/BnGP6wntiem4aOTA+AYt aTHpN+LqG1RIqN03dSc5ItDzPE3wkzBvbePO5RdNh06utfKtr1JAoxpcleLUYMP3+djP nrKOI64oWJiYB68rP4cqAnRs9IPELh3MCfWlodhuk1xv1PnxL4seit+lZsYLWOFGFpSZ uW4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f184-20020a0dc3c1000000b005a83af25d58si13683492ywd.359.2023.10.25.19.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 19:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3E17C820D5EB; Wed, 25 Oct 2023 19:16:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233257AbjJZCQk (ORCPT + 99 others); Wed, 25 Oct 2023 22:16:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233152AbjJZCQj (ORCPT ); Wed, 25 Oct 2023 22:16:39 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D4C712F for ; Wed, 25 Oct 2023 19:16:36 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=mengferry@linux.alibaba.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---0VuvzTZ6_1698286588; Received: from localhost(mailfrom:mengferry@linux.alibaba.com fp:SMTPD_---0VuvzTZ6_1698286588) by smtp.aliyun-inc.com; Thu, 26 Oct 2023 10:16:33 +0800 From: Ferry Meng To: linux-erofs@lists.ozlabs.org Cc: LKML , Ferry Meng Subject: [PATCH 1/2] erofs: get rid of ROOT_NID() Date: Thu, 26 Oct 2023 10:16:26 +0800 Message-Id: <20231026021627.23284-1-mengferry@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 19:16:46 -0700 (PDT) Let's open code this helper for simplicity. Signed-off-by: Ferry Meng --- fs/erofs/internal.h | 2 -- fs/erofs/super.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 4ff88d0dd980..ca7d85958450 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -228,8 +228,6 @@ struct erofs_buf { }; #define __EROFS_BUF_INITIALIZER ((struct erofs_buf){ .page = NULL }) -#define ROOT_NID(sb) ((sb)->root_nid) - #define erofs_blknr(sb, addr) ((addr) >> (sb)->s_blocksize_bits) #define erofs_blkoff(sb, addr) ((addr) & ((sb)->s_blocksize - 1)) #define erofs_pos(sb, blk) ((erofs_off_t)(blk) << (sb)->s_blocksize_bits) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 3700af9ee173..019229eb2ef6 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -724,13 +724,13 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) xa_init(&sbi->managed_pslots); #endif - inode = erofs_iget(sb, ROOT_NID(sbi)); + inode = erofs_iget(sb, sbi->root_nid); if (IS_ERR(inode)) return PTR_ERR(inode); if (!S_ISDIR(inode->i_mode)) { erofs_err(sb, "rootino(nid %llu) is not a directory(i_mode %o)", - ROOT_NID(sbi), inode->i_mode); + sbi->root_nid, inode->i_mode); iput(inode); return -EINVAL; } @@ -760,7 +760,7 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) if (err) return err; - erofs_info(sb, "mounted with root inode @ nid %llu.", ROOT_NID(sbi)); + erofs_info(sb, "mounted with root inode @ nid %llu.", sbi->root_nid); return 0; } -- 2.19.1.6.gb485710b