bool OSD::ms_handle_reset(Connection *con)
{
- OSD::Session *session = (OSD::Session *)con->get_priv();
+ Session *session = (Session *)con->get_priv();
dout(1) << "ms_handle_reset con " << con << " session " << session << dendl;
if (!session)
return false;
if (!cct->_conf->osd_fast_fail_on_connection_refused)
return false;
- OSD::Session *session = (OSD::Session *)con->get_priv();
+ Session *session = (Session *)con->get_priv();
dout(1) << "ms_handle_refused con " << con << " session " << session << dendl;
if (!session)
return false;
}
void finish(ThreadPool::TPHandle& tp) {
- OSD::Session *session = static_cast<OSD::Session *>(
+ Session *session = static_cast<Session *>(
con->get_priv());
epoch_t last_sent_epoch;
if (session) {
#include "include/CompatSet.h"
#include "OpRequest.h"
+#include "Session.h"
#include <atomic>
#include <map>
}
}
- struct Session : public RefCountedObject {
- EntityName entity_name;
- OSDCap caps;
- int64_t auid;
- ConnectionRef con;
- WatchConState wstate;
-
- Mutex session_dispatch_lock;
- boost::intrusive::list<OpRequest> waiting_on_map;
-
- OSDMapRef osdmap; /// Map as of which waiting_for_pg is current
- map<spg_t, boost::intrusive::list<OpRequest> > waiting_for_pg;
-
- Spinlock sent_epoch_lock;
- epoch_t last_sent_epoch;
- Spinlock received_map_lock;
- epoch_t received_map_epoch; // largest epoch seen in MOSDMap from here
-
- explicit Session(CephContext *cct) :
- RefCountedObject(cct),
- auid(-1), con(0), wstate(cct),
- session_dispatch_lock("Session::session_dispatch_lock"),
- last_sent_epoch(0), received_map_epoch(0)
- {}
- void maybe_reset_osdmap() {
- if (waiting_for_pg.empty()) {
- osdmap.reset();
- }
- }
- };
private:
void update_waiting_for_pg(Session *session, OSDMapRef osdmap);
#include "OSD.h"
#include "OpRequest.h"
#include "ScrubStore.h"
+#include "Session.h"
#include "common/Timer.h"
#include "common/perf_counters.h"
MOSDOp *req = static_cast<MOSDOp*>(op->get_req());
- OSD::Session *session = (OSD::Session *)req->get_connection()->get_priv();
+ Session *session = (Session *)req->get_connection()->get_priv();
if (!session) {
dout(0) << "op_has_sufficient_caps: no session for op " << *req << dendl;
return false;
#include "OSD.h"
#include "OpRequest.h"
#include "ScrubStore.h"
+#include "Session.h"
#include "objclass/objclass.h"
#include "common/errno.h"
assert(conn);
- boost::intrusive_ptr<OSD::Session> session((OSD::Session *)conn->get_priv());
+ boost::intrusive_ptr<Session> session((Session *)conn->get_priv());
if (!session.get())
return;
session->put(); // get_priv() takes a ref, and so does the intrusive_ptr
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+#ifndef CEPH_OSD_SESSION_H
+#define CEPH_OSD_SESSION_H
+
+#include "common/RefCountedObj.h"
+
+struct Session : public RefCountedObject {
+ EntityName entity_name;
+ OSDCap caps;
+ int64_t auid;
+ ConnectionRef con;
+ WatchConState wstate;
+
+ Mutex session_dispatch_lock;
+ boost::intrusive::list<OpRequest> waiting_on_map;
+
+ OSDMapRef osdmap; /// Map as of which waiting_for_pg is current
+ map<spg_t, boost::intrusive::list<OpRequest> > waiting_for_pg;
+
+ Spinlock sent_epoch_lock;
+ epoch_t last_sent_epoch;
+ Spinlock received_map_lock;
+ epoch_t received_map_epoch; // largest epoch seen in MOSDMap from here
+
+ explicit Session(CephContext *cct) :
+ RefCountedObject(cct),
+ auid(-1), con(0),
+ wstate(cct),
+ session_dispatch_lock("Session::session_dispatch_lock"),
+ last_sent_epoch(0), received_map_epoch(0)
+ {}
+ void maybe_reset_osdmap() {
+ if (waiting_for_pg.empty()) {
+ osdmap.reset();
+ }
+ }
+};
+
+typedef boost::intrusive_ptr<Session> SessionRef;
+
+#endif
#include "OSD.h"
#include "PrimaryLogPG.h"
#include "Watch.h"
+#include "Session.h"
#include "common/config.h"
dout(10) << __func__ << " con " << con << dendl;
conn = con;
will_ping = _will_ping;
- OSD::Session* sessionref(static_cast<OSD::Session*>(con->get_priv()));
+ Session* sessionref(static_cast<Session*>(con->get_priv()));
if (sessionref) {
sessionref->wstate.addWatch(self.lock());
sessionref->put();
unregister_cb();
discarded = true;
if (conn) {
- OSD::Session* sessionref(static_cast<OSD::Session*>(conn->get_priv()));
+ Session* sessionref(static_cast<Session*>(conn->get_priv()));
if (sessionref) {
sessionref->wstate.removeWatch(self.lock());
sessionref->put();
/**
* Holds weak refs to Watch structures corresponding to a connection
- * Lives in the OSD::Session object of an OSD connection
+ * Lives in the Session object of an OSD connection
*/
class WatchConState {
Mutex lock;
bool ms_handle_reset(Connection *con) {
dout(1) << __func__ << dendl;
- OSD::Session *session = (OSD::Session *)con->get_priv();
+ Session *session = (Session *)con->get_priv();
if (!session)
return false;
session->put();