Files
scoutfs/kmod/src/quorum.h
Zach Brown c34dd452a7 scoutfs: add quorum voting
Add a quorum election implementation.  The mounts that can participate
in the election are specified in a quorum config array in the super
block.  Each configured participant is assigned a preallocated block
that it can write to.

All mounts read the quorum blocks to find the member who was elected the
leader and should be running the server.  The voting mounts loop reading
voting blocks and writing their vote block until someone is elected with
a amjority.

Nothing calls this code yet, this adds the initial implementation and
format.

Signed-off-by: Zach Brown <zab@versity.com>
2019-04-12 10:54:07 -07:00

20 lines
498 B
C

#ifndef _SCOUTFS_QUORUM_H_
#define _SCOUTFS_QUORUM_H_
struct scoutfs_quorum_elected_info {
struct sockaddr_in sin;
__le64 config_gen;
__le64 write_nr;
u64 elected_nr;
unsigned int config_slot;
bool run_server;
};
int scoutfs_quorum_election(struct super_block *sb, char *our_name,
u64 old_elected_nr, ktime_t timeout_abs,
struct scoutfs_quorum_elected_info *qei);
int scoutfs_quorum_clear_elected(struct super_block *sb,
struct scoutfs_quorum_elected_info *qei);
#endif