Skip to content

Commit 7017ded

Browse files
wb-zjp846396Mikulas Patocka
authored andcommitted
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>
1 parent b956d1a commit 7017ded

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/md/dm-vdo/indexer/index.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,12 @@ static int finish_previous_chapter(struct uds_index *index, u64 current_chapter_
197197
static int swap_open_chapter(struct index_zone *zone)
198198
{
199199
int result;
200-
struct open_chapter_zone *temporary_chapter;
201200

202201
result = finish_previous_chapter(zone->index, zone->newest_virtual_chapter);
203202
if (result != UDS_SUCCESS)
204203
return result;
205204

206-
temporary_chapter = zone->open_chapter;
207-
zone->open_chapter = zone->writing_chapter;
208-
zone->writing_chapter = temporary_chapter;
205+
swap(zone->open_chapter, zone->writing_chapter);
209206
return UDS_SUCCESS;
210207
}
211208

0 commit comments

Comments
 (0)