mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-10 04:30:10 +00:00
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>
20 lines
498 B
C
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
|