From: Li Chen <me@linux.beauty>
To: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
Dongsheng Yang <dongsheng.yang@linux.dev>,
Zheng Gu <cengku@gmail.com>
Subject: [PATCH 2/3] dm-pcache: reuse meta_addr in pcache_meta_find_latest
Date: Thu, 30 Oct 2025 20:33:20 +0800 [thread overview]
Message-ID: <20251030123323.967081-3-me@linux.beauty> (raw)
In-Reply-To: <20251030123323.967081-1-me@linux.beauty>
From: Li Chen <chenl311@chinatelecom.cn>
pcache_meta_find_latest() already computes the metadata address as
meta_addr. Reuse that instead of recomputing.
Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
---
drivers/md/dm-pcache/pcache_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-pcache/pcache_internal.h b/drivers/md/dm-pcache/pcache_internal.h
index d427e534727ce..b7a3319d2bd3e 100644
--- a/drivers/md/dm-pcache/pcache_internal.h
+++ b/drivers/md/dm-pcache/pcache_internal.h
@@ -99,7 +99,7 @@ static inline void __must_check *pcache_meta_find_latest(struct pcache_meta_head
/* Update latest if a more recent sequence is found */
if (!latest || pcache_meta_seq_after(meta->seq, seq_latest)) {
seq_latest = meta->seq;
- latest = (void *)header + (i * meta_max_size);
+ latest = meta_addr;
}
}
--
2.51.0
next prev parent reply other threads:[~2025-10-30 12:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 12:33 [PATCH 0/3] dm-pcache: built-in support and metadata hardening Li Chen
2025-10-30 12:33 ` [PATCH 1/3] dm-pcache: allow built-in build and rename flush helper Li Chen
2025-10-30 12:33 ` Li Chen [this message]
2025-10-30 12:33 ` [PATCH 3/3] dm-pcache: avoid leaking invalid metadata in pcache_meta_find_latest() Li Chen
[not found] ` <CADSj-VoQerDc2UUfBOknRMGetSddMEqRKaC3VDniD+xCq0pH1g@mail.gmail.com>
2025-11-01 13:10 ` Li Chen
2025-11-04 6:46 ` Dongsheng Yang
2025-11-04 13:36 ` Li Chen
2025-11-05 1:16 ` Dongsheng Yang
2025-11-03 11:38 ` Jonathan Cameron
2025-11-04 12:19 ` Li Chen
2025-11-05 8:46 [PATCH 0/3] dm-pcache: built-in support and metadata hardening Li Chen
2025-11-05 8:46 ` [PATCH 2/3] dm-pcache: reuse meta_addr in pcache_meta_find_latest Li Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251030123323.967081-3-me@linux.beauty \
--to=me@linux.beauty \
--cc=cengku@gmail.com \
--cc=dm-devel@lists.linux.dev \
--cc=dongsheng.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®