Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5689379pxb; Thu, 20 Jan 2022 02:31:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZo9ZvtahvUqf71OdblZB1FEH8FKsoh0cMMGqfhVrCN18tXJGmhRCNYTQpOidZGg/aJypk X-Received: by 2002:a17:90b:3510:: with SMTP id ls16mr9772467pjb.229.1642674714355; Thu, 20 Jan 2022 02:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642674714; cv=none; d=google.com; s=arc-20160816; b=z0mS2A/929/9NONBQebMXLs7ctpn2TcZxwfXR982Qy3eR4OAGPYFbCxmImGWEcTNqI 90ygfqO3LMiik1etYoScgt6VjohUyqeTjZBTTtA3+pwiEj2JDWcEhi7xZN0x4qWnnhOg ECGH+9VFhg/hfpOIrLbPQO8/iukhR2qFJGObTzs2yJhQ3YPkWYI69RfscJOjZzfjqsxJ vMky6m5gwM8wtjz62Jo4Dqo4Xc3c7hlEfzhIaPovI8EQ8Ziv5CFKP69UMp2llP/P7JHO u/Ph9fL7o1pT2d2Td20z3CRlCF9EyWNfl42DU51cFQtXb6ObmcxkoE+ta46IjM468zem 3ZLQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6t/66DyqhRU/ByYi2nQG6VQc31dfUWM6c5FKExLuNgg=; b=ftJRIAdfXkHcDdMeBMbe8JUrQ1WC+4TdIrvfl0qVu+HKR7TYFu2AbfWXIjLgVA5MDP AcRbbMKE1WNbB2oO/obtk8UXJ9RSqQQdFn2kh8Xf+M1AfRpGpxYe0MtDteWSXtY9IY4j zo2gatJ0yUbXZ5fNDRLcmXmZdSOriRtob4IWd5cr+BXsBO6PO8JVa6enIvskNARli6He mEROddk/vOSHb9kMALPKjoQPWNRZTiG0iD3NznCayamtfKG4x12wzab808Ie0srSTY45 eQ8kOIcvzy2CXgJdZEGSrwm4cSe4CJ+LuHUZYS+AFfZcAERyZar1ZOdqqOmWKqXVQowL taEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rj13si9202195pjb.33.2022.01.20.02.31.42; Thu, 20 Jan 2022 02:31:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242050AbiARNNb (ORCPT + 99 others); Tue, 18 Jan 2022 08:13:31 -0500 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:40432 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242102AbiARNM3 (ORCPT ); Tue, 18 Jan 2022 08:12:29 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R991e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0V2CR7xp_1642511544; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V2CR7xp_1642511544) by smtp.aliyun-inc.com(127.0.0.1); Tue, 18 Jan 2022 21:12:25 +0800 From: Jeffle Xu To: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/20] erofs: use meta buffers for erofs_read_superblock() Date: Tue, 18 Jan 2022 21:12:03 +0800 Message-Id: <20220118131216.85338-8-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220118131216.85338-1-jefflexu@linux.alibaba.com> References: <20220118131216.85338-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only change is that, meta buffers read cache page without __GFP_FS flag, which shall not matter. Signed-off-by: Jeffle Xu --- fs/erofs/super.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 915eefe0d7e2..12755217631f 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -281,21 +281,19 @@ static int erofs_init_devices(struct super_block *sb, static int erofs_read_superblock(struct super_block *sb) { struct erofs_sb_info *sbi; - struct page *page; + struct erofs_buf buf = __EROFS_BUF_INITIALIZER; struct erofs_super_block *dsb; unsigned int blkszbits; void *data; int ret; - page = read_mapping_page(sb->s_bdev->bd_inode->i_mapping, 0, NULL); - if (IS_ERR(page)) { + data = erofs_read_metabuf(&buf, sb, 0, EROFS_KMAP); + if (IS_ERR(data)) { erofs_err(sb, "cannot read erofs superblock"); - return PTR_ERR(page); + return PTR_ERR(data); } sbi = EROFS_SB(sb); - - data = kmap(page); dsb = (struct erofs_super_block *)(data + EROFS_SUPER_OFFSET); ret = -EINVAL; @@ -365,8 +363,7 @@ static int erofs_read_superblock(struct super_block *sb) if (erofs_sb_has_ztailpacking(sbi)) erofs_info(sb, "EXPERIMENTAL compressed inline data feature in use. Use at your own risk!"); out: - kunmap(page); - put_page(page); + erofs_put_metabuf(&buf); return ret; } -- 2.27.0