]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/NVMeofGwMap.h: tabbing, line length, formatting
authorSamuel Just <sjust@redhat.com>
Sat, 13 Jul 2024 02:02:08 +0000 (02:02 +0000)
committerAlexander Indenbaum <aindenba@redhat.com>
Wed, 19 Nov 2025 18:41:52 +0000 (20:41 +0200)
- Adjust method signatures to better match mon/
- Adjust line length to 80 characthers

Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 58d16c73845a5dc208657ee2512cb885e48ee5b8)

src/mon/NVMeofGwMap.h

index 2390176305b2e98a70e320f7e92bee117f3bd911..c128d7c9285646b61ae7509a58f219c5a5745041 100755 (executable)
@@ -32,62 +32,99 @@ class Monitor;
 class NVMeofGwMap
 {
 public:
-    Monitor*                            mon           = NULL;
-    epoch_t                             epoch         = 0;      // epoch is for Paxos synchronization  mechanizm
-    bool                                delay_propose = false;
-
-    std::map<NvmeGroupKey, NvmeGwMonStates>  created_gws;
-    std::map<NvmeGroupKey, NvmeGwTimers> fsm_timers;// map that handles timers started by all Gateway FSMs
-    void to_gmap(std::map<NvmeGroupKey, NvmeGwMonClientStates>& Gmap) const;
-
-    int   cfg_add_gw                    (const NvmeGwId &gw_id, const NvmeGroupKey& group_key);
-    int   cfg_delete_gw                 (const NvmeGwId &gw_id, const NvmeGroupKey& group_key);
-    void  process_gw_map_ka             (const NvmeGwId &gw_id, const NvmeGroupKey& group_key, epoch_t& last_osd_epoch,  bool &propose_pending);
-    int   process_gw_map_gw_down        (const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool &propose_pending);
-    void  update_active_timers          (bool &propose_pending);
-    void  handle_abandoned_ana_groups   (bool &propose_pending);
-    void  handle_removed_subsystems     (const NvmeGwId &gw_id, const NvmeGroupKey& group_key, const std::vector<NvmeNqnId> &current_subsystems, bool &propose_pending);
-    void  start_timer (const NvmeGwId &gw_id, const NvmeGroupKey& group_key, NvmeAnaGrpId anagrpid, uint8_t value);
-private:
-    void add_grp_id   (const NvmeGwId &gw_id, const NvmeGroupKey& group_key, const NvmeAnaGrpId grpid);
-    void remove_grp_id(const NvmeGwId &gw_id, const NvmeGroupKey& group_key, const NvmeAnaGrpId grpid);
-    void fsm_handle_gw_down    (const NvmeGwId &gw_id, const NvmeGroupKey& group_key,  gw_states_per_group_t state, NvmeAnaGrpId grpid,  bool &map_modified);
-    void fsm_handle_gw_delete  (const NvmeGwId &gw_id, const NvmeGroupKey& group_key,  gw_states_per_group_t state, NvmeAnaGrpId grpid,  bool &map_modified);
-    void fsm_handle_gw_alive   (const NvmeGwId &gw_id, const NvmeGroupKey& group_key,  NvmeGwMonState & gw_state, gw_states_per_group_t state,
-                                                                                   NvmeAnaGrpId grpid, epoch_t& last_osd_epoch, bool &map_modified);
-    void fsm_handle_to_expired (const NvmeGwId &gw_id, const NvmeGroupKey& group_key,  NvmeAnaGrpId grpid,  bool &map_modified);
+  Monitor *mon = NULL;
+
+  // epoch is for Paxos synchronization  mechanizm
+  epoch_t epoch = 0;
+  bool delay_propose = false;
+
+  std::map<NvmeGroupKey, NvmeGwMonStates>  created_gws;
+
+  // map that handles timers started by all Gateway FSMs
+  std::map<NvmeGroupKey, NvmeGwTimers> fsm_timers;
+
+  void to_gmap(std::map<NvmeGroupKey, NvmeGwMonClientStates>& Gmap) const;
 
-    void find_failover_candidate(const NvmeGwId &gw_id, const NvmeGroupKey& group_key,  NvmeAnaGrpId grpid, bool &propose_pending);
-    void find_failback_gw       (const NvmeGwId &gw_id, const NvmeGroupKey& group_key,  bool &propose_pending);
-    void set_failover_gw_for_ANA_group (const NvmeGwId &failed_gw_id, const NvmeGroupKey& group_key, const NvmeGwId &gw_id,
-                                                                                                     NvmeAnaGrpId groupid);
+  int cfg_add_gw(const NvmeGwId &gw_id, const NvmeGroupKey& group_key);
+  int cfg_delete_gw(const NvmeGwId &gw_id, const NvmeGroupKey& group_key);
+  void process_gw_map_ka(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    epoch_t& last_osd_epoch,  bool &propose_pending);
+  int process_gw_map_gw_down(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    bool &propose_pending);
+  void update_active_timers(bool &propose_pending);
+  void handle_abandoned_ana_groups(bool &propose_pending);
+  void handle_removed_subsystems(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    const std::vector<NvmeNqnId> &current_subsystems, bool &propose_pending);
+  void start_timer(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    NvmeAnaGrpId anagrpid, uint8_t value);
+private:
+  void add_grp_id(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    const NvmeAnaGrpId grpid);
+  void remove_grp_id(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    const NvmeAnaGrpId grpid);
+  void fsm_handle_gw_down(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    gw_states_per_group_t state, NvmeAnaGrpId grpid,  bool &map_modified);
+  void fsm_handle_gw_delete(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    gw_states_per_group_t state, NvmeAnaGrpId grpid,  bool &map_modified);
+  void fsm_handle_gw_alive(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    NvmeGwMonState & gw_state, gw_states_per_group_t state,
+    NvmeAnaGrpId grpid, epoch_t& last_osd_epoch, bool &map_modified);
+  void fsm_handle_to_expired(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    NvmeAnaGrpId grpid,  bool &map_modified);
 
+  void find_failover_candidate(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    NvmeAnaGrpId grpid, bool &propose_pending);
+  void find_failback_gw(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    bool &propose_pending);
+  void set_failover_gw_for_ANA_group(
+    const NvmeGwId &failed_gw_id, const NvmeGroupKey& group_key,
+    const NvmeGwId &gw_id, NvmeAnaGrpId groupid);
 
-    int  get_timer   (const NvmeGwId &gw_id, const NvmeGroupKey& group_key, NvmeAnaGrpId anagrpid);
-    void cancel_timer(const NvmeGwId &gw_id, const NvmeGroupKey& group_key, NvmeAnaGrpId anagrpid);
-    void validate_gw_map(const NvmeGroupKey& group_key);
+  int get_timer(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    NvmeAnaGrpId anagrpid);
+  void cancel_timer(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    NvmeAnaGrpId anagrpid);
+  void validate_gw_map(
+    const NvmeGroupKey& group_key);
 
 public:
-    int  blocklist_gw(const NvmeGwId &gw_id, const NvmeGroupKey& group_key, NvmeAnaGrpId ANA_groupid, epoch_t &epoch, bool failover);
-    void encode(ceph::buffer::list &bl) const {
-        using ceph::encode;
-        ENCODE_START(1, 1, bl);
-        encode(epoch, bl);// global map epoch
-
-        encode(created_gws, bl); //Encode created GWs
-        encode(fsm_timers, bl);
-        ENCODE_FINISH(bl);
-    }
-
-    void decode(ceph::buffer::list::const_iterator &bl) {
-        using ceph::decode;
-        DECODE_START(1, bl);
-        decode(epoch, bl);
-
-        decode(created_gws, bl);
-        decode(fsm_timers, bl);
-        DECODE_FINISH(bl);
-    }
+  int blocklist_gw(
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
+    NvmeAnaGrpId ANA_groupid, epoch_t &epoch, bool failover);
+
+  void encode(ceph::buffer::list &bl) const {
+    using ceph::encode;
+    ENCODE_START(1, 1, bl);
+    encode(epoch, bl);// global map epoch
+
+    encode(created_gws, bl); //Encode created GWs
+    encode(fsm_timers, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(ceph::buffer::list::const_iterator &bl) {
+    using ceph::decode;
+    DECODE_START(1, bl);
+    decode(epoch, bl);
+
+    decode(created_gws, bl);
+    decode(fsm_timers, bl);
+    DECODE_FINISH(bl);
+  }
 };
 
 #include "NVMeofGwSerialize.h"