Add a file for userspace quorum config helpers

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2021-09-27 14:34:12 -07:00
parent a0690070ae
commit 024426df28
2 changed files with 18 additions and 0 deletions

10
utils/src/quorum.c Normal file
View File

@@ -0,0 +1,10 @@
#include "sparse.h"
#include "util.h"
#include "format.h"
#include "quorum.h"
bool quorum_slot_present(struct scoutfs_super_block *super, int i)
{
return super->qconf.slots[i].addr.v4.family == cpu_to_le16(SCOUTFS_AF_IPV4);
}

8
utils/src/quorum.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef _QUORUM_H_
#define _QUORUM_H_
#include <stdbool.h>
bool quorum_slot_present(struct scoutfs_super_block *super, int i);
#endif