} // namespace librbd
+std::ostream &operator<<(std::ostream &os,
+ const librbd::ImageWatcher::LockUpdateState &state) {
+ switch (state) {
+ case librbd::ImageWatcher::LOCK_UPDATE_STATE_NOT_SUPPORTED:
+ os << "NotSupported";
+ break;
+ case librbd::ImageWatcher::LOCK_UPDATE_STATE_LOCKED:
+ os << "Locked";
+ break;
+ case librbd::ImageWatcher::LOCK_UPDATE_STATE_RELEASING:
+ os << "Releasing";
+ break;
+ case librbd::ImageWatcher::LOCK_UPDATE_STATE_UNLOCKED:
+ os << "Unlocked";
+ break;
+ case librbd::ImageWatcher::LOCK_UPDATE_STATE_NOTIFICATION:
+ os << "Notification";
+ break;
+ default:
+ os << "Unknown (" << static_cast<uint32_t>(state) << ")";
+ break;
+ }
+ return os;
+}
} // namespace librbd
+std::ostream &operator<<(std::ostream &os,
+ const librbd::ImageWatcher::LockUpdateState &state);
+
#endif // CEPH_LIBRBD_IMAGE_WATCHER_H
}
}
+std::ostream &operator<<(std::ostream &os, const Journal::State &state) {
+ switch (state) {
+ case Journal::STATE_UNINITIALIZED:
+ os << "Uninitialized";
+ break;
+ case Journal::STATE_INITIALIZING:
+ os << "Initializing";
+ break;
+ case Journal::STATE_REPLAYING:
+ os << "Replaying";
+ break;
+ case Journal::STATE_RECORDING:
+ os << "Recording";
+ break;
+ case Journal::STATE_STOPPING_RECORDING:
+ os << "StoppingRecording";
+ break;
+ default:
+ os << "Unknown (" << static_cast<uint32_t>(state) << ")";
+ break;
+ }
+ return os;
+}
+
} // namespace librbd
void wait_for_state_transition();
void schedule_wait_for_ready(Context *on_ready);
void handle_wait_for_ready(Context *on_ready);
+
+ friend std::ostream &operator<<(std::ostream &os, const State &state);
};
} // namespace librbd