From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A96C9C77B7D for ; Thu, 18 May 2023 02:46:16 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4QMDr71qDtz3fDX for ; Thu, 18 May 2023 12:46:15 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.97; helo=out30-97.freemail.mail.aliyun.com; envelope-from=jefflexu@linux.alibaba.com; receiver=) Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4QMDqr1B0Qz3f6G for ; Thu, 18 May 2023 12:45:59 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R401e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Viut.Cy_1684377955; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Viut.Cy_1684377955) by smtp.aliyun-inc.com; Thu, 18 May 2023 10:45:55 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org Subject: [PATCH v3 3/5] erofs: make the size of read data stored in buffer_ofs Date: Thu, 18 May 2023 10:45:49 +0800 Message-Id: <20230518024551.123990-4-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230518024551.123990-1-jefflexu@linux.alibaba.com> References: <20230518024551.123990-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" 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 1e44aa108134..87d76ccea692 100644 --- a/fs/erofs/xattr.c +++ b/fs/erofs/xattr.c @@ -338,7 +338,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; } @@ -371,7 +371,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) @@ -393,7 +393,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