~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/messages/MMonElection.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  MMonElection(int o, epoch_t e, MonMap *m) : 
49
49
    Message(MSG_MON_ELECTION, HEAD_VERSION), 
50
50
    fsid(m->fsid), op(o), epoch(e) {
51
 
    m->encode(monmap_bl);
 
51
 
 
52
    // encode using full feature set; we will reencode for dest later,
 
53
    // if necessary
 
54
    m->encode(monmap_bl, CEPH_FEATURES_ALL);
52
55
  }
53
56
private:
54
57
  ~MMonElection() {}
60
63
  }
61
64
  
62
65
  void encode_payload(uint64_t features) {
 
66
    if (monmap_bl.length() && (features & CEPH_FEATURE_MONENC) == 0) {
 
67
      // reencode old-format monmap
 
68
      MonMap t;
 
69
      t.decode(monmap_bl);
 
70
      monmap_bl.clear();
 
71
      t.encode(monmap_bl, features);
 
72
    }
 
73
 
63
74
    ::encode(fsid, payload);
64
75
    ::encode(op, payload);
65
76
    ::encode(epoch, payload);