From bebce27f52be1739e013341b2ad550427065b270 Mon Sep 17 00:00:00 2001 From: anwleung Date: Tue, 20 Mar 2007 23:09:25 +0000 Subject: [PATCH] some optimizations, not sure they help git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1272 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/aleung/security1/ceph/client/Client.cc | 4 ---- branches/aleung/security1/ceph/osd/OSD.cc | 13 ++++++------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/branches/aleung/security1/ceph/client/Client.cc b/branches/aleung/security1/ceph/client/Client.cc index e58dc8f28e425..073e1b4656def 100644 --- a/branches/aleung/security1/ceph/client/Client.cc +++ b/branches/aleung/security1/ceph/client/Client.cc @@ -725,7 +725,6 @@ void Client::put_user_ticket(Ticket *tk) void Client::handle_osd_update(MOSDUpdate *m) { hash_t my_hash = m->get_hash(); - cout << "Client::handle_osd_request Received a request to resolve group " << my_hash << endl; // if we dont have it cached, ask mds // this will lose execution control @@ -734,13 +733,11 @@ void Client::handle_osd_update(MOSDUpdate *m) { // is anyone else already waiting for this hash? if (update_waiter_osd.count(my_hash) == 0) { - cout << "mds_group_update for " << my_hash << endl; dout(10) << "mds_group_update for " << my_hash << endl; // FIXME choose mds (always choose 0) messenger->send_message(update, mdsmap->get_inst(0), MDS_PORT_SERVER); } else { - cout << "mds_group_update for " << my_hash << endl; dout(10) << "mds_group_update for " << my_hash << endl; } @@ -764,7 +761,6 @@ void Client::handle_osd_update(MOSDUpdate *m) { void Client::handle_client_update_reply(MClientUpdateReply *m) { hash_t my_hash = m->get_user_hash(); - cout << "Client::handle_client_update_reply for " << my_hash << endl; // cache the list groups[my_hash].set_list(m->get_user_list()); diff --git a/branches/aleung/security1/ceph/osd/OSD.cc b/branches/aleung/security1/ceph/osd/OSD.cc index 66d0e62ea80a7..05ecd6869a052 100644 --- a/branches/aleung/security1/ceph/osd/OSD.cc +++ b/branches/aleung/security1/ceph/osd/OSD.cc @@ -374,7 +374,7 @@ int OSD::read_superblock() // security operations // checks that the access rights in the cap are correct -bool OSD::check_request(MOSDOp *op, ExtCap *op_capability) { +inline bool OSD::check_request(MOSDOp *op, ExtCap *op_capability) { if (op_capability->get_type() == UNIX_GROUP || op_capability->get_type() == BATCH) { @@ -446,7 +446,6 @@ void OSD::handle_osd_update_reply(MOSDUpdateReply *m) { // store the new list into group hash_t my_hash = m->get_user_hash(); - cout << "hande_osd_update_reply for " << my_hash << endl; dout(10) << "hande_osd_update_reply for " << my_hash << endl; // verify @@ -471,7 +470,7 @@ void OSD::handle_osd_update_reply(MOSDUpdateReply *m) { } // assumes the request and cap contents has already been checked -bool OSD::verify_cap(ExtCap *cap) { +inline bool OSD::verify_cap(ExtCap *cap) { // have i already verified this cap? if (!cap_cache->prev_verified(cap->get_id())) { @@ -481,12 +480,9 @@ bool OSD::verify_cap(ExtCap *cap) { if (cap->verif_extcap(monmap->get_key())) { utime_t justver_time_end = g_clock.now(); cout << "Just verification time " << justver_time_end - justver_time_start << endl; - utime_t cachecap_time_start = g_clock.now(); + // cache the verification cap_cache->insert(cap); - utime_t cachecap_time_end = g_clock.now(); - cout << "Caching cap time " << cachecap_time_end - cachecap_time_start << endl; - } else return false; @@ -3420,6 +3416,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg) } utime_t hash_time_end = g_clock.now(); cout << "wr Hash check time " << hash_time_end - hash_time_start << endl; + cout << "Hash time SO FAR " << hash_time_end - sec_time_start << endl; utime_t perm_time_start = g_clock.now(); // check accesses are right @@ -3430,11 +3427,13 @@ void OSD::op_modify(MOSDOp *op, PG *pg) dout(3) << "Access permissions are incorrect" << endl; utime_t perm_time_end = g_clock.now(); cout << "wr Check permissions time " << perm_time_end - perm_time_start << endl; + cout << "Check permissions time SO FAR " << perm_time_end - sec_time_start << endl; utime_t verif_time_start = g_clock.now(); assert(verify_cap(op_capability)); utime_t verif_time_end = g_clock.now(); cout << "wr Verif capability time " << verif_time_end - verif_time_start << endl; + cout << "Verification time SO FAR " << verif_time_end - sec_time_start << endl; } } -- 2.39.5