Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5497710rwd; Mon, 12 Jun 2023 06:06:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5TLh7RcGZGn0asPvpbiydSP4W9wF7mhNYvQFyofiWZ+yYzUS++EtmMx92Rtgu7iaoXalt+ X-Received: by 2002:a2e:7d07:0:b0:2a7:a59c:8ad0 with SMTP id y7-20020a2e7d07000000b002a7a59c8ad0mr2968000ljc.2.1686575186490; Mon, 12 Jun 2023 06:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686575186; cv=none; d=google.com; s=arc-20160816; b=Z1IbnR893739KQ/ueLMMJVykWx8sOjMqUbpZ9Vt1LeLNv1Ca01gtezrEVuC66oPRiA x0yXRl/jAdZbCAiGNmFAekUTt+tJCqXF2cBB5zgk91SypcazdgYU4GNrp0UhgYZ2e+i4 SMD965WCsJwaDZ2jqGffCbkEUyae7+tCFtgG/uTM++M8x2uayR3JGtlpR3009mK2epDH qQ7Se75HvcIpqBPhNoxegUHj99SrymB2Rs5CbU0GPzmq5thHXOBvrls9TNezdALAAfR/ c7d4PRmexJUyMdnOsi2iqE8rD3ShJRI3I8TYQk45JPdetNGPnFksTmN+AMphs5X2McVL zJ1Q== 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=5CH4qmGTEswLKkIHRBvy3oA0lCQL8ln1Im8LoIxDWfc=; b=IdO2AqZHvKoqF1gsyDMRp4+mK3P6ggXSd5ZjN3tlOGLqrVBEnSlkMefPltv+4/5Up1 ODCVPz2aj0vQtp4IKWXpcrSAnjojltPnNg0UjsC9CBsPqtuIP2bbZwoZ/5/4I0+a2kAX 2dPMNuUtEuShOHvw3RpRHxhYpg/Iix3cl8oBV0VQp4Jrd1LXYqp7gHn8hRwOqdR8edB3 7aypXvVrK0W67jOs/BBoKCC/y7YfKMXskrRmXhTa9zn5NQrvLA3/5x+g/hwA/xoa8kBW WPBdtz5BLSq7r9fr3f5l6JiaBROHt+5tOY5/EoxoUswFSrIyb6x48vDdCTsj+yxVpA1F nqSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x21-20020aa7d6d5000000b0051497c93ab9si1899989edr.530.2023.06.12.06.05.51; Mon, 12 Jun 2023 06:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234767AbjFLMiE (ORCPT + 99 others); Mon, 12 Jun 2023 08:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234377AbjFLMhy (ORCPT ); Mon, 12 Jun 2023 08:37:54 -0400 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13DDDE47 for ; Mon, 12 Jun 2023 05:37:52 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VkzU.DN_1686573469; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VkzU.DN_1686573469) by smtp.aliyun-inc.com; Mon, 12 Jun 2023 20:37:50 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v7 3/5] erofs: make the size of read data stored in buffer_ofs Date: Mon, 12 Jun 2023 20:37:43 +0800 Message-Id: <20230612123745.36323-4-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230612123745.36323-1-jefflexu@linux.alibaba.com> References: <20230612123745.36323-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since now xattr_iter structures have been unified, make the size of the read data stored in buffer_ofs. Don't bother reusing buffer_size for this use, which may be confusing. This is in preparation for the following further cleanup. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang --- fs/erofs/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index b2802121e3aa..8a114c7b6c66 100644 --- a/fs/erofs/xattr.c +++ b/fs/erofs/xattr.c @@ -315,7 +315,7 @@ static int xattr_checkbuffer(struct erofs_xattr_iter *it, { int err = it->buffer_size < value_sz ? -ERANGE : 0; - it->buffer_size = value_sz; + it->buffer_ofs = value_sz; return !it->buffer ? 1 : err; } @@ -348,7 +348,7 @@ static int inline_getxattr(struct inode *inode, struct erofs_xattr_iter *it) if (ret != -ENOATTR) break; } - return ret ? ret : it->buffer_size; + return ret ? ret : it->buffer_ofs; } static int shared_getxattr(struct inode *inode, struct erofs_xattr_iter *it) @@ -371,7 +371,7 @@ static int shared_getxattr(struct inode *inode, struct erofs_xattr_iter *it) if (ret != -ENOATTR) break; } - return ret ? ret : it->buffer_size; + return ret ? ret : it->buffer_ofs; } static bool erofs_xattr_user_list(struct dentry *dentry) -- 2.19.1.6.gb485710b