From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.111 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793872187; b=QVIopjebJz+QqbGmtZxJxwSvdnBiqP+RYsi+wArsBGHul2wQmuEc776TuNjtSIwNL4TD UOsslH7IZ8w4OcBFsRiky6MY+kNsO7lF8jDbqcNiRIuvmozZqcS6sP09NtMOZn61l1mOK 7GzyLDrWfs5HwKPOK5qYSD3xTipR1aZSXEaOkGOmwBLopN/5NNKKl2irg6A2crsmfPwHb 4XvRrfDK7fA2lYaCuc+I2cSJwCWJqTo6auecyTHlg9EMnwcLnzvUeyWdbh5G0pjqfB1Mb ejbvhBCEPZoE4mGTqTRU5lInzzh48xqLyMQKuHI/8fnKtya9Ql6AUlyypwIwwLDIjFA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793872187; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=vVWDe/gofAAgbjP4k8uYhsTh1XR2zdl1WA9yNr6YGcA=; b=w1TPL5oRaK6+eKbQkqS5kB9wS9J0zeZHSys2XZp3PhnjZyoOU4n60sz9IlbMUDXoAZ8u fuwmDUi8dYEk7iIQ2Z1eKgV7FfLZIZXiiqHZuBqnLryi53xFaYU+KATiK1Fklv7+/AI4X GZdKlEwItCKQJjyeyM7w4VIHN2Dv7J6M3QvY3I32riC4pUZ8rgc7VRxtXLol3Sws0Q8mA owiXqCe+9vJ26gQOWeWbgQDNePMBH8g1EV7LYNlwXFdFU45qX9Sa2b1N7wkYj92rdx1Sq Hv6IaEXhKVC9Mj6+gbZOQQ6B7HzuQ0Iqk3vC5IhlT1pbljY82v5did5f2K03YKY96bA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=PeKjslMw; arc=none smtp.remote-ip=115.124.30.111 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99A6B608360B for ; Thu, 5 Nov 2026 09:49:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 99A6B608360B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=PeKjslMw DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1793872184; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=vVWDe/gofAAgbjP4k8uYhsTh1XR2zdl1WA9yNr6YGcA=; b=PeKjslMwRoZ/uVJBSI2/KGEwPmH7T//1wRfno++CAZPrRcr2BcP/uVopVv/Q3ZlzLfps23Qmf0AsxbPlqPPkrGAU89p4m9EPNVlBLtDPIbMgeuI3TJq8xWb4sORhZr7FcC1n6GLvn+H89bPNFL81b7zxHcxPqTa3T5LPgbwZeyY= 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=maildocker-contentspam033037026112;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0XE8RZcu_1793872183; Received: from localhost(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0XE8RZcu_1793872183 cluster:ay36) by smtp.aliyun-inc.com; Thu, 05 Nov 2026 17:49:43 +0800 From: Joseph Qi To: Andrew Morton , Heming Zhao Cc: Mark Fasheh , Joel Becker , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, Joseph Qi Subject: [PATCH 17/30] ocfs2: abstract the dinode refcount location check Date: Thu, 5 Nov 2026 17:49:13 +0800 Message-Id: <20261105094926.3203416-18-joseph.qi@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20261105094926.3203416-1-joseph.qi@linux.alibaba.com> References: <20261105094926.3203416-1-joseph.qi@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fold the OCFS2_HAS_REFCOUNT_FL without i_refcount_loc test into a predicate. The flag test stays inside it, since i_refcount_loc is only meaningful for a reflink-capable inode. No functional change intended. Signed-off-by: Joseph Qi --- fs/ocfs2/inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 7f3995ca771b..b4ef4077e09c 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -244,6 +244,12 @@ static bool ocfs2_dinode_has_bad_chain_bpc(struct super_block *sb, le16_to_cpu(di->id2.i_chain.cl_bpc) != bpc; } +static bool ocfs2_dinode_has_refcount_without_loc(struct ocfs2_dinode *di) +{ + return (le16_to_cpu(di->i_dyn_features) & OCFS2_HAS_REFCOUNT_FL) && + !di->i_refcount_loc; +} + void ocfs2_set_inode_flags(struct inode *inode) { unsigned int flags = OCFS2_I(inode)->ip_attr; @@ -1880,8 +1886,7 @@ int ocfs2_validate_inode_block(struct super_block *sb, } } - if ((le16_to_cpu(di->i_dyn_features) & OCFS2_HAS_REFCOUNT_FL) && - !di->i_refcount_loc) { + if (ocfs2_dinode_has_refcount_without_loc(di)) { rc = ocfs2_error(sb, "Inode #%llu has refcount flag but no i_refcount_loc\n", (unsigned long long)bh->b_blocknr); goto bail; -- 2.39.3