summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>2024-05-24 15:41:09 +0800
committerMikulas Patocka <mpatocka@redhat.com>2024-07-10 13:10:06 +0200
commit7017ded001076593e03540840a5f5b80209bab67 (patch)
tree35cebeeb81588d55ed4ad3d665b5847fcd50f5d8 /drivers/md
parentb956d1a30f77bdeb7b7931bad0cee5fa8db25cbc (diff)
dm vdo indexer: use swap() instead of open coding it
Use existing swap() macro rather than duplicating its implementation. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9173 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/indexer/index.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/md/dm-vdo/indexer/index.c b/drivers/md/dm-vdo/indexer/index.c
index 1ba767144426..df4934846244 100644
--- a/drivers/md/dm-vdo/indexer/index.c
+++ b/drivers/md/dm-vdo/indexer/index.c
@@ -197,15 +197,12 @@ static int finish_previous_chapter(struct uds_index *index, u64 current_chapter_
static int swap_open_chapter(struct index_zone *zone)
{
int result;
- struct open_chapter_zone *temporary_chapter;
result = finish_previous_chapter(zone->index, zone->newest_virtual_chapter);
if (result != UDS_SUCCESS)
return result;
- temporary_chapter = zone->open_chapter;
- zone->open_chapter = zone->writing_chapter;
- zone->writing_chapter = temporary_chapter;
+ swap(zone->open_chapter, zone->writing_chapter);
return UDS_SUCCESS;
}