]>
git.proxmox.com Git - ceph.git/blob - ceph/src/mon/PaxosFSMap.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_PAXOS_FSMAP_H
16 #define CEPH_PAXOS_FSMAP_H
18 #include "mds/FSMap.h"
19 #include "mds/MDSMap.h"
21 #include "include/ceph_assert.h"
25 virtual ~PaxosFSMap() {}
27 const FSMap
&get_pending_fsmap() const { ceph_assert(is_leader()); return pending_fsmap
; }
28 const FSMap
&get_fsmap() const { return fsmap
; }
30 virtual bool is_leader() const = 0;
33 FSMap
&get_pending_fsmap_writeable() { ceph_assert(is_leader()); return pending_fsmap
; }
35 FSMap
&create_pending() {
36 ceph_assert(is_leader());
37 pending_fsmap
= fsmap
;
38 pending_fsmap
.epoch
++;
42 void decode(ceph::buffer::list
&bl
) {
44 pending_fsmap
= FSMap(); /* nuke it to catch invalid access */
48 /* Keep these PRIVATE to prevent unprotected manipulation. */
49 FSMap fsmap
; /* the current epoch */
50 FSMap pending_fsmap
; /* the next epoch */