]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dm vdo indexer: use swap() instead of open coding it
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Fri, 24 May 2024 07:41:09 +0000 (15:41 +0800)
committerMikulas Patocka <mpatocka@redhat.com>
Wed, 10 Jul 2024 11:10:06 +0000 (13:10 +0200)
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>
drivers/md/dm-vdo/indexer/index.c

index 1ba767144426f5cb6f570d6311d2eb206b69058e..df49348462441a0f6d7e3f6b5fabb885df9be32f 100644 (file)
@@ -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;
 }