From 70569b04483539d9f0b69d56d15beaa25743ed02 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 4 Aug 2021 11:15:36 -0700 Subject: [PATCH] Trivial quorum test;set -> test_and_set Nothing interesting here, just a minor convenience to use test and set instead of testing and then setting. Signed-off-by: Zach Brown --- kmod/src/quorum.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kmod/src/quorum.c b/kmod/src/quorum.c index 57165bbe..3d037202 100644 --- a/kmod/src/quorum.c +++ b/kmod/src/quorum.c @@ -697,11 +697,10 @@ static void scoutfs_quorum_worker(struct work_struct *work) /* candidates count votes in their term */ if (qst.role == CANDIDATE && msg.type == SCOUTFS_QUORUM_MSG_VOTE) { - if (test_bit(msg.from, &qst.vote_bits)) { + if (test_and_set_bit(msg.from, &qst.vote_bits)) { scoutfs_warn(sb, "already received vote from %u in term %llu, are there multiple mounts with quorum_slot_nr=%u?", msg.from, qst.term, msg.from); } - set_bit(msg.from, &qst.vote_bits); scoutfs_inc_counter(sb, quorum_recv_vote); }