From: Li Chen <[email protected]>

pcache_meta_find_latest() already computes the metadata address as
meta_addr. Reuse that instead of recomputing.

Signed-off-by: Li Chen <[email protected]>
---
 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 d427e534727c..b7a3319d2bd3 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


Reply via email to