From 6c0dca02798380047113a87267a9a75934435663 Mon Sep 17 00:00:00 2001 From: anwleung Date: Thu, 22 Mar 2007 19:37:35 +0000 Subject: [PATCH] clean up again, changed output git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1290 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/aleung/security1/ceph/mds/CInode.cc | 11 ++-- branches/aleung/security1/ceph/mds/Locker.cc | 3 -- branches/aleung/security1/ceph/mds/Server.cc | 55 +------------------- branches/aleung/security1/ceph/osd/OSD.cc | 20 +++---- 4 files changed, 16 insertions(+), 73 deletions(-) diff --git a/branches/aleung/security1/ceph/mds/CInode.cc b/branches/aleung/security1/ceph/mds/CInode.cc index cda819318d606..5bb7779648e4c 100644 --- a/branches/aleung/security1/ceph/mds/CInode.cc +++ b/branches/aleung/security1/ceph/mds/CInode.cc @@ -152,7 +152,6 @@ void CInode::buffer_entry() for (set::iterator si = buffered_reqs.begin(); si != buffered_reqs.end(); si++) { - cout << "Pushing " << (*si)->get_caller_uid() << " on to capability" << endl; user_set.push_back((*si)->get_caller_uid()); users_hash.add_user((*si)->get_caller_uid()); } @@ -193,10 +192,10 @@ void CInode::buffer_entry() } void CInode::add_to_buffer(MClientRequest *req, Server *serve, MDS *metads) { - cout << "Buffering the request for uid:" << - req->get_caller_uid() << " on client:" << - req->get_client() << " for file:" << - inode.ino << " with client inst:" << req->get_client_inst() << endl; + dout(1) << "Buffering the request for uid:" + << req->get_caller_uid() << " on client:" + << req->get_client() << " for file:" + << inode.ino << " with client inst:" << req->get_client_inst() << endl; buffer_lock.Lock(); @@ -206,11 +205,9 @@ void CInode::add_to_buffer(MClientRequest *req, Server *serve, MDS *metads) { // was batching thread already on? if (batching) { - cout << "Buffering request into existing buffer" << endl; buffered_reqs.insert(req); } else { - cout << "Buffering request into new buffer" << endl; // set external helper classes server = serve; diff --git a/branches/aleung/security1/ceph/mds/Locker.cc b/branches/aleung/security1/ceph/mds/Locker.cc index 7f4b5d75cf73a..d15c4fc567c73 100644 --- a/branches/aleung/security1/ceph/mds/Locker.cc +++ b/branches/aleung/security1/ceph/mds/Locker.cc @@ -316,10 +316,7 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) { dout(3) << "Made new " << my_want << " capability for uid: " << ext_cap->get_uid() << " for inode: " << ext_cap->get_ino()<< endl; - utime_t sign_time_start = g_clock.now(); ext_cap->sign_extcap(mds->getPrvKey()); - utime_t sign_time_end = g_clock.now(); - cout << "Signature time " << sign_time_end - sign_time_start << endl; // caches this capability in the inode if (g_conf.mds_group == 1) { diff --git a/branches/aleung/security1/ceph/mds/Server.cc b/branches/aleung/security1/ceph/mds/Server.cc index 72503e88b1f11..87bdfa92bdc85 100644 --- a/branches/aleung/security1/ceph/mds/Server.cc +++ b/branches/aleung/security1/ceph/mds/Server.cc @@ -2336,7 +2336,7 @@ void Server::handle_client_open(MClientRequest *req, utime_t sec_time_start = g_clock.now(); ext_cap = mds->locker->issue_new_extcaps(cur, mode, req); utime_t sec_time_end = g_clock.now(); - cout << "Get security cap time " << sec_time_end - sec_time_start << endl; + dout(1) << "Get security cap time " << sec_time_end - sec_time_start << endl; Capability *cap = mds->locker->issue_new_caps(cur, mode, req); if (!cap) return; // can't issue (yet), so wait! @@ -2355,7 +2355,7 @@ void Server::handle_client_open(MClientRequest *req, reply->set_ext_cap(ext_cap); end_time = g_clock.now(); - cout << "Open() request latency " << end_time - start_time << endl; + dout(1) << "Open() request latency " << end_time - start_time << endl; reply_request(req, reply, cur); } @@ -2442,59 +2442,8 @@ void Server::handle_client_openc(MClientRequest *req, CInode *diri) in->add_to_buffer(req, this, mds); return; - - /* - //in->two_req_ago = in->one_req_ago; - //in->one_req_ago = open_req_time; - //cout << "HCO: Grabbing lock" << endl; - in->buffer_lock.Lock(); - //cout << "HCO: Grabbed lock" << endl; - - // wait for thread if it hasn't init'd - if (! in->thread_init) - in->buffer_cond.Wait(in->buffer_lock); - - // if buffer waiting thread is off, turn it on - if (!in->batching) { - cout << "HCO: Batching is now turned on" << endl; - // grab lock and insert - in->buffered_reqs.insert(req); - cout << "HCO: Inserted request" << endl; - - // prepare capid for future capability - in->batch_id.cid = mds->cap_id_count; - in->batch_id.mds_id = mds->get_nodeid(); - mds->cap_id_count++; - // turn on batching flags - cout << "HCO: Turning batching on" << endl; - in->batching = true; - in->batch_id_set = true; - //in->buffer_stop = false; - - // set server exit point - in->server = this; - in->mds = mds; - - //singal the thread - cout << "Going to singal" << endl; - in->buffer_cond.Signal(); - cout << "Done signaling" << endl; - - } - else { - cout << "HCO: Inserting into buffer" << endl; - in->buffered_reqs.insert(req); - } - - // release the lock - cout << "HCO: releasing lock" << endl; - in->buffer_lock.Unlock(); - cout << "HCO: released lock" << endl; - */ } else { - //in->two_req_ago = in->one_req_ago; - //in->one_req_ago = open_req_time; in->update_buffer_time(open_req_time); handle_client_open(req, in); } diff --git a/branches/aleung/security1/ceph/osd/OSD.cc b/branches/aleung/security1/ceph/osd/OSD.cc index 02628838c274d..2654178e93af1 100644 --- a/branches/aleung/security1/ceph/osd/OSD.cc +++ b/branches/aleung/security1/ceph/osd/OSD.cc @@ -385,7 +385,7 @@ inline bool OSD::check_request(MOSDOp *op, ExtCap *op_capability) { //if (!(user_groups[my_hash].contains(op_capability->get_uid()))) { if (!(user_groups[my_hash].contains(op->get_user()))) { // do update to get new unix groups - cout << "User " << op->get_user() << " not in group " + dout(1) << "User " << op->get_user() << " not in group " << my_hash << endl; return false; } @@ -393,23 +393,23 @@ inline bool OSD::check_request(MOSDOp *op, ExtCap *op_capability) { } // check users match else if (op->get_user() != op_capability->get_uid()) { - cout << "User did in cap did not match request" << endl; + dout(1) << "User did in cap did not match request" << endl; return false; } // check mode matches if (op->get_op() == OSD_OP_WRITE && op_capability->mode() & FILE_MODE_W == 0) { - cout << "Write mode in cap did not match request" << endl; + dout(1) << "Write mode in cap did not match request" << endl; return false; } if (op->get_op() == OSD_OP_READ && op_capability->mode() & FILE_MODE_R == 0) { - cout << "Read mode in cap did not match request" << endl; + dout(1) << "Read mode in cap did not match request" << endl; return false; } // check object matches if (op->get_oid().ino != op_capability->get_ino()) { - cout << "File in cap did not match request" << endl; + dout(1) << "File in cap did not match request" << endl; return false; } return true; @@ -451,9 +451,9 @@ void OSD::handle_osd_update_reply(MOSDUpdateReply *m) { // verify if (m->verify_list(monmap->get_key())) - cout << "List verification succeeded" << endl; + dout(1) << "List verification succeeded" << endl; else - cout << "List verification failed" << endl; + dout(1) << "List verification failed" << endl; // add the new list to our cache user_groups[my_hash].set_list(m->get_list()); @@ -3016,7 +3016,7 @@ void OSD::op_read(MOSDOp *op)//, PG *pg) } } utime_t sec_time_end = g_clock.now(); - cout << "Read Security time " << sec_time_end - sec_time_start << endl; + dout(1) << "Read Security time " << sec_time_end - sec_time_start << endl; long r = 0; bufferlist bl; @@ -3033,7 +3033,7 @@ void OSD::op_read(MOSDOp *op)//, PG *pg) utime_t read_time_end = g_clock.now(); if (op->get_source().is_client()) - cout << "Read time " << read_time_end - read_time_start << endl; + dout(1) << "Read time " << read_time_end - read_time_start << endl; // set up reply MOSDOpReply *reply = new MOSDOpReply(op, 0, osdmap->get_epoch(), true); @@ -3541,7 +3541,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg) utime_t write_time_end = g_clock.now(); if (op->get_op() == OSD_OP_WRITE && op->get_source().is_client()) - cout << "Write time " << write_time_end - write_time_start << endl; + dout(1) << "Write time " << write_time_end - write_time_start << endl; } -- 2.39.5