From f396c4b64281a0f6d0dc94dd53b21633ee5d52e1 Mon Sep 17 00:00:00 2001 From: anwleung Date: Thu, 22 Mar 2007 01:17:57 +0000 Subject: [PATCH] clean up stuff git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1284 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/aleung/security1/ceph/client/Client.cc | 13 +++++++------ branches/aleung/security1/ceph/mds/CInode.cc | 3 +-- branches/aleung/security1/ceph/mds/Server.cc | 2 -- branches/aleung/security1/ceph/osd/OSD.cc | 14 +++++--------- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/branches/aleung/security1/ceph/client/Client.cc b/branches/aleung/security1/ceph/client/Client.cc index 073e1b4656def..0d924fbfce786 100644 --- a/branches/aleung/security1/ceph/client/Client.cc +++ b/branches/aleung/security1/ceph/client/Client.cc @@ -724,11 +724,14 @@ void Client::put_user_ticket(Ticket *tk) void Client::handle_osd_update(MOSDUpdate *m) { + utime_t update_time_start = g_clock.now(); + hash_t my_hash = m->get_hash(); // if we dont have it cached, ask mds // this will lose execution control if (groups.count(my_hash) == 0) { + MClientUpdate *update = new MClientUpdate(my_hash); // is anyone else already waiting for this hash? @@ -767,8 +770,6 @@ void Client::handle_client_update_reply(MClientUpdateReply *m) { groups[my_hash].set_root_hash(my_hash); groups[my_hash].set_sig(m->get_sig()); - //MOSDUpdateReply *reply = new MOSDUpdateReply(my_hash, groups[my_hash].get_list(), m->get_sig()); - // wake the waiters and send them all a reply for (set::iterator oi = update_waiter_osd[my_hash].begin(); oi != update_waiter_osd[my_hash].end(); @@ -2995,10 +2996,10 @@ int Client::write(fh_t fh, const char *buf, off_t size, off_t offset, bool lazy = f->mode == FILE_MODE_LAZY; dout(10) << "cur file size is " << in->inode.size << " wr size " << in->file_wr_size << endl; - - ExtCap *write_ext_cap = capcache->get_cache_cap(in->ino(), uid); - assert(write_ext_cap); - + + ExtCap *write_ext_cap = capcache->get_cache_cap(in->ino(), uid); + assert(write_ext_cap); + // time it. utime_t start = g_clock.now(); diff --git a/branches/aleung/security1/ceph/mds/CInode.cc b/branches/aleung/security1/ceph/mds/CInode.cc index 03f75ca564884..cda819318d606 100644 --- a/branches/aleung/security1/ceph/mds/CInode.cc +++ b/branches/aleung/security1/ceph/mds/CInode.cc @@ -101,9 +101,7 @@ CInode::CInode(MDCache *c, bool auth) { batching = false; buffer_stop = false; buffer_thread = BufferThread(this); - cout << "Starting buffer_thread.create()" << endl; buffer_thread.create(); - cout << "Buffer_thread created!" << endl; } auth_pins = 0; @@ -154,6 +152,7 @@ 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()); } diff --git a/branches/aleung/security1/ceph/mds/Server.cc b/branches/aleung/security1/ceph/mds/Server.cc index 17cb1b723d054..72503e88b1f11 100644 --- a/branches/aleung/security1/ceph/mds/Server.cc +++ b/branches/aleung/security1/ceph/mds/Server.cc @@ -2299,8 +2299,6 @@ void Server::handle_client_open(MClientRequest *req, utime_t end_time; int flags = req->get_iarg(); int mode = req->get_iarg2(); - //uid_t uid = req->get_caller_uid(); - //gid_t gid = req->get_caller_gid(); dout(7) << "open " << flags << " on " << *cur << endl; dout(10) << "open flags = " << flags << " mode = " << mode << endl; diff --git a/branches/aleung/security1/ceph/osd/OSD.cc b/branches/aleung/security1/ceph/osd/OSD.cc index 18e1a6b8c8e52..02628838c274d 100644 --- a/branches/aleung/security1/ceph/osd/OSD.cc +++ b/branches/aleung/security1/ceph/osd/OSD.cc @@ -382,9 +382,10 @@ inline bool OSD::check_request(MOSDOp *op, ExtCap *op_capability) { hash_t my_hash = op_capability->get_user_hash(); // now we should have the group, is the client in it? - if (!(user_groups[my_hash].contains(op_capability->get_uid()))) { + //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_capability->get_uid() << " not in group " + cout << "User " << op->get_user() << " not in group " << my_hash << endl; return false; } @@ -458,12 +459,6 @@ void OSD::handle_osd_update_reply(MOSDUpdateReply *m) { user_groups[my_hash].set_list(m->get_list()); // wait up the waiter(s) - // this signals all update waiters - //for (list::iterator p = update_waiter_cond[my_hash].begin(); - // p != update_waiter_cond[my_hash].end(); - // ++p) { - //(*p)->Signal(); - //} take_waiters(update_waiter_op[my_hash]); update_waiter_op.erase(my_hash); @@ -3350,6 +3345,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg) utime_t write_time_start; if (outstanding_updates.count(op->get_reqid()) != 0) { write_time_start = outstanding_updates[op->get_reqid()]; + outstanding_updates.erase(op->get_reqid()); } else write_time_start = g_clock.now(); @@ -3380,7 +3376,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg) // i know, i know...not secure but they should all have caps if (op->get_op() == OSD_OP_WRITE && op->get_source().is_client()) { - + ExtCap *op_capability = op->get_capability(); assert(op_capability); // if using groups...do we know group? -- 2.39.5