#define dout_subsys ceph_subsys_osd
#undef dout_prefix
-#define dout_prefix _prefix(_dout, whoami, get_osdmap())
+#define dout_prefix _prefix(_dout, whoami, get_osdmap_epoch())
-static ostream& _prefix(std::ostream* _dout, int whoami, OSDMapRef osdmap) {
- return *_dout << "osd." << whoami << " "
- << (osdmap ? osdmap->get_epoch():0)
- << " ";
+static ostream& _prefix(std::ostream* _dout, int whoami, epoch_t epoch) {
+ return *_dout << "osd." << whoami << " " << epoch << " ";
}
//Initial features in new superblock.
#undef dout_prefix
-#define dout_prefix _prefix(_dout, whoami, osdmap)
+#define dout_prefix _prefix(_dout, whoami, get_osdmap_epoch())
// cons/des
Mutex::Locker l(publish_lock);
return osdmap;
}
+ epoch_t get_osdmap_epoch() {
+ Mutex::Locker l(publish_lock);
+ return osdmap ? osdmap->get_epoch() : 0;
+ }
void publish_map(OSDMapRef map) {
Mutex::Locker l(publish_lock);
osdmap = map;
OSDMapRef get_osdmap() {
return osdmap;
}
+ epoch_t get_osdmap_epoch() {
+ return osdmap ? osdmap->get_epoch() : 0;
+ }
+
utime_t had_map_since;
RWLock map_lock;
list<OpRequestRef> waiting_for_osdmap;