Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp301448rwd; Tue, 30 May 2023 21:00:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eAM2Zixu26C1t9gslIcoOSffVKhimXpPEZNyp1pDLvsizCZO57SbcnB3o/+UBWNT7Fw/C X-Received: by 2002:a05:6358:9989:b0:123:ab5:5654 with SMTP id j9-20020a056358998900b001230ab55654mr144161rwb.20.1685505635746; Tue, 30 May 2023 21:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685505635; cv=none; d=google.com; s=arc-20160816; b=mcBTQYO3w/P84mN185pesG1BrhU0BKUiuzvmIHo1G/Bykj/y+YBoCB/NmGbOtdwrHf 7F0Jh/rzaLetWrbOtOL7KCUFSjhv8VhKiLfNCyePn9g8Hh2OsTzDpMfH4xz0lkn9xmoy nUGyTYDq0tEhTOWLq0o0JmvczgljfPGncAF8PrazxdohAILnrQNOilOfbV5lnvKf88d9 5yBkHcFt0VYVoBfxPVusbwrs+P+pNtpy1KJf+x6ToqpULNAwPHvLrvzrfYPNkMjqbXVP MAXPTuDlutxlFZ7Ae4CZVOoTq25S+iJCS8QrE8j4eMBAsqzMI83sx3xahzDSEeRYkBCq tIsg== 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=br6WVvwoj1l9QAKUGiYK2zoip0yvTqE4/MZgu2FxzVc=; b=RXn1UyuUUhhuXQTdC4HGGREvYRpD/D/Oye4T2vGdh4K9vk4cPBoy7KyvAn1G8lNhVz lLPQdevCSGSo2dtU7DHRKSXm9zx/NZyYSjw3N3K1keabPhDDejtX2/YdrVAI7M9/2uSM uaTwdh+Gpm5+OGCALydPNLt3WsR0ZUKjN9yxf75YUeTOQpeHfyILyCxRDGr0gARdt4gl +1EdfY6ptixRpZHFK3wfX5w+GrBzxRwzf/wd6rdawltsprJtz0ubuaudveNytpP7Hzl0 7s6BXqT+4r/+ZVFLTogL9VQwvka7GcPubelvCTNRAPVgHS8L5qCg36Mi44R3TH1v+H4o IocA== 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 t189-20020a6381c6000000b0052c6e736ad1si304923pgd.61.2023.05.30.21.00.23; Tue, 30 May 2023 21:00:35 -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 S234089AbjEaDNn (ORCPT + 99 others); Tue, 30 May 2023 23:13:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234059AbjEaDNi (ORCPT ); Tue, 30 May 2023 23:13:38 -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 7249811F for ; Tue, 30 May 2023 20:13:37 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Vjvop.y_1685502814; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Vjvop.y_1685502814) by smtp.aliyun-inc.com; Wed, 31 May 2023 11:13:34 +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 v4 3/5] erofs: make the size of read data stored in buffer_ofs Date: Wed, 31 May 2023 11:13:28 +0800 Message-Id: <20230531031330.3504-4-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230531031330.3504-1-jefflexu@linux.alibaba.com> References: <20230531031330.3504-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 dffca38a46fd..7c76b4d31920 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