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 <zab@versity.com>
This commit is contained in:
Zach Brown
2021-08-24 09:11:40 -07:00
parent 823838cf01
commit 70569b0448
+1 -2
View File
@@ -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);
}