Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp848460rwd; Tue, 13 Jun 2023 00:52:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RNEoSBJRFT+o/em/UdFiIRbUsYTQtpTPCgFnbAa3NtbgtFtDreh89o9gDgZIExGXT4Eji X-Received: by 2002:a05:620a:20d8:b0:75b:23a1:8316 with SMTP id f24-20020a05620a20d800b0075b23a18316mr10735867qka.17.1686642745852; Tue, 13 Jun 2023 00:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686642745; cv=none; d=google.com; s=arc-20160816; b=eoe2CQ/TFPJnw97jWHib8gw6kx9eh4jP8ONZN3Y1fzElJynZxSkyFVTSt9QLXjEku6 bfn2vcE6MRfWCrKCrCrRTxKaxAxQ2fXOyxCjrpr452pXG2SlWIIWm5cglDcfmp16IJ+s X9zqWqOuIxUN2FatsvqIKaPNRZqzJaBzc3ZiEhl3cR6l02Z83JGO5LXfU3SfeHx/krZO q1FZWrJP/eeYTF+3EUZqAk7vF50r4z0P4heyiWnuaTYwwR0Be6iLzGTGGLFqG6rze3k5 AWKRBO1nbK5zu4gYAnAwMZJNx79Ncs4zPGi9NlRCniJWXR7HGVYTNXmGqFw4U4aiHtZS +ERQ== 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=CydnOCQtvikrLK0cSaSwWClnJiJgqqp0kX3guYdhPpccHnKVnY8AMoWxxXoSblGrha OHrwVUWUefUibXwGbAekDpUX7dTwIB4GqpatIJJwuO5q8P7ByQKp3nee6cb3J7stWpiO oAIph7ywF96SDFUIN/Q071l+5toe9DldhRNeXm5b0vb4LVq/91AZBZq63wQXOUWNoZz1 hz0OlweeLL1eoIOS1NXzDuNT3sg3dv7wI8m7BdczaHKvLHGpbkECHvh46qtQpHlmhlOS WOtN9BOg1YjiMVZArx1IO210p1vFoc+f+DRLV1TKwe03i8Co8pFCS7QpDpBAPAcaCq31 nR5g== 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 24-20020a631258000000b0050726756edesi5291341pgs.76.2023.06.13.00.52.13; Tue, 13 Jun 2023 00:52:25 -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 S239128AbjFMHl1 (ORCPT + 99 others); Tue, 13 Jun 2023 03:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235289AbjFMHlW (ORCPT ); Tue, 13 Jun 2023 03:41:22 -0400 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66D0AAA for ; Tue, 13 Jun 2023 00:41:21 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;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_---0Vl18Ncv_1686642077; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Vl18Ncv_1686642077) by smtp.aliyun-inc.com; Tue, 13 Jun 2023 15:41:18 +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 v8 3/5] erofs: make the size of read data stored in buffer_ofs Date: Tue, 13 Jun 2023 15:41:12 +0800 Message-Id: <20230613074114.120115-4-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230613074114.120115-1-jefflexu@linux.alibaba.com> References: <20230613074114.120115-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