diff options
author | Sage Weil <sage@newdream.net> | 2008-01-29 06:23:47 +0100 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2008-01-29 06:23:47 +0100 |
commit | 39d2a25ddf2e3dc2c4b89638365ac4b8e96db7b0 (patch) | |
tree | 4546f7c03a8772d393f16712b1396ff357244b88 | |
parent | debian packing stuffs (diff) | |
download | ceph-39d2a25ddf2e3dc2c4b89638365ac4b8e96db7b0.tar.xz ceph-39d2a25ddf2e3dc2c4b89638365ac4b8e96db7b0.zip |
mds: adjust cap issue sequence to avoid unnecessary file_caps messages
-rw-r--r-- | src/mds/Locker.cc | 3 | ||||
-rw-r--r-- | src/mds/Server.cc | 25 | ||||
-rw-r--r-- | src/mds/SessionMap.cc | 11 | ||||
-rw-r--r-- | src/mds/SessionMap.h | 1 |
4 files changed, 27 insertions, 13 deletions
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 0bb2e6bf5c1..9b0a3dbd1a2 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -492,9 +492,6 @@ Capability* Locker::issue_new_caps(CInode *in, cap->issue(cap->pending()); cap->set_last_open(); - // ok, stop suppressing. - cap->set_suppress(false); - int now = cap->pending(); if (before != now && (before & CEPH_CAP_WR) == 0 && diff --git a/src/mds/Server.cc b/src/mds/Server.cc index a2bbe31153e..e4f94b73932 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -579,11 +579,13 @@ void Server::handle_client_request(MClientRequest *req) // active session? Session *session = 0; - if (req->get_client_inst().name.is_client() && - !(session = mds->sessionmap.get_session(req->get_client_inst().name))) { - dout(5) << "no session for " << req->get_client_inst().name << ", dropping" << dendl; - delete req; - return; + if (req->get_client_inst().name.is_client()) { + session = mds->sessionmap.get_session(req->get_client_inst().name); + if (!session) { + dout(5) << "no session for " << req->get_client_inst().name << ", dropping" << dendl; + delete req; + return; + } } // old mdsmap? @@ -3861,12 +3863,15 @@ void Server::_do_open(MDRequest *mdr, CInode *cur) MClientRequest *req = mdr->client_request; int cmode = req->get_open_file_mode(); - // can we issue the caps they want? - //version_t fdv = mds->locker->issue_file_data_version(cur); + // register new cap Capability *cap = mds->locker->issue_new_caps(cur, cmode, mdr->session); - if (!cap) return; // can't issue (yet), so wait! - - dout(12) << "_do_open issuing caps " << cap_string(cap->pending()) + + // drop our locks (they may interfere with us issuing new caps) + mds->locker->drop_locks(mdr); + + cap->set_suppress(false); // stop suppressing messages on this cap + + dout(12) << "_do_open issued caps " << cap_string(cap->pending()) << " for " << req->get_source() << " on " << *cur << dendl; diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index 543fdac0628..d801eb8debc 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -28,6 +28,17 @@ void SessionMap::init_inode() } +void SessionMap::dump() +{ + hash<entity_name_t> H; + dout(0) << "dump" << dendl; + for (hash_map<entity_name_t,Session*>::iterator p = session_map.begin(); + p != session_map.end(); + ++p) + dout(0) << p->first << " " << p->second << " hash " << H(p->first) << " addr " << (void*)&p->first << dendl; +} + + // ---------------- // LOAD diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 142841eaa6e..8ff64de5d06 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -172,6 +172,7 @@ public: by_state[s].push_back(&session->session_list_item); } } + void dump(); void get_client_set(set<int>& s) { for (hash_map<entity_name_t,Session*>::iterator p = session_map.begin(); |