aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2024-01-26 21:35:48 -0500
committerMike Snitzer <snitzer@kernel.org>2024-02-20 13:43:17 -0500
commit3ccf136a4925c852197dd5fb5f7ee88514757e4e (patch)
treedf23281c6ad7428052a9ea716c098703fe63626f /drivers/md
parent36778716a2cf7003d7b45bfb9ed6e88f47511b35 (diff)
downloadlinux-3ccf136a4925c852197dd5fb5f7ee88514757e4e.tar.gz
dm vdo block-map: avoid extra dereferences to access vdo object
The vdo_page_cache's 'vdo' is the same as the block_map's vdo instance, so use that to save 2 extra dereferences. Signed-off-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Matthew Sakai <msakai@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/block-map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c
index eda42383a2c14..0ce136612869f 100644
--- a/drivers/md/dm-vdo/block-map.c
+++ b/drivers/md/dm-vdo/block-map.c
@@ -562,7 +562,7 @@ static void set_persistent_error(struct vdo_page_cache *cache, const char *conte
{
struct page_info *info;
/* If we're already read-only, there's no need to log. */
- struct vdo *vdo = cache->zone->block_map->vdo;
+ struct vdo *vdo = cache->vdo;
if ((result != VDO_READ_ONLY) && !vdo_is_read_only(vdo)) {
uds_log_error_strerror(result, "VDO Page Cache persistent error: %s",
@@ -1111,7 +1111,7 @@ static void write_pages(struct vdo_completion *flush_completion)
state_entry);
list_del_init(&info->state_entry);
- if (vdo_is_read_only(info->cache->zone->block_map->vdo)) {
+ if (vdo_is_read_only(info->cache->vdo)) {
struct vdo_completion *completion = &info->vio->completion;
vdo_reset_completion(completion);
@@ -1233,7 +1233,7 @@ void vdo_get_page(struct vdo_page_completion *page_completion,
cache->zone->thread_id, parent);
completion->requeue = requeue;
- if (page_completion->writable && vdo_is_read_only(cache->zone->block_map->vdo)) {
+ if (page_completion->writable && vdo_is_read_only(cache->vdo)) {
vdo_fail_completion(completion, VDO_READ_ONLY);
return;
}