Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp98382rwd; Wed, 31 May 2023 19:46:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6t8uZyFyT32rE03RCTxsTwvK8zDXbiTM7UlapL5lyUrG6ewqyj2sYvQo4PKlJnHP9kdacg X-Received: by 2002:a05:6214:c4a:b0:623:9218:58e5 with SMTP id r10-20020a0562140c4a00b00623921858e5mr10438318qvj.39.1685587590073; Wed, 31 May 2023 19:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685587590; cv=none; d=google.com; s=arc-20160816; b=rOvjwDKHL1NPrCaSY52rFNiU8E/CmkCgt9GzGdIlNTfzyzH+rmU5o6MahZaK6xOuD9 VO5pw/MLADKFFd9sqwR8xfEDj8vxsA/fnUmPldHzkQ0pswlSvTBTensKJKanA/RnQy02 F4+svGgJpx+ivGVp2C8gf8lqvPx4H4A9QCSKVAZqAgXQtgxEz1Iu+vT503uEpeKgXNsQ NNmJJecGMlrpPtj08Zk9XDGdw8rD3ATtQ9YFHmaKnpCg2mRuSlhSys/NCxwbwsd+CsCO 4HJIQwpcg/qOy+I/FhwrIT6KAV0s08Mw3VPOxAe5MG0ljrVfpcF2wO+4t1hAmwyXACuG d3pA== 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=VFIDkTiWXRAEW+1a1v5TeaeYlAw1WQYflb+M2WVtqtk=; b=HDKyFBzeLDkYj5GhbMc7LhX+vgplxfTjIHV2Pskk4zRPIarcPahqHOgnLPskzlh4I0 /CiIPQ9CSOVMryIGE0EA/i9aN4+Qq9liTfcZnoRpm0qHhVo9n3e8xhsjIvoNSZCcHvwY rStdC8JfP4JVI6FbpecwAsdvFKhj3wjCq3qtu/7XZT2u92idQwiGcr5M4+spMNmRbJF8 jmizH1My2KYORL+dv84ZHjxvfZMuV3JdUhbkota4j806kzZsswbsVD+1JwfwUd6vGgkU lY0pWlzvR0cVjqwp6MIYKvb3OO2mc16L51bA5fUWlpVXeyyP2Q7USCl8TIf4rKBifLS+ y/ow== 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 a9-20020a1709027d8900b001ae5fb1436asi1932815plm.184.2023.05.31.19.46.18; Wed, 31 May 2023 19:46:30 -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 S231253AbjFACoJ (ORCPT + 99 others); Wed, 31 May 2023 22:44:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbjFACn5 (ORCPT ); Wed, 31 May 2023 22:43:57 -0400 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 641FC107 for ; Wed, 31 May 2023 19:43:56 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Vk-9KrE_1685587432; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Vk-9KrE_1685587432) by smtp.aliyun-inc.com; Thu, 01 Jun 2023 10:43:53 +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 v5 4/6] erofs: make the size of read data stored in buffer_ofs Date: Thu, 1 Jun 2023 10:43:45 +0800 Message-Id: <20230601024347.108469-5-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230601024347.108469-1-jefflexu@linux.alibaba.com> References: <20230601024347.108469-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 --- 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 a691d539ae4f..19f9bf67440c 100644 --- a/fs/erofs/xattr.c +++ b/fs/erofs/xattr.c @@ -337,7 +337,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; } @@ -370,7 +370,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) @@ -392,7 +392,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