]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Convert g_ceph_context to a pointer.
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 21 Jun 2011 19:28:16 +0000 (12:28 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 21 Jun 2011 19:28:16 +0000 (12:28 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
100 files changed:
src/cauthtool.cc
src/cconf.cc
src/cfuse.cc
src/client/Client.cc
src/client/Client.h
src/client/SyntheticClient.cc
src/client/SyntheticClient.h
src/cmds.cc
src/cmon.cc
src/common/ceph_context.h
src/common/debug.h
src/cosd.cc
src/csyn.cc
src/dupstore.cc
src/global/global_context.cc
src/global/global_context.h
src/global/signal_handler.cc
src/libceph.cc
src/librados-config.cc
src/librados.cc
src/mds/CDentry.cc
src/mds/CDir.cc
src/mds/CInode.cc
src/mds/CInode.h
src/mds/Dumper.cc
src/mds/Dumper.h
src/mds/Locker.cc
src/mds/MDBalancer.cc
src/mds/MDCache.cc
src/mds/MDLog.cc
src/mds/MDS.cc
src/mds/MDSTable.cc
src/mds/Migrator.cc
src/mds/Resetter.h
src/mds/Server.cc
src/mds/Server.h
src/mds/SessionMap.cc
src/mds/SessionMap.h
src/mds/journal.cc
src/mds/mdstypes.h
src/messages/MMonPaxos.h
src/mon/AuthMonitor.cc
src/mon/Elector.cc
src/mon/LogMonitor.cc
src/mon/MDSMonitor.cc
src/mon/MDSMonitor.h
src/mon/Monitor.cc
src/mon/MonmapMonitor.cc
src/mon/MonmapMonitor.h
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc
src/mon/Paxos.cc
src/mon/PaxosService.cc
src/monmaptool.cc
src/os/FileJournal.cc
src/os/FileStore.cc
src/os/JournalingObjectStore.h
src/osd/Ager.cc
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc
src/osdc/Filer.h
src/osdc/Journaler.cc
src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h
src/osdc/Objecter.cc
src/osdc/Objecter.h
src/osdc/rados_bencher.h
src/osdmaptool.cc
src/rados.cc
src/rados_sync.cc
src/rbd.cc
src/rgw/librgw.cc
src/rgw/rgw_admin.cc
src/rgw/rgw_log.cc
src/rgw/rgw_main.cc
src/rgw/rgw_op.cc
src/rgw/rgw_os_auth.cc
src/streamtest.cc
src/test/TestDoutStreambuf.cc
src/test/TestSignalHandlers.cc
src/test/TestTimers.cc
src/test/gather.cc
src/test/old/test_disk_bw.cc
src/test/old/test_seek_read.c
src/test/old/test_short_seek_read.c
src/test/old/testcounter.cc
src/test/test_libcommon_build.cc
src/test/test_mutate.cc
src/test_trans.cc
src/testcrypto.cc
src/testkeys.cc
src/testmsgr.cc
src/tools/ceph.cc
src/tools/common.cc
src/tools/common.h
src/tools/gceph.cc
src/tools/gui.cc

index aebe39846c26e6c1439b5989392f5a584837f8bc..cfd9a8d45cc8a416f7aeb3485191923b47209804 100644 (file)
@@ -55,7 +55,7 @@ int main(int argc, const char **argv)
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
              CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
   EntityName ename(g_conf->name);
 
   const char *me = argv[0];
@@ -130,7 +130,7 @@ int main(int argc, const char **argv)
 
   if (gen_print_key) {
     CryptoKey key;
-    key.create(&g_ceph_context, CEPH_CRYPTO_AES);
+    key.create(g_ceph_context, CEPH_CRYPTO_AES);
     cout << key << std::endl;    
     return 0;
   }
@@ -178,7 +178,7 @@ int main(int argc, const char **argv)
       
       cout << "importing contents of " << import_keyring << " into " << fn << std::endl;
       //other.print(cout);
-      keyring.import(&g_ceph_context, other);
+      keyring.import(g_ceph_context, other);
       modified = true;
     } else {
       cerr << "can't open " << import_keyring << ": " << err << std::endl;
@@ -187,7 +187,7 @@ int main(int argc, const char **argv)
   }
   if (gen_key) {
     EntityAuth eauth;
-    eauth.key.create(&g_ceph_context, CEPH_CRYPTO_AES);
+    eauth.key.create(g_ceph_context, CEPH_CRYPTO_AES);
     keyring.add(ename, eauth);
     modified = true;
   }
@@ -211,7 +211,7 @@ int main(int argc, const char **argv)
       cerr << "could not parse caps file " << caps_fn << std::endl;
       exit(1);
     }
-    complain_about_parse_errors(&g_ceph_context, &parse_errors);
+    complain_about_parse_errors(g_ceph_context, &parse_errors);
     map<string, bufferlist> caps;
     const char *key_names[] = { "mon", "osd", "mds", NULL };
     for (int i=0; key_names[i]; i++) {
index 357864d2a9b0e0c6446cc53195b59696b7d3cbf9..1f7ef4b00f7a35af6fbeb635a363f5bb11fa20bb 100644 (file)
@@ -122,7 +122,7 @@ int main(int argc, const char **argv)
   argv_to_vec(argc, argv, args);
   env_to_vec(args);
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   std::string val;
   for (std::vector<const char*>::iterator i = args.begin(); i != args.end(); ) {
index cf0db880277159b8318ffa6a33960e14ebe08264..fe33113046cebbb17f6856fbd48368afe59a1c9d 100644 (file)
@@ -81,7 +81,7 @@ int main(int argc, const char **argv, const char *envp[]) {
   }
 
   // get monmap
-  MonClient mc(&g_ceph_context);
+  MonClient mc(g_ceph_context);
   int ret = mc.build_initial_monmap();
   if (ret == -EINVAL)
     usage();
@@ -90,7 +90,7 @@ int main(int argc, const char **argv, const char *envp[]) {
     return -1;
 
   // start up network
-  SimpleMessenger *messenger = new SimpleMessenger(&g_ceph_context);
+  SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context);
   messenger->register_entity(entity_name_t::CLIENT());
   Client *client = new Client(messenger, &mc);
   if (filer_flags) {
@@ -110,7 +110,7 @@ int main(int argc, const char **argv, const char *envp[]) {
     childpid = fork();
   }
 
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   if (childpid == 0) {
     //cout << "child, mounting" << std::endl;
index db912b816c2416db56d3c806b9f19c093bb6153a..c94ed026a77c9980630e598301c1c01cc0a9e589 100644 (file)
@@ -294,7 +294,7 @@ void Client::init()
     char hostname[80];
     gethostname(hostname, 79);
     snprintf(s, sizeof(s), "clients.%s.%d", hostname, getpid());
-    client_logger = new ProfLogger(&g_ceph_context, s, &client_logtype);
+    client_logger = new ProfLogger(g_ceph_context, s, &client_logtype);
   }
   client_logger_lock.Unlock();
 }
@@ -961,7 +961,7 @@ int Client::make_request(MetaRequest *request,
                         bufferlist *pdirbl)
 {
   // time the call
-  utime_t start = ceph_clock_now(&g_ceph_context);
+  utime_t start = ceph_clock_now(g_ceph_context);
   
   bool nojournal = false;
   int op = request->get_op();
@@ -1066,7 +1066,7 @@ int Client::make_request(MetaRequest *request,
   
   // -- log times --
   if (client_logger) {
-    utime_t lat = ceph_clock_now(&g_ceph_context);
+    utime_t lat = ceph_clock_now(g_ceph_context);
     lat -= request->sent_stamp;
     dout(20) << "lat " << lat << dendl;
     client_logger->favg(l_c_lat,(double)lat);
@@ -1249,7 +1249,7 @@ void Client::send_request(MetaRequest *request, int mds)
   r->releases = request->cap_releases;
 
   if (request->mds == -1) {
-    request->sent_stamp = ceph_clock_now(&g_ceph_context);
+    request->sent_stamp = ceph_clock_now(g_ceph_context);
     dout(20) << "send_request set sent_stamp to " << request->sent_stamp << dendl;
   }
   request->mds = mds;
@@ -1504,7 +1504,7 @@ void Client::handle_mds_map(MMDSMap* m)
   dout(1) << "handle_mds_map epoch " << m->get_epoch() << dendl;
 
   MDSMap *oldmap = mdsmap;
-  mdsmap = new MDSMap(&g_ceph_context);
+  mdsmap = new MDSMap(g_ceph_context);
   mdsmap->decode(m->get_encoded());
 
   // reset session
@@ -1691,7 +1691,7 @@ void Client::handle_lease(MClientLease *m)
 
 void Client::release_lease(Inode *in, Dentry *dn, int mask)
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   assert(dn);
 
@@ -1846,7 +1846,7 @@ int Client::get_caps(Inode *in, int need, int want, int *got, loff_t endoff)
 void Client::cap_delay_requeue(Inode *in)
 {
   dout(10) << "cap_delay_requeue on " << *in << dendl;
-  in->hold_caps_until = ceph_clock_now(&g_ceph_context);
+  in->hold_caps_until = ceph_clock_now(g_ceph_context);
   in->hold_caps_until += 5.0;
 
   delayed_caps.push_back(&in->cap_item);
@@ -1956,7 +1956,7 @@ void Client::check_caps(Inode *in, bool is_delayed)
   else
     in->hold_caps_until = utime_t();
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   map<int,InodeCap*>::iterator it = in->caps.begin();
   while (it != in->caps.end()) {
@@ -3190,7 +3190,7 @@ void Client::tick()
   tick_event = new C_C_Tick(this);
   timer.add_event_after(g_conf->client_tick_interval, tick_event);
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   if (mdsmap->get_epoch()) {
     // renew caps?
@@ -3226,7 +3226,7 @@ void Client::tick()
 void Client::renew_caps()
 {
   dout(10) << "renew_caps()" << dendl;
-  last_cap_renew = ceph_clock_now(&g_ceph_context);
+  last_cap_renew = ceph_clock_now(g_ceph_context);
   
   for (map<int,MDSSession*>::iterator p = mds_sessions.begin();
        p != mds_sessions.end();
@@ -3240,7 +3240,7 @@ void Client::renew_caps()
 void Client::renew_caps(const int mds) {
   dout(10) << "renew_caps mds" << mds << dendl;
   MDSSession *session = mds_sessions[mds];
-  session->last_cap_renew_request = ceph_clock_now(&g_ceph_context);
+  session->last_cap_renew_request = ceph_clock_now(g_ceph_context);
   uint64_t seq = ++session->cap_renew_seq;
   messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_RENEWCAPS, seq),
                          mdsmap->get_inst(mds));
@@ -3310,7 +3310,7 @@ int Client::_lookup(Inode *dir, const string& dname, Inode **target)
             << dendl;
 
     // is dn lease valid?
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     if (dn->lease_mds >= 0 && 
        dn->lease_ttl > now &&
        mds_sessions.count(dn->lease_mds)) {
@@ -3357,7 +3357,7 @@ int Client::get_or_create(Inode *dir, const char* name,
     Dentry *dn = *pdn = dir->dir->dentries[name];
     
     // is dn lease valid?
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     if (dn->inode &&
        dn->lease_mds >= 0 && 
        dn->lease_ttl > now &&
@@ -3673,7 +3673,7 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid)
 
   if (!mask) {
     // caller just needs us to bump the ctime
-    in->ctime = ceph_clock_now(&g_ceph_context);
+    in->ctime = ceph_clock_now(g_ceph_context);
     if (issued & CEPH_CAP_AUTH_EXCL)
       mark_caps_dirty(in, CEPH_CAP_AUTH_EXCL);
     else if (issued & CEPH_CAP_FILE_EXCL)
@@ -3686,19 +3686,19 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid)
 
   if (in->caps_issued_mask(CEPH_CAP_AUTH_EXCL)) {
     if (mask & CEPH_SETATTR_MODE) {
-      in->ctime = ceph_clock_now(&g_ceph_context);
+      in->ctime = ceph_clock_now(g_ceph_context);
       in->mode = (in->mode & ~07777) | (attr->st_mode & 07777);
       mark_caps_dirty(in, CEPH_CAP_AUTH_EXCL);
       mask &= ~CEPH_SETATTR_MODE;
     }
     if (mask & CEPH_SETATTR_UID) {
-      in->ctime = ceph_clock_now(&g_ceph_context);
+      in->ctime = ceph_clock_now(g_ceph_context);
       in->uid = attr->st_uid;
       mark_caps_dirty(in, CEPH_CAP_AUTH_EXCL);
       mask &= ~CEPH_SETATTR_UID;
     }
     if (mask & CEPH_SETATTR_GID) {
-      in->ctime = ceph_clock_now(&g_ceph_context);
+      in->ctime = ceph_clock_now(g_ceph_context);
       in->gid = attr->st_gid;
       mark_caps_dirty(in, CEPH_CAP_AUTH_EXCL);
       mask &= ~CEPH_SETATTR_GID;
@@ -3710,7 +3710,7 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid)
        in->mtime = utime_t(attr->st_mtim.tv_sec, attr->st_mtim.tv_nsec);
       if (mask & CEPH_SETATTR_ATIME)
        in->atime = utime_t(attr->st_atim.tv_sec, attr->st_atim.tv_nsec);
-      in->ctime = ceph_clock_now(&g_ceph_context);
+      in->ctime = ceph_clock_now(g_ceph_context);
       in->time_warp_seq++;
       mark_caps_dirty(in, CEPH_CAP_FILE_EXCL);
       mask &= ~(CEPH_SETATTR_MTIME|CEPH_SETATTR_ATIME);
@@ -5055,7 +5055,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf)
   dout(10) << "cur file size is " << in->size << dendl;
 
   // time it.
-  utime_t start = ceph_clock_now(&g_ceph_context);
+  utime_t start = ceph_clock_now(g_ceph_context);
     
   // copy into fresh buffer (since our write may be resub, async)
   bufferptr bp;
@@ -5083,14 +5083,14 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf)
     
     // async, caching, non-blocking.
     objectcacher->file_write(&in->oset, &in->layout, in->snaprealm->get_snap_context(),
-                            offset, size, bl, ceph_clock_now(&g_ceph_context), 0);
+                            offset, size, bl, ceph_clock_now(g_ceph_context), 0);
 
     put_cap_ref(in, CEPH_CAP_FILE_BUFFER);
   } else {
     /*
       // atomic, synchronous, blocking.
       objectcacher->file_atomic_sync_write(in->ino, &in->layout, in->snaprealm->get_snap_context(),
-                                          offset, size, bl, ceph_clock_now(&g_ceph_context), 0, client_lock);
+                                          offset, size, bl, ceph_clock_now(g_ceph_context), 0, client_lock);
     */
     // simple, non-atomic sync write
     Mutex flock("Client::_write flock");
@@ -5103,7 +5103,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf)
     get_cap_ref(in, CEPH_CAP_FILE_BUFFER);  // released by onsafe callback
     
     filer->write_trunc(in->ino, &in->layout, in->snaprealm->get_snap_context(),
-                      offset, size, bl, ceph_clock_now(&g_ceph_context), filer_flags,
+                      offset, size, bl, ceph_clock_now(g_ceph_context), filer_flags,
                       in->truncate_size, in->truncate_seq,
                       onfinish, onsafe);
     
@@ -5112,7 +5112,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf)
   }
 
   // time
-  utime_t lat = ceph_clock_now(&g_ceph_context);
+  utime_t lat = ceph_clock_now(g_ceph_context);
   lat -= start;
   if (client_logger)
     client_logger->favg(l_c_wrlat,(double)lat);
@@ -5135,7 +5135,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf)
   }
 
   // mtime
-  in->mtime = ceph_clock_now(&g_ceph_context);
+  in->mtime = ceph_clock_now(g_ceph_context);
   mark_caps_dirty(in, CEPH_CAP_FILE_WR);
 
   put_cap_ref(in, CEPH_CAP_FILE_WR);
@@ -5474,7 +5474,7 @@ int Client::ll_lookup(vinodeno_t parent, const char *name, struct stat *attr, in
   Inode *diri = 0;
   Inode *in = 0;
   int r = 0;
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   if (inode_map.count(parent) == 0) {
     dout(1) << "ll_lookup " << parent << " " << name << " -> ENOENT (parent DNE... WTF)" << dendl;
index ff5c0557a6eb8f970c4f4220d26e57ba26a976bf..f59089b9a0aa6c69739d57edbdae7dee6ba72fc2 100644 (file)
@@ -559,9 +559,9 @@ class Inode {
     /*cout << "cap_gen     " << cap->session-> cap_gen << std::endl
         << "session gen " << cap->gen << std::endl
         << "cap expire  " << cap->session->cap_ttl << std::endl
-        << "cur time    " << ceph_clock_now(&g_ceph_context) << std::endl;*/
+        << "cur time    " << ceph_clock_now(g_ceph_context) << std::endl;*/
     if ((cap->session->cap_gen <= cap->gen)
-       && (ceph_clock_now(&g_ceph_context) < cap->session->cap_ttl)) {
+       && (ceph_clock_now(g_ceph_context) < cap->session->cap_ttl)) {
       return true;
     }
     //if we make it here, the capabilities aren't up-to-date
index f05342f0952e68ae0821446193a70a95c2a9837f..6c86728b16592b1dbabe37ffa03a475da96db350 100644 (file)
@@ -283,7 +283,7 @@ SyntheticClient::SyntheticClient(Client *client, int w)
   this->iargs = syn_iargs;
   this->sargs = syn_sargs;
 
-  run_start = ceph_clock_now(&g_ceph_context);
+  run_start = ceph_clock_now(g_ceph_context);
 }
 
 
@@ -327,7 +327,7 @@ int SyntheticClient::run()
     return -1;
   }
 
-  //run_start = ceph_clock_now(&g_ceph_context);
+  //run_start = ceph_clock_now(g_ceph_context);
   run_until = utime_t(0,0);
   dout(5) << "run" << dendl;
 
@@ -437,7 +437,7 @@ int SyntheticClient::run()
         iargs.pop_front();
         if (iarg1 && run_me()) {
           dout(2) << "sleepuntil " << iarg1 << dendl;
-          utime_t at = ceph_clock_now(&g_ceph_context) - run_start;
+          utime_t at = ceph_clock_now(g_ceph_context) - run_start;
           if (at.sec() < iarg1) 
             sleep(iarg1 - at.sec());
         }
@@ -791,14 +791,14 @@ int SyntheticClient::run()
          if (iarg1 == 0) iarg1 = 1; // play trace at least once!
 
           for (int i=0; i<iarg1; i++) {
-            utime_t start = ceph_clock_now(&g_ceph_context);
+            utime_t start = ceph_clock_now(g_ceph_context);
             
             if (time_to_stop()) break;
             play_trace(t, prefix, !playdata);
             if (time_to_stop()) break;
             if (iarg1 > 1) clean_dir(prefix);  // clean only if repeat
             
-            utime_t lat = ceph_clock_now(&g_ceph_context);
+            utime_t lat = ceph_clock_now(g_ceph_context);
             lat -= start;
             
             dout(0) << " trace " << tfile << " loop " << (i+1) << "/" << iarg1 << " done in " << (double)lat << " seconds" << dendl;
@@ -1006,7 +1006,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
   char buf[1024];
   char buf2[1024];
 
-  utime_t start = ceph_clock_now(&g_ceph_context);
+  utime_t start = ceph_clock_now(g_ceph_context);
 
   hash_map<int64_t, int64_t> open_files;
   hash_map<int64_t, dir_result_t*>    open_dirs;
@@ -1040,7 +1040,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
   Cond cond;
   bool ack;
   bool safe;
-  C_Gather *safeg = new C_Gather(&g_ceph_context, new C_SafeCond(&lock, &cond, &safe));
+  C_Gather *safeg = new C_Gather(g_ceph_context, new C_SafeCond(&lock, &cond, &safe));
   Context *safegref = safeg->new_sub();  // take a ref
 
   while (!t.end()) {
@@ -1430,7 +1430,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
       bufferlist bl;
       bl.push_back(bp);
       SnapContext snapc;
-      client->objecter->write(oid, oloc, off, len, snapc, bl, ceph_clock_now(&g_ceph_context), 0,
+      client->objecter->write(oid, oloc, off, len, snapc, bl, ceph_clock_now(g_ceph_context), 0,
                              new C_SafeCond(&lock, &cond, &ack),
                              safeg->new_sub());
       while (!ack) cond.Wait(lock);
@@ -1445,7 +1445,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
       object_locator_t oloc(CEPH_DATA_RULE);
       lock.Lock();
       SnapContext snapc;
-      client->objecter->zero(oid, oloc, off, len, snapc, ceph_clock_now(&g_ceph_context), 0,
+      client->objecter->zero(oid, oloc, off, len, snapc, ceph_clock_now(g_ceph_context), 0,
                             new C_SafeCond(&lock, &cond, &ack),
                             safeg->new_sub());
       while (!ack) cond.Wait(lock);
@@ -1756,9 +1756,9 @@ int SyntheticClient::read_dirs(const char *basedir, int dirs, int files, int dep
   dout(3) << "read_dirs " << basedir << " dirs " << dirs << " files " << files << " depth " << depth << dendl;
 
   list<string> contents;
-  utime_t s = ceph_clock_now(&g_ceph_context);
+  utime_t s = ceph_clock_now(g_ceph_context);
   int r = client->getdir(basedir, contents);
-  utime_t e = ceph_clock_now(&g_ceph_context);
+  utime_t e = ceph_clock_now(g_ceph_context);
   e -= s;
   if (r < 0) {
     dout(0) << "read_dirs couldn't readdir " << basedir << ", stopping" << dendl;
@@ -1767,12 +1767,12 @@ int SyntheticClient::read_dirs(const char *basedir, int dirs, int files, int dep
 
   for (int i=0; i<files; i++) {
     snprintf(d, sizeof(d), "%s/file.%d", basedir, i);
-    utime_t s = ceph_clock_now(&g_ceph_context);
+    utime_t s = ceph_clock_now(g_ceph_context);
     if (client->lstat(d, &st) < 0) {
       dout(2) << "read_dirs failed stat on " << d << ", stopping" << dendl;
       return -1;
     }
-    utime_t e = ceph_clock_now(&g_ceph_context);
+    utime_t e = ceph_clock_now(g_ceph_context);
     e -= s;
   }
 
@@ -1810,7 +1810,7 @@ int SyntheticClient::make_files(int num, int count, int priv, bool more)
   
   // files
   struct stat st;
-  utime_t start = ceph_clock_now(&g_ceph_context);
+  utime_t start = ceph_clock_now(g_ceph_context);
   for (int c=0; c<count; c++) {
     for (int n=0; n<num; n++) {
       snprintf(d, sizeof(d), "dir.%d.run%d/file.client%d.%d", priv ? whoami:0, c, whoami, n);
@@ -1827,7 +1827,7 @@ int SyntheticClient::make_files(int num, int count, int priv, bool more)
       if (time_to_stop()) return 0;
     }
   }
-  utime_t end = ceph_clock_now(&g_ceph_context);
+  utime_t end = ceph_clock_now(g_ceph_context);
   end -= start;
   dout(0) << "makefiles time is " << end << " or " << ((double)end / (double)num) <<" per file" << dendl;
   
@@ -1845,24 +1845,24 @@ int SyntheticClient::link_test()
   client->mkdir("orig", 0755);
   client->mkdir("copy", 0755);
 
-  utime_t start = ceph_clock_now(&g_ceph_context);
+  utime_t start = ceph_clock_now(g_ceph_context);
   for (int i=0; i<num; i++) {
     snprintf(d, sizeof(d), "orig/file.%d", i);
     client->mknod(d, 0755);
   }
-  utime_t end = ceph_clock_now(&g_ceph_context);
+  utime_t end = ceph_clock_now(g_ceph_context);
   end -= start;
 
   dout(0) << "orig " << end << dendl;
 
   // link
-  start = ceph_clock_now(&g_ceph_context);
+  start = ceph_clock_now(g_ceph_context);
   for (int i=0; i<num; i++) {
     snprintf(d, sizeof(d), "orig/file.%d", i);
     snprintf(e, sizeof(e), "copy/file.%d", i);
     client->link(d, e);
   }
-  end = ceph_clock_now(&g_ceph_context);
+  end = ceph_clock_now(g_ceph_context);
   end -= start;
   dout(0) << "copy " << end << dendl;
 
@@ -1973,7 +1973,7 @@ int SyntheticClient::write_file(string& fn, int size, loff_t wrsize)   // size i
   dout(5) << "writing to " << fn << " fd " << fd << dendl;
   if (fd < 0) return fd;
   
-  utime_t from = ceph_clock_now(&g_ceph_context);
+  utime_t from = ceph_clock_now(g_ceph_context);
   utime_t start = from;
   uint64_t bytes = 0, total = 0;
 
@@ -2001,7 +2001,7 @@ int SyntheticClient::write_file(string& fn, int size, loff_t wrsize)   // size i
     bytes += wrsize;
     total += wrsize;
 
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     if (now - from >= 1.0) {
       double el = now - from;
       dout(0) << "write " << (bytes / el / 1048576.0) << " MB/sec" << dendl;
@@ -2012,7 +2012,7 @@ int SyntheticClient::write_file(string& fn, int size, loff_t wrsize)   // size i
 
   client->fsync(fd, true);
   
-  utime_t stop = ceph_clock_now(&g_ceph_context);
+  utime_t stop = ceph_clock_now(g_ceph_context);
   double el = stop - start;
   dout(0) << "write total " << (total / el / 1048576.0) << " MB/sec ("
          << total << " bytes in " << el << " seconds)" << dendl;
@@ -2083,7 +2083,7 @@ int SyntheticClient::read_file(const std::string& fn, int size,
   dout(5) << "reading from " << fn << " fd " << fd << dendl;
   if (fd < 0) return fd;
 
-  utime_t from = ceph_clock_now(&g_ceph_context);
+  utime_t from = ceph_clock_now(g_ceph_context);
   utime_t start = from;
   uint64_t bytes = 0, total = 0;
 
@@ -2099,7 +2099,7 @@ int SyntheticClient::read_file(const std::string& fn, int size,
     bytes += rdsize;
     total += rdsize;
 
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     if (now - from >= 1.0) {
       double el = now - from;
       dout(0) << "read " << (bytes / el / 1048576.0) << " MB/sec" << dendl;
@@ -2131,7 +2131,7 @@ int SyntheticClient::read_file(const std::string& fn, int size,
       dout(0) << " + " << (bad-1) << " other bad 16-byte bits in this block" << dendl;
   }
 
-  utime_t stop = ceph_clock_now(&g_ceph_context);
+  utime_t stop = ceph_clock_now(g_ceph_context);
   double el = stop - start;
   dout(0) << "read total " << (total / el / 1048576.0) << " MB/sec ("
          << total << " bytes in " << el << " seconds)" << dendl;
@@ -2211,9 +2211,9 @@ int SyntheticClient::create_objects(int nobj, int osize, int inflight)
     }
     dout(10) << "writing " << oid << dendl;
     
-    starts.push_back(ceph_clock_now(&g_ceph_context));
+    starts.push_back(ceph_clock_now(g_ceph_context));
     client->client_lock.Lock();
-    client->objecter->write(oid, oloc, 0, osize, snapc, bl, ceph_clock_now(&g_ceph_context), 0,
+    client->objecter->write(oid, oloc, 0, osize, snapc, bl, ceph_clock_now(g_ceph_context), 0,
                            new C_Ref(lock, cond, &unack),
                            new C_Ref(lock, cond, &unsafe));
     client->client_lock.Unlock();
@@ -2225,7 +2225,7 @@ int SyntheticClient::create_objects(int nobj, int osize, int inflight)
     }
     lock.Unlock();
     
-    utime_t lat = ceph_clock_now(&g_ceph_context);
+    utime_t lat = ceph_clock_now(g_ceph_context);
     lat -= starts.front();
     starts.pop_front();
   }
@@ -2308,7 +2308,7 @@ int SyntheticClient::object_rw(int nobj, int osize, int wrpc,
     SnapContext snapc;
     
     client->client_lock.Lock();
-    utime_t start = ceph_clock_now(&g_ceph_context);
+    utime_t start = ceph_clock_now(g_ceph_context);
     if (write) {
       dout(10) << "write to " << oid << dendl;
 
@@ -2324,7 +2324,7 @@ int SyntheticClient::object_rw(int nobj, int osize, int wrpc,
         op.op.op = CEPH_OSD_OP_STARTSYNC;
        m.ops.push_back(op);
       }
-      client->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(&g_ceph_context), 0,
+      client->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(g_ceph_context), 0,
                               NULL, new C_Ref(lock, cond, &unack));
       /*client->objecter->write(oid, layout, 0, osize, snapc, bl, 0,
                              new C_Ref(lock, cond, &unack),
@@ -2344,7 +2344,7 @@ int SyntheticClient::object_rw(int nobj, int osize, int wrpc,
     }
     lock.Unlock();
 
-    utime_t lat = ceph_clock_now(&g_ceph_context);
+    utime_t lat = ceph_clock_now(g_ceph_context);
     lat -= start;
     if (client_logger) {
       if (write) 
index 09f739596e02940cec46b888342bf4514e90fbf8..484ef6f04d02007b19d51b7e05a88000b7ed2ed9 100644 (file)
@@ -205,7 +205,7 @@ class SyntheticClient {
   }
 
   bool time_to_stop() {
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     if (0) cout << "time_to_stop .. now " << now 
                << " until " << run_until 
                << " start " << run_start 
index 898f8487bfa556c8f2c77337222b024c3e5185fb..453aeb01e9979978e8ff95a9a3b8b96beacaf83e 100644 (file)
@@ -62,9 +62,9 @@ void usage()
 static int do_cmds_special_action(const std::string &action,
                                  const std::string &dump_file, int rank)
 {
-  SimpleMessenger *messenger = new SimpleMessenger(&g_ceph_context);
+  SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context);
   messenger->bind(getpid());
-  MonClient mc(&g_ceph_context);
+  MonClient mc(g_ceph_context);
   if (mc.build_initial_monmap() < 0)
     return -1;
 
@@ -197,7 +197,7 @@ int main(int argc, const char **argv)
     usage();
   }
 
-  SimpleMessenger *messenger = new SimpleMessenger(&g_ceph_context);
+  SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context);
   messenger->bind(getpid());
   cout << "starting " << g_conf->name << " at " << messenger->get_ms_addr()
        << std::endl;
@@ -217,14 +217,14 @@ int main(int argc, const char **argv)
                        SimpleMessenger::Policy::stateful_server(supported, 0));
 
   if (shadow != MDSMap::STATE_ONESHOT_REPLAY)
-    global_init_daemonize(&g_ceph_context, 0);
-  common_init_finish(&g_ceph_context);
+    global_init_daemonize(g_ceph_context, 0);
+  common_init_finish(g_ceph_context);
 
   // get monmap
-  MonClient mc(&g_ceph_context);
+  MonClient mc(g_ceph_context);
   if (mc.build_initial_monmap() < 0)
     return -1;
-  global_init_chdir(&g_ceph_context);
+  global_init_chdir(g_ceph_context);
 
   messenger->start();
 
index 396d7a5a2e678be0cd689027fbf9295766a3ecd3..ff108ace1c65525d54dc7f417215a23b13590f4f 100644 (file)
@@ -82,7 +82,7 @@ int main(int argc, const char **argv)
 
   // -- mkfs --
   if (mkfs) {
-    common_init_finish(&g_ceph_context);
+    common_init_finish(g_ceph_context);
     if (g_conf->monmap.empty() || !osdmapfn)
       usage();
 
@@ -104,7 +104,7 @@ int main(int argc, const char **argv)
           << error << std::endl;
       exit(1);
     }
-    MonMap monmap(ceph_clock_now(&g_ceph_context));
+    MonMap monmap(ceph_clock_now(g_ceph_context));
     monmap.decode(monmapbl);
     
     err = osdmapbl.read_file(osdmapfn, &error);
@@ -116,7 +116,7 @@ int main(int argc, const char **argv)
 
     // go
     MonitorStore store(g_conf->mon_data);
-    Monitor mon(&g_ceph_context, g_conf->name.get_id(), &store, 0, &monmap);
+    Monitor mon(g_ceph_context, g_conf->name.get_id(), &store, 0, &monmap);
     mon.mkfs(osdmapbl);
     cout << argv[0] << ": created monfs at " << g_conf->mon_data 
         << " for " << g_conf->name << std::endl;
@@ -190,7 +190,7 @@ int main(int argc, const char **argv)
     v++;
 
     // set the version
-    MonMap tmp(ceph_clock_now(&g_ceph_context));
+    MonMap tmp(ceph_clock_now(g_ceph_context));
     tmp.decode(bl);
     if (tmp.get_epoch() != v) {
       cout << "changing monmap epoch from " << tmp.get_epoch() << " to " << v << std::endl;
@@ -213,7 +213,7 @@ int main(int argc, const char **argv)
 
 
   // monmap?
-  MonMap monmap(ceph_clock_now(&g_ceph_context));
+  MonMap monmap(ceph_clock_now(g_ceph_context));
   {
     bufferlist latest;
     store.get_bl_ss(latest, "monmap/latest", 0);
@@ -251,7 +251,7 @@ int main(int argc, const char **argv)
   }
 
   // bind
-  SimpleMessenger *messenger = new SimpleMessenger(&g_ceph_context);
+  SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context);
   int rank = monmap.get_rank(g_conf->name.get_id());
 
   cout << "starting " << g_conf->name << " rank " << rank
@@ -266,11 +266,11 @@ int main(int argc, const char **argv)
   // start monitor
   messenger->register_entity(entity_name_t::MON(rank));
   messenger->set_default_send_priority(CEPH_MSG_PRIO_HIGH);
-  Monitor *mon = new Monitor(&g_ceph_context, g_conf->name.get_id(), &store, messenger, &monmap);
+  Monitor *mon = new Monitor(g_ceph_context, g_conf->name.get_id(), &store, messenger, &monmap);
 
-  global_init_daemonize(&g_ceph_context, 0);
-  common_init_finish(&g_ceph_context);
-  global_init_chdir(&g_ceph_context);
+  global_init_daemonize(g_ceph_context, 0);
+  common_init_finish(g_ceph_context);
+  global_init_chdir(g_ceph_context);
   messenger->start();
 
   uint64_t supported =
index 56d145fc17d286e7a6d6ad26030e58ae0ade53d4..95b452fcd43a59cf400bd2d5aa99fb11cad2a6f8 100644 (file)
@@ -84,10 +84,4 @@ private:
   md_config_obs_t *_prof_logger_conf_obs;
 };
 
-/* Globals (FIXME: remove) */ 
-extern CephContext g_ceph_context;
-extern md_config_t *g_conf;
-extern DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss;
-
-
 #endif
index 1cf31d0c469fd9a5e5d09affe06bc225ebe5a2ad..7d5a785d38a5e6c57acdddf3798d16852639e164 100644 (file)
 /* Global version of the stuff in common/dout.h
  */
 
-#define dout(v) ldout((&g_ceph_context), v)
+#define dout(v) ldout((g_ceph_context), v)
 
-#define pdout(v, p) lpdout((&g_ceph_context), v, p)
+#define pdout(v, p) lpdout((g_ceph_context), v, p)
 
-#define generic_dout(v) lgeneric_dout((&g_ceph_context), v)
+#define generic_dout(v) lgeneric_dout((g_ceph_context), v)
 
-#define derr lderr((&g_ceph_context))
+#define derr lderr((g_ceph_context))
 
-#define generic_derr lgeneric_derr((&g_ceph_context))
+#define generic_derr lgeneric_derr((g_ceph_context))
 
 #endif
index 30fd030c59cb441cb65019dab8806d4fffa29228..c723d7ad09dd29e05bd0582edfc939876beba37e 100644 (file)
@@ -83,7 +83,7 @@ int main(int argc, const char **argv)
   }
 
   if (dump_pg_log) {
-    common_init_finish(&g_ceph_context);
+    common_init_finish(g_ceph_context);
     bufferlist bl;
     std::string error;
     int r = bl.read_file(dump_pg_log, &error);
@@ -122,8 +122,8 @@ int main(int argc, const char **argv)
   }
 
   if (mkfs) {
-    common_init_finish(&g_ceph_context);
-    MonClient mc(&g_ceph_context);
+    common_init_finish(g_ceph_context);
+    MonClient mc(g_ceph_context);
     if (mc.build_initial_monmap() < 0)
       return -1;
     if (mc.get_monmap_privately() < 0)
@@ -141,7 +141,7 @@ int main(int argc, const char **argv)
     *_dout << " for osd" << whoami << " fsid " << mc.monmap.fsid << dendl;
   }
   if (mkkey) {
-    common_init_finish(&g_ceph_context);
+    common_init_finish(g_ceph_context);
     KeyRing *keyring = KeyRing::create_empty();
     if (!keyring) {
       derr << "Unable to get a Ceph keyring." << dendl;
@@ -149,7 +149,7 @@ int main(int argc, const char **argv)
     }
     EntityName ename(g_conf->name);
     EntityAuth eauth;
-    eauth.key.create(&g_ceph_context, CEPH_CRYPTO_AES);
+    eauth.key.create(g_ceph_context, CEPH_CRYPTO_AES);
     keyring->add(ename, eauth);
     bufferlist bl;
     keyring->encode_plaintext(bl);
@@ -163,7 +163,7 @@ int main(int argc, const char **argv)
   if (mkfs || mkkey)
     exit(0);
   if (mkjournal) {
-    common_init_finish(&g_ceph_context);
+    common_init_finish(g_ceph_context);
     int err = OSD::mkjournal(g_conf->osd_data, g_conf->osd_journal);
     if (err < 0) {
       derr << TEXT_RED << " ** ERROR: error creating fresh journal " << g_conf->osd_journal
@@ -176,7 +176,7 @@ int main(int argc, const char **argv)
     exit(0);
   }
   if (flushjournal) {
-    common_init_finish(&g_ceph_context);
+    common_init_finish(g_ceph_context);
     int err = OSD::flushjournal(g_conf->osd_data, g_conf->osd_journal);
     if (err < 0) {
       derr << TEXT_RED << " ** ERROR: error flushing journal " << g_conf->osd_journal
@@ -226,9 +226,9 @@ int main(int argc, const char **argv)
     cluster_addr_set = false;
   }
 
-  SimpleMessenger *client_messenger = new SimpleMessenger(&g_ceph_context);
-  SimpleMessenger *cluster_messenger = new SimpleMessenger(&g_ceph_context);
-  SimpleMessenger *messenger_hb = new SimpleMessenger(&g_ceph_context);
+  SimpleMessenger *client_messenger = new SimpleMessenger(g_ceph_context);
+  SimpleMessenger *cluster_messenger = new SimpleMessenger(g_ceph_context);
+  SimpleMessenger *messenger_hb = new SimpleMessenger(g_ceph_context);
 
   client_messenger->bind(g_conf->public_addr, getpid());
   cluster_messenger->bind(g_conf->cluster_addr, getpid());
@@ -276,12 +276,12 @@ int main(int argc, const char **argv)
 
   // Set up crypto, daemonize, etc.
   // Leave stderr open in case we need to report errors.
-  global_init_daemonize(&g_ceph_context, CINIT_FLAG_NO_CLOSE_STDERR);
-  common_init_finish(&g_ceph_context);
-  MonClient mc(&g_ceph_context);
+  global_init_daemonize(g_ceph_context, CINIT_FLAG_NO_CLOSE_STDERR);
+  common_init_finish(g_ceph_context);
+  MonClient mc(g_ceph_context);
   if (mc.build_initial_monmap() < 0)
     return -1;
-  global_init_chdir(&g_ceph_context);
+  global_init_chdir(g_ceph_context);
 
   OSD *osd = new OSD(whoami, cluster_messenger, client_messenger, messenger_hb, &mc,
                     g_conf->osd_data, g_conf->osd_journal);
@@ -293,7 +293,7 @@ int main(int argc, const char **argv)
   }
 
   // Now close the standard file descriptors
-  global_init_shutdown_stderr(&g_ceph_context);
+  global_init_shutdown_stderr(g_ceph_context);
 
   client_messenger->start();
   messenger_hb->start();
index 5f0da24fa37de54f42c8d11f27ac437136ad45cb..cc58ce53c520c337485775daa904a53cdfcbe5ee 100644 (file)
@@ -47,14 +47,14 @@ int main(int argc, const char **argv, char *envp[])
   argv_to_vec(argc, argv, args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   parse_syn_options(args);   // for SyntheticClient
 
   vec_to_argv(args, argc, argv);
 
   // get monmap
-  MonClient mc(&g_ceph_context);
+  MonClient mc(g_ceph_context);
   if (mc.build_initial_monmap() < 0)
     return -1;
 
@@ -65,10 +65,10 @@ int main(int argc, const char **argv, char *envp[])
 
   cout << "csyn: starting " << g_conf->num_client << " syn client(s)" << std::endl;
   for (int i=0; i<g_conf->num_client; i++) {
-    messengers[i] = new SimpleMessenger(&g_ceph_context);
+    messengers[i] = new SimpleMessenger(g_ceph_context);
     messengers[i]->register_entity(entity_name_t(entity_name_t::TYPE_CLIENT,-1));
     messengers[i]->bind(i * 1000000 + getpid());
-    mclients[i] = new MonClient(&g_ceph_context);
+    mclients[i] = new MonClient(g_ceph_context);
     mclients[i]->build_initial_monmap();
     Client *client = new Client(messengers[i], mclients[i]);
     client->set_filer_flags(syn_filer_flags);
index f5c5782455cae504d7497cf03229558b72186e4d..865e9439dcb99c5a00d41b7d48dc0a1a3af64884 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   // args
   if (args.size() != 4) 
index 3ae0b31045cc85bb706f3b757cf5660fd11bc79b..ec2545cbcf016deff2cddcb1542f0c3d08ff35ea 100644 (file)
 /*
  * Global variables for use from process context.
  */
-CephContext g_ceph_context __attribute__((init_priority(103))) (0);
-md_config_t *g_conf(g_ceph_context._conf);
-DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss(g_ceph_context._doss);
+CephContext *g_ceph_context = new CephContext(0);
+md_config_t *g_conf(g_ceph_context->_conf);
+DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss(g_ceph_context->_doss);
 
 CephContext *get_global_context(void)
 {
-  return &g_ceph_context;
+  return g_ceph_context;
 }
index 248b9415dac1862b489164c778d7e08d104bc5da..6d08867909fb179cc2a80c41b1b183f1659b8a22 100644 (file)
@@ -26,7 +26,7 @@ class DoutStreambuf;
 
 class md_config_t;
 
-extern CephContext g_ceph_context;
+extern CephContext *g_ceph_context;
 extern md_config_t *g_conf;
 extern DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss;
 
index a723744edb57a69125e8c25494055a285770cfeb..e31268e9dcf2c309614828dc2bb412e581ce9f07 100644 (file)
@@ -50,7 +50,7 @@ void install_sighandler(int signum, signal_handler_t handler, int flags)
 
 void sighup_handler(int signum)
 {
-  g_ceph_context.reopen_logs();
+  g_ceph_context->reopen_logs();
 }
 
 static void reraise_fatal(int signum)
index 767ebbbe0d10ed297bc28ccdf3371740180ba453..a99f6b19a6781834fb5f0ace12732d3109bf4148 100644 (file)
@@ -228,7 +228,7 @@ extern "C" int ceph_create(struct ceph_mount_info **cmount, const char * const i
 {
   int ret;
   libceph_init_mutex.Lock();
-  CephContext *cct = &g_ceph_context;
+  CephContext *cct = g_ceph_context;
   if (!libceph_initialized) {
     CephInitParameters iparams(CEPH_ENTITY_TYPE_CLIENT, CEPH_CONF_FILE_DEFAULT);
     iparams.conf_file = "";
index d2016f84e74e459f0b373764d8f9d3bc246b63b5..f2ccfafdcf9e3f65a6115b91018ca1fa659cb426 100644 (file)
@@ -58,7 +58,7 @@ int main(int argc, const char **argv)
   }
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   FOR_EACH_ARG(args) {
     usage_exit();
index 2828e1b695bb14cd90ef7a92f8c157062c99b4d6..1cf58cd374d5e78a20048aa595ab6592d9e679b2 100644 (file)
@@ -3124,7 +3124,7 @@ extern "C" int rados_create(rados_t *pcluster, const char * const id)
     ++rados_initialized;
   }
   else {
-    cct_ = &g_ceph_context;
+    cct_ = g_ceph_context;
   }
   rados_init_mutex.Unlock();
   librados::RadosClient *radosp = new librados::RadosClient(cct_);
index 4fb85475f0c8efbd0b30793db9af22ecc9a636bc..e6b2ac4ecd50f6bc933b77b7eb438c14a6f6c642 100644 (file)
@@ -33,7 +33,7 @@
 
 ostream& CDentry::print_db_line_prefix(ostream& out) 
 {
-  return out << ceph_clock_now(&g_ceph_context) << " mds" << dir->cache->mds->get_nodeid() << ".cache.den(" << dir->ino() << " " << name << ") ";
+  return out << ceph_clock_now(g_ceph_context) << " mds" << dir->cache->mds->get_nodeid() << ".cache.den(" << dir->ino() << " " << name << ") ";
 }
 
 boost::pool<> CDentry::pool(sizeof(CDentry));
index 3c2206885ad982845564080da90620b04215dc1a..4f869a4dccaede9e7cce094d180f24483a8319f3 100644 (file)
@@ -143,7 +143,7 @@ void CDir::print(ostream& out)
 
 ostream& CDir::print_db_line_prefix(ostream& out) 
 {
-  return out << ceph_clock_now(&g_ceph_context) << " mds" << cache->mds->get_nodeid() << ".cache.dir(" << this->dirfrag() << ") ";
+  return out << ceph_clock_now(g_ceph_context) << " mds" << cache->mds->get_nodeid() << ".cache.dir(" << this->dirfrag() << ") ";
 }
 
 
@@ -154,10 +154,10 @@ ostream& CDir::print_db_line_prefix(ostream& out)
 CDir::CDir(CInode *in, frag_t fg, MDCache *mdcache, bool auth) :
   dirty_rstat_inodes(member_offset(CInode, dirty_rstat_item)),
   item_dirty(this), item_new(this),
-  pop_me(ceph_clock_now(&g_ceph_context)),
-  pop_nested(ceph_clock_now(&g_ceph_context)),
-  pop_auth_subtree(ceph_clock_now(&g_ceph_context)),
-  pop_auth_subtree_nested(ceph_clock_now(&g_ceph_context)),
+  pop_me(ceph_clock_now(g_ceph_context)),
+  pop_nested(ceph_clock_now(g_ceph_context)),
+  pop_auth_subtree(ceph_clock_now(g_ceph_context)),
+  pop_auth_subtree_nested(ceph_clock_now(g_ceph_context)),
   bloom(NULL)
 {
   g_num_dir++;
@@ -1174,7 +1174,7 @@ void CDir::finish_waiting(uint64_t mask, int result)
   list<Context*> finished;
   take_waiting(mask, finished);
   if (result < 0)
-    finish_contexts(&g_ceph_context, finished, result);
+    finish_contexts(g_ceph_context, finished, result);
   else
     cache->mds->queue_waiters(finished);
 }
@@ -1576,7 +1576,7 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn)
            in->mark_dirty_rstat();
 
          //in->hack_accessed = false;
-         //in->hack_load_stamp = ceph_clock_now(&g_ceph_context);
+         //in->hack_load_stamp = ceph_clock_now(g_ceph_context);
          //num_new_inodes_loaded++;
        }
       }
@@ -1957,16 +1957,16 @@ void CDir::_commit(version_t want)
   m.priority = CEPH_MSG_PRIO_LOW;  // set priority lower than journal!
 
   if (committed_dn == items.end())
-    cache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(&g_ceph_context), 0, NULL,
+    cache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(g_ceph_context), 0, NULL,
                                  new C_Dir_Committed(this, get_version(),
                                        inode->inode.last_renamed_version));
   else { // send in a different Context
-    C_Gather *gather = new C_Gather(&g_ceph_context, new C_Dir_Committed(this, get_version(),
+    C_Gather *gather = new C_Gather(g_ceph_context, new C_Dir_Committed(this, get_version(),
                                          inode->inode.last_renamed_version));
     while (committed_dn != items.end()) {
       ObjectOperation n = ObjectOperation();
       committed_dn = _commit_partial(n, snaps, max_write_size, committed_dn);
-      cache->mds->objecter->mutate(oid, oloc, n, snapc, ceph_clock_now(&g_ceph_context), 0, NULL,
+      cache->mds->objecter->mutate(oid, oloc, n, snapc, ceph_clock_now(g_ceph_context), 0, NULL,
                                   gather->new_sub());
     }
     /*
@@ -1979,7 +1979,7 @@ void CDir::_commit(version_t want)
      * we simply send the message containing the header off last, we cannot
      * get our header into an incorrect state.
      */
-    cache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(&g_ceph_context), 0, NULL,
+    cache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(g_ceph_context), 0, NULL,
                                 gather->new_sub());
   }
 }
index e53a93e1fba36ef65c3016a1f41a056e0ab3e607..4d0697042ac1e9d1c882823871b7339f9c50bb0e 100644 (file)
@@ -65,7 +65,7 @@ LockType CInode::policylock_type(CEPH_LOCK_IPOLICY);
 //int cinode_pins[CINODE_NUM_PINS];  // counts
 ostream& CInode::print_db_line_prefix(ostream& out)
 {
-  return out << ceph_clock_now(&g_ceph_context) << " mds" << mdcache->mds->get_nodeid() << ".cache.ino(" << inode.ino << ") ";
+  return out << ceph_clock_now(g_ceph_context) << " mds" << mdcache->mds->get_nodeid() << ".cache.ino(" << inode.ino << ") ";
 }
 
 /*
@@ -966,7 +966,7 @@ void CInode::store(Context *fin)
   object_t oid = CInode::get_object_name(ino(), frag_t(), ".inode");
   object_locator_t oloc(mdcache->mds->mdsmap->get_metadata_pg_pool());
 
-  mdcache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(&g_ceph_context), 0,
+  mdcache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(g_ceph_context), 0,
                                 NULL, new C_Inode_Stored(this, get_version(), fin) );
 }
 
@@ -995,7 +995,7 @@ void CInode::fetch(Context *fin)
   dout(10) << "fetch" << dendl;
 
   C_Inode_Fetched *c = new C_Inode_Fetched(this, fin);
-  C_Gather *gather = new C_Gather(&g_ceph_context, c);
+  C_Gather *gather = new C_Gather(g_ceph_context, c);
 
   object_t oid = CInode::get_object_name(ino(), frag_t(), "");
   object_locator_t oloc(mdcache->mds->mdsmap->get_metadata_pg_pool());
@@ -1091,7 +1091,7 @@ void CInode::store_parent(Context *fin)
   object_t oid = get_object_name(ino(), frag_t(), "");
   object_locator_t oloc(mdcache->mds->mdsmap->get_metadata_pg_pool());
 
-  mdcache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(&g_ceph_context), 0,
+  mdcache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(g_ceph_context), 0,
                                 NULL, new C_Inode_StoredParent(this, inode.last_renamed_version, fin) );
 
 }
@@ -2397,7 +2397,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
       cap->issue_norevoke(issue);
       issue = cap->pending();
       cap->set_last_issue();
-      cap->set_last_issue_stamp(ceph_clock_now(&g_ceph_context));
+      cap->set_last_issue_stamp(ceph_clock_now(g_ceph_context));
       e.cap.caps = issue;
       e.cap.wanted = cap->wanted();
       e.cap.cap_id = cap->get_cap_id();
@@ -2654,7 +2654,7 @@ void CInode::decode_import(bufferlist::iterator& p,
   if (dirty) 
     _mark_dirty(ls);
 
-  ::decode(pop, ceph_clock_now(&g_ceph_context), p);
+  ::decode(pop, ceph_clock_now(g_ceph_context), p);
 
   ::decode(replica_map, p);
   if (!replica_map.empty())
index f17a3fa76cc9ed15c741c220baabf72ce9fa9265..dd4f1c2829d78b4e746aad0240973e4560ce9767 100644 (file)
@@ -477,7 +477,7 @@ private:
     item_dirty_dirfrag_dirfragtree(this), 
     auth_pins(0), nested_auth_pins(0),
     nested_anchors(0),
-    pop(ceph_clock_now(&g_ceph_context)),
+    pop(ceph_clock_now(g_ceph_context)),
     versionlock(this, &versionlock_type),
     authlock(this, &authlock_type),
     linklock(this, &linklock_type),
@@ -914,7 +914,7 @@ public:
       cap->reset_seq();
     }
     cap->set_cap_id(icr.cap_id);
-    cap->set_last_issue_stamp(ceph_clock_now(&g_ceph_context));
+    cap->set_last_issue_stamp(ceph_clock_now(g_ceph_context));
     return cap;
   }
   void clear_client_caps_after_export() {
index 49889f4b0f79fcf5dd87d2baddb57fe77e4fd9dd..9b4ca71cf0149b6a84fefa270415d0673019495a 100644 (file)
@@ -193,7 +193,7 @@ void Dumper::undump(const char *dump_file)
   Cond cond;
   
   cout << "writing header " << oid << std::endl;
-  objecter->write_full(oid, oloc, snapc, hbl, ceph_clock_now(&g_ceph_context), 0, 
+  objecter->write_full(oid, oloc, snapc, hbl, ceph_clock_now(g_ceph_context), 0, 
                       NULL, 
                       new C_SafeCond(&lock, &cond, &done));
 
@@ -212,7 +212,7 @@ void Dumper::undump(const char *dump_file)
     uint64_t l = MIN(left, 1024*1024);
     j.read_fd(fd, l);
     cout << " writing " << pos << "~" << l << std::endl;
-    filer.write(ino, &h.layout, snapc, pos, l, j, ceph_clock_now(&g_ceph_context), 0, NULL, new C_SafeCond(&lock, &cond, &done));
+    filer.write(ino, &h.layout, snapc, pos, l, j, ceph_clock_now(g_ceph_context), 0, NULL, new C_SafeCond(&lock, &cond, &done));
 
     lock.Lock();
     while (!done)
index 3f0bd26648a88fd6d1b3657e07b2bc912f2407f3..c722f1106dcdd984a1763dde6afddcdffc228163 100644 (file)
@@ -52,7 +52,7 @@ public:
     Dispatcher(messenger_->cct),
     messenger(messenger_),
     monc(monc_),
-    lock("Dumper::lock"), timer(&g_ceph_context, lock)
+    lock("Dumper::lock"), timer(g_ceph_context, lock)
   {}
 
   virtual ~Dumper();
index 259fd9f3c2fdc1f00cfc222c3f7d793fe52780c9..020864dcf29455c07326d72d8015f9b02ca0641d 100644 (file)
@@ -799,7 +799,7 @@ void Locker::eval_cap_gather(CInode *in, set<CInode*> *issue_set)
       issue_caps(in);
   }
 
-  finish_contexts(&g_ceph_context, finishers);
+  finish_contexts(g_ceph_context, finishers);
 }
 
 void Locker::eval_scatter_gathers(CInode *in)
@@ -820,7 +820,7 @@ void Locker::eval_scatter_gathers(CInode *in)
   if (need_issue && in->is_head())
     issue_caps(in);
   
-  finish_contexts(&g_ceph_context, finishers);
+  finish_contexts(g_ceph_context, finishers);
 }
 
 void Locker::eval(SimpleLock *lock, bool *need_issue)
@@ -1647,7 +1647,7 @@ void Locker::request_inode_file_caps(CInode *in)
   if (wanted != in->replica_caps_wanted) {
 
     if (wanted == 0) {
-      if (in->replica_caps_wanted_keep_until > ceph_clock_now(&g_ceph_context)) {
+      if (in->replica_caps_wanted_keep_until > ceph_clock_now(g_ceph_context)) {
         // ok, release them finally!
         in->replica_caps_wanted_keep_until.sec_ref() = 0;
         dout(7) << "request_inode_file_caps " << ccap_string(wanted)
@@ -1657,7 +1657,7 @@ void Locker::request_inode_file_caps(CInode *in)
                  << dendl;
       }
       else if (in->replica_caps_wanted_keep_until.sec() == 0) {
-        in->replica_caps_wanted_keep_until = ceph_clock_now(&g_ceph_context);
+        in->replica_caps_wanted_keep_until = ceph_clock_now(g_ceph_context);
         in->replica_caps_wanted_keep_until.sec_ref() += 2;
         
         dout(7) << "request_inode_file_caps " << ccap_string(wanted)
@@ -2739,7 +2739,7 @@ void Locker::handle_client_lease(MClientLease *m)
       m->h.seq = ++l->seq;
       m->clear_payload();
       
-      utime_t now = ceph_clock_now(&g_ceph_context);
+      utime_t now = ceph_clock_now(g_ceph_context);
       now += mdcache->client_lease_durations[pool];
       mdcache->touch_client_lease(l, pool, now);
       
@@ -3518,7 +3518,7 @@ void Locker::mark_updated_scatterlock(ScatterLock *lock)
             << " - already on list since " << lock->get_update_stamp() << dendl;
   } else {
     updated_scatterlocks.push_back(lock->get_updated_item());
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     lock->set_update_stamp(now);
     dout(10) << "mark_updated_scatterlock " << *lock
             << " - added at " << now << dendl;
@@ -3639,7 +3639,7 @@ void Locker::scatter_tick()
   dout(10) << "scatter_tick" << dendl;
   
   // updated
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   int n = updated_scatterlocks.size();
   while (!updated_scatterlocks.empty()) {
     ScatterLock *lock = updated_scatterlocks.front();
index 69b725575db6b2e60a3832ef9ae9d6e8a6a74b39..a94147fabe55adae3108bc3fb304a854731d755a 100644 (file)
@@ -71,8 +71,8 @@ int MDBalancer::proc_message(Message *m)
 void MDBalancer::tick()
 {
   static int num_bal_times = g_conf->mds_bal_max;
-  static utime_t first = ceph_clock_now(&g_ceph_context);
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  static utime_t first = ceph_clock_now(g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   utime_t elapsed = now;
   elapsed -= first;
 
@@ -171,7 +171,7 @@ mds_load_t MDBalancer::get_load(utime_t now)
 
 void MDBalancer::send_heartbeat()
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   
   if (mds->mdsmap->is_degraded()) {
     dout(10) << "send_heartbeat degraded" << dendl;
@@ -433,7 +433,7 @@ void MDBalancer::prep_rebalance(int beat)
   } else {
     int cluster_size = mds->get_mds_map()->get_num_mds();
     int whoami = mds->get_nodeid();
-    rebalance_time = ceph_clock_now(&g_ceph_context);
+    rebalance_time = ceph_clock_now(g_ceph_context);
 
     dump_pop_map();
 
@@ -462,7 +462,7 @@ void MDBalancer::prep_rebalance(int beat)
     double total_load = 0;
     multimap<double,int> load_map;
     for (int i=0; i<cluster_size; i++) {
-      map<int, mds_load_t>::value_type val(i, mds_load_t(ceph_clock_now(&g_ceph_context)));
+      map<int, mds_load_t>::value_type val(i, mds_load_t(ceph_clock_now(g_ceph_context)));
       std::pair < map<int, mds_load_t>::iterator, bool > r(mds_load.insert(val));
       mds_load_t &load(r.first->second);
 
@@ -1166,7 +1166,7 @@ void MDBalancer::dump_pop_map()
   if (mds->mdcache->root)
     iq.push_back(mds->mdcache->root);
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   while (!iq.empty()) {
     CInode *in = iq.front();
     iq.pop_front();
index cc6fd2d7bfabe0cae9e29c0952e57a5dc843397f..b4b39cd852faedaa26d601f784982e4f1996123d 100644 (file)
@@ -278,7 +278,7 @@ CInode *MDCache::create_system_inode(inodeno_t ino, int mode)
   in->inode.mode = 0500 | mode;
   in->inode.size = 0;
   in->inode.ctime = 
-    in->inode.mtime = ceph_clock_now(&g_ceph_context);
+    in->inode.mtime = ceph_clock_now(g_ceph_context);
   in->inode.nlink = 1;
   in->inode.truncate_size = -1ull;
 
@@ -742,7 +742,7 @@ void MDCache::adjust_subtree_auth(CDir *dir, pair<int,int> auth, bool do_eval)
 
     // adjust recursive pop counters
     if (dir->is_auth()) {
-      utime_t now = ceph_clock_now(&g_ceph_context);
+      utime_t now = ceph_clock_now(g_ceph_context);
       CDir *p = dir->get_parent_dir();
       while (p) {
        p->pop_auth_subtree.sub(now, decayrate, dir->pop_auth_subtree);
@@ -820,7 +820,7 @@ void MDCache::try_subtree_merge_at(CDir *dir, bool do_eval)
 
     // adjust popularity?
     if (dir->is_auth()) {
-      utime_t now = ceph_clock_now(&g_ceph_context);
+      utime_t now = ceph_clock_now(g_ceph_context);
       CDir *p = dir->get_parent_dir();
       while (p) {
        p->pop_auth_subtree.add(now, decayrate, dir->pop_auth_subtree);
@@ -1811,7 +1811,7 @@ void MDCache::predirty_journal_parents(Mutation *mut, EMetaBlob *blob,
 
   // declare now?
   if (mut->now == utime_t())
-    mut->now = ceph_clock_now(&g_ceph_context);
+    mut->now = ceph_clock_now(g_ceph_context);
 
   if (in->is_base())
     return;
@@ -3607,7 +3607,7 @@ C_Gather *MDCache::parallel_fetch(map<inodeno_t,filepath>& pathmap, set<inodeno_
 {
   dout(10) << "parallel_fetch on " << pathmap.size() << " paths" << dendl;
 
-  C_Gather *gather = new C_Gather(&g_ceph_context);
+  C_Gather *gather = new C_Gather(g_ceph_context);
 
   // scan list
   set<CDir*> fetch_queue;
@@ -4603,7 +4603,7 @@ void MDCache::open_snap_parents()
   dout(10) << "open_snap_parents" << dendl;
   
   map<client_t,MClientSnap*> splits;
-  C_Gather *gather = new C_Gather(&g_ceph_context);
+  C_Gather *gather = new C_Gather(g_ceph_context);
 
   map<CInode*,map<client_t,set<inodeno_t> > >::iterator p = missing_snap_parents.begin();
   while (p != missing_snap_parents.end()) {
@@ -4673,7 +4673,7 @@ void MDCache::open_undef_dirfrags()
        p++) {
     CDir *dir = *p;
     if (!gather)
-      gather = new C_Gather(&g_ceph_context, new C_MDC_OpenUndefDirfragsFinish(this));
+      gather = new C_Gather(g_ceph_context, new C_MDC_OpenUndefDirfragsFinish(this));
     dir->fetch(gather->new_sub());
   }
 
@@ -5047,7 +5047,7 @@ void MDCache::purge_prealloc_ino(inodeno_t ino, Context *fin)
 
   dout(10) << "purge_prealloc_ino " << ino << " oid " << oid << dendl;
   SnapContext snapc;
-  mds->objecter->remove(oid, oloc, snapc, ceph_clock_now(&g_ceph_context), 0, 0, fin);
+  mds->objecter->remove(oid, oloc, snapc, ceph_clock_now(g_ceph_context), 0, 0, fin);
 }  
 
 
@@ -5424,7 +5424,7 @@ void MDCache::trim_inode(CDentry *dn, CInode *in, CDir *con, map<int, MCacheExpi
       mds->logger->inc("outt");
     else {
       mds->logger->inc("outut");
-      mds->logger->favg("oututl", ceph_clock_now(&g_ceph_context) - in->hack_load_stamp);
+      mds->logger->favg("oututl", ceph_clock_now(g_ceph_context) - in->hack_load_stamp);
     }
   }
   */
@@ -5903,7 +5903,7 @@ void MDCache::dentry_remove_replica(CDentry *dn, int from)
 
 void MDCache::trim_client_leases()
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   
   dout(10) << "trim_client_leases" << dendl;
 
@@ -5928,7 +5928,7 @@ void MDCache::trim_client_leases()
 
 void MDCache::check_memory_usage()
 {
-  static MemoryModel mm(&g_ceph_context);
+  static MemoryModel mm(g_ceph_context);
   static MemoryModel::snap last;
   mm.sample(&last);
   static MemoryModel::snap baseline = last;
@@ -5985,7 +5985,7 @@ public:
 
 void MDCache::shutdown_check()
 {
-  dout(0) << "shutdown_check at " << ceph_clock_now(&g_ceph_context) << dendl;
+  dout(0) << "shutdown_check at " << ceph_clock_now(g_ceph_context) << dendl;
 
   // cache
   int o = g_conf->debug_mds;
@@ -7957,7 +7957,7 @@ void MDCache::purge_stray(CDentry *dn)
       uint64_t num = (to + period - 1) / period;
       dout(10) << "purge_stray 0~" << to << " objects 0~" << num << " snapc " << snapc << " on " << *in << dendl;
       mds->filer->purge_range(in->inode.ino, &in->inode.layout, *snapc,
-                             0, num, ceph_clock_now(&g_ceph_context), 0,
+                             0, num, ceph_clock_now(g_ceph_context), 0,
                              new C_MDC_PurgeStrayPurged(this, dn));
     } else {
       dout(10) << "purge_stray 0 objects snapc " << snapc << " on " << *in << dendl;
@@ -8785,7 +8785,7 @@ void MDCache::handle_discover_reply(MDiscoverReply *m)
   }
 
   // waiters
-  finish_contexts(&g_ceph_context, error, -ENOENT);  // finish errors directly
+  finish_contexts(g_ceph_context, error, -ENOENT);  // finish errors directly
   mds->queue_waiters(finished);
 
   // done
@@ -9436,7 +9436,7 @@ void MDCache::split_dir(CDir *dir, int bits)
     return;
   }
 
-  C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDC_FragmentFrozen(this, dirs, dir->get_frag(), bits));
+  C_Gather *gather = new C_Gather(g_ceph_context, new C_MDC_FragmentFrozen(this, dirs, dir->get_frag(), bits));
   fragment_freeze_dirs(dirs, gather);
 
   // initial mark+complete pass
@@ -9470,7 +9470,7 @@ void MDCache::merge_dir(CInode *diri, frag_t frag)
   int bits = first->get_frag().bits() - frag.bits();
   dout(10) << " we are merginb by " << bits << " bits" << dendl;
 
-  C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDC_FragmentFrozen(this, dirs, frag, bits));
+  C_Gather *gather = new C_Gather(g_ceph_context, new C_MDC_FragmentFrozen(this, dirs, frag, bits));
   fragment_freeze_dirs(dirs, gather);
 
   // initial mark+complete pass
@@ -9514,7 +9514,7 @@ void MDCache::fragment_mark_and_complete(list<CDir*>& dirs)
     if (!dir->is_complete()) {
       dout(15) << " fetching incomplete " << *dir << dendl;
       if (!gather)
-       gather = new C_Gather(&g_ceph_context,
+       gather = new C_Gather(g_ceph_context,
                    new C_MDC_FragmentMarking(this, dirs));
       dir->fetch(gather->new_sub(), 
                 true);  // ignore authpinnability
@@ -9641,7 +9641,7 @@ void MDCache::fragment_frozen(list<CDir*>& dirs, frag_t basefrag, int bits)
   */
 
   // freeze, journal, and store resulting frags
-  C_Gather *gather = new C_Gather(&g_ceph_context, 
+  C_Gather *gather = new C_Gather(g_ceph_context, 
                      new C_MDC_FragmentLoggedAndStored(this, mut, 
                                  resultfrags, basefrag, bits));
 
index 41ee11e6d0ad17022de3aeb47ce1613b3765bba2..cff21aed462419d87f1803bdf50508b54fb04eda 100644 (file)
@@ -42,7 +42,7 @@ MDLog::~MDLog()
 {
   if (journaler) { delete journaler; journaler = 0; }
   if (logger) {
-    g_ceph_context.GetProfLoggerCollection()->logger_remove(logger);
+    g_ceph_context->GetProfLoggerCollection()->logger_remove(logger);
     delete logger;
     logger = 0;
   }
@@ -78,8 +78,8 @@ void MDLog::open_logger()
   // logger
   char name[80];
   snprintf(name, sizeof(name), "mds.%s.log", g_conf->name.get_id().c_str());
-  logger = new ProfLogger(&g_ceph_context, name, &mdlog_logtype);
-  g_ceph_context.GetProfLoggerCollection()->logger_add(logger);
+  logger = new ProfLogger(g_ceph_context, name, &mdlog_logtype);
+  g_ceph_context->GetProfLoggerCollection()->logger_add(logger);
 }
 
 void MDLog::init_journaler()
@@ -172,7 +172,7 @@ void MDLog::submit_entry(LogEvent *le, Context *c)
   le->_segment->num_events++;
   le->update_segment();
 
-  le->set_stamp(ceph_clock_now(&g_ceph_context));
+  le->set_stamp(ceph_clock_now(g_ceph_context));
   
   num_events++;
   assert(!capped);
@@ -304,7 +304,7 @@ void MDLog::trim(int m)
   if (segments.empty()) return;
 
   // hack: only trim for a few seconds at a time
-  utime_t stop = ceph_clock_now(&g_ceph_context);
+  utime_t stop = ceph_clock_now(g_ceph_context);
   stop += 2.0;
 
   map<uint64_t,LogSegment*>::iterator p = segments.begin();
@@ -313,7 +313,7 @@ void MDLog::trim(int m)
         ((max_events >= 0 && left-expiring_events-expired_events > max_events) ||
          (max_segments >= 0 && (int)(segments.size()-expiring_segments.size()-expired_segments.size()) > max_segments))) {
 
-    if (stop < ceph_clock_now(&g_ceph_context))
+    if (stop < ceph_clock_now(g_ceph_context))
       break;
 
     if ((int)expiring_segments.size() >= g_conf->mds_log_max_expiring)
@@ -573,7 +573,7 @@ void MDLog::_replay_thread()
   }
 
   dout(10) << "_replay_thread kicking waiters" << dendl;
-  finish_contexts(&g_ceph_context, waitfor_replay, 0);  
+  finish_contexts(g_ceph_context, waitfor_replay, 0);  
 
   dout(10) << "_replay_thread finish" << dendl;
   mds->mds_lock.Unlock();
index 70673109a47fe24c3843554575e34f4452c0a5f8..bbfbcd224d06f0945bcfca062b4ac27645d84e81 100644 (file)
@@ -111,7 +111,7 @@ MDS::MDS(const std::string &n, Messenger *m, MonClient *mc) :
 
   monc->set_messenger(messenger);
 
-  mdsmap = new MDSMap(&g_ceph_context);
+  mdsmap = new MDSMap(g_ceph_context);
   osdmap = new OSDMap;
 
   objecter = new Objecter(messenger, monc, osdmap, mds_lock, timer);
@@ -173,12 +173,12 @@ MDS::~MDS() {
   if (objecter) { delete objecter; objecter = 0; }
 
   if (logger) {
-    g_ceph_context.GetProfLoggerCollection()->logger_remove(logger);
+    g_ceph_context->GetProfLoggerCollection()->logger_remove(logger);
     delete logger;
     logger = 0;
   }
   if (mlogger) {
-    g_ceph_context.GetProfLoggerCollection()->logger_remove(logger);
+    g_ceph_context->GetProfLoggerCollection()->logger_remove(logger);
     delete mlogger;
     mlogger = 0;
   }
@@ -287,19 +287,19 @@ void MDS::open_logger()
           g_conf->name.get_id().c_str(),
            (unsigned long long) monc->get_global_id());
   logger = new ProfLogger(cct, name, (ProfLogType*)&mds_logtype);
-  g_ceph_context.GetProfLoggerCollection()->logger_add(logger);
+  g_ceph_context->GetProfLoggerCollection()->logger_add(logger);
 
   snprintf(name, sizeof(name), "mds.%s.%llu.mem.log",
           g_conf->name.get_id().c_str(),
            (unsigned long long) monc->get_global_id());
   mlogger = new ProfLogger(cct, name, (ProfLogType*)&mdm_logtype);
-  g_ceph_context.GetProfLoggerCollection()->logger_add(mlogger);
+  g_ceph_context->GetProfLoggerCollection()->logger_add(mlogger);
 
   mdlog->open_logger();
   server->open_logger();
 
   {
-    ProfLoggerCollection *coll = g_ceph_context.GetProfLoggerCollection();
+    ProfLoggerCollection *coll = g_ceph_context->GetProfLoggerCollection();
     coll->logger_tare(mdsmap->get_created());
     coll->logger_start();
   }
@@ -575,7 +575,7 @@ void MDS::tick()
   }
 
   // log
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   mds_load_t load = balancer->get_load(now);
   
   if (logger) {
@@ -627,7 +627,7 @@ void MDS::beacon_send()
           << " (currently " << ceph_mds_state_name(state) << ")"
           << dendl;
 
-  beacon_seq_stamp[beacon_last_seq] = ceph_clock_now(&g_ceph_context);
+  beacon_seq_stamp[beacon_last_seq] = ceph_clock_now(g_ceph_context);
   
   MMDSBeacon *beacon = new MMDSBeacon(monc->get_fsid(), monc->get_global_id(), name, mdsmap->get_epoch(), 
                                      want_state, beacon_last_seq);
@@ -651,7 +651,7 @@ bool MDS::is_laggy()
   if (beacon_last_acked_stamp == utime_t())
     return false;
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   utime_t since = now - beacon_last_acked_stamp;
   if (since > g_conf->mds_beacon_grace) {
     dout(5) << "is_laggy " << since << " > " << g_conf->mds_beacon_grace
@@ -672,7 +672,7 @@ void MDS::handle_mds_beacon(MMDSBeacon *m)
   if (beacon_seq_stamp.count(seq)) {
     assert(beacon_seq_stamp[seq] > beacon_last_acked_stamp);
     beacon_last_acked_stamp = beacon_seq_stamp[seq];
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     utime_t rtt = now - beacon_last_acked_stamp;
 
     dout(10) << "handle_mds_beacon " << ceph_mds_state_name(m->get_state())
@@ -854,7 +854,7 @@ void MDS::handle_mds_map(MMDSMap *m)
   entity_addr_t addr;
 
   // decode and process
-  mdsmap = new MDSMap(&g_ceph_context);
+  mdsmap = new MDSMap(g_ceph_context);
   mdsmap->decode(m->get_encoded());
 
   monc->sub_got("mdsmap", mdsmap->get_epoch());
@@ -1116,7 +1116,7 @@ void MDS::boot_create()
 {
   dout(3) << "boot_create" << dendl;
 
-  C_Gather *fin = new C_Gather(&g_ceph_context, new C_MDS_CreateFinish(this));
+  C_Gather *fin = new C_Gather(g_ceph_context, new C_MDS_CreateFinish(this));
 
   mdcache->init_layouts();
 
@@ -1192,7 +1192,7 @@ void MDS::boot_start(int step, int r)
 
   case 1:
     {
-      C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDS_BootStart(this, 2));
+      C_Gather *gather = new C_Gather(g_ceph_context, new C_MDS_BootStart(this, 2));
       dout(2) << "boot_start " << step << ": opening inotable" << dendl;
       inotable->load(gather->new_sub());
 
@@ -1216,7 +1216,7 @@ void MDS::boot_start(int step, int r)
     {
       dout(2) << "boot_start " << step << ": loading/discovering base inodes" << dendl;
 
-      C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDS_BootStart(this, 3));
+      C_Gather *gather = new C_Gather(g_ceph_context, new C_MDS_BootStart(this, 3));
 
       mdcache->open_mydir_inode(gather->new_sub());
 
@@ -1433,7 +1433,7 @@ void MDS::reconnect_start()
     reopen_log();
 
   server->reconnect_clients();
-  finish_contexts(&g_ceph_context, waiting_for_reconnect);
+  finish_contexts(g_ceph_context, waiting_for_reconnect);
 }
 void MDS::reconnect_done()
 {
@@ -1468,7 +1468,7 @@ void MDS::rejoin_done()
 void MDS::clientreplay_start()
 {
   dout(1) << "clientreplay_start" << dendl;
-  finish_contexts(&g_ceph_context, waiting_for_replay);  // kick waiters
+  finish_contexts(g_ceph_context, waiting_for_replay);  // kick waiters
   queue_one_replay();
 }
 
@@ -1487,8 +1487,8 @@ void MDS::active_start()
 
   mdcache->clean_open_file_lists();
   mdcache->scan_stray_dir();
-  finish_contexts(&g_ceph_context, waiting_for_replay);  // kick waiters
-  finish_contexts(&g_ceph_context, waiting_for_active);  // kick waiters
+  finish_contexts(g_ceph_context, waiting_for_replay);  // kick waiters
+  finish_contexts(g_ceph_context, waiting_for_active);  // kick waiters
 }
 
 
@@ -1864,7 +1864,7 @@ bool MDS::_dispatch(Message *m)
 
   // hack: thrash exports
   static utime_t start;
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   if (start == utime_t()) 
     start = now;
   /*double el = now - start;
@@ -2014,7 +2014,7 @@ bool MDS::ms_verify_authorizer(Connection *con, int peer_type,
   Mutex::Locker l(mds_lock);
 
   AuthAuthorizeHandler *authorize_handler =
-      get_authorize_handler(protocol, &g_ceph_context);
+      get_authorize_handler(protocol, g_ceph_context);
   if (!authorize_handler) {
     dout(0) << "No AuthAuthorizeHandler found for protocol " << protocol << dendl;
     is_valid = false;
index 521a4052be929e95853a091293caf363784376d6..afaa2ba78b04fb799989005a051a2c83ab6f9f85 100644 (file)
@@ -67,7 +67,7 @@ void MDSTable::save(Context *onfinish, version_t v)
   object_locator_t oloc(mds->mdsmap->get_metadata_pg_pool());
   mds->objecter->write_full(oid, oloc,
                            snapc,
-                           bl, ceph_clock_now(&g_ceph_context), 0,
+                           bl, ceph_clock_now(g_ceph_context), 0,
                            NULL, new C_MT_Save(this, version));
 }
 
@@ -83,7 +83,7 @@ void MDSTable::save_2(version_t v)
     ls.splice(ls.end(), waitfor_save.begin()->second);
     waitfor_save.erase(waitfor_save.begin());
   }
-  finish_contexts(&g_ceph_context, ls,0);
+  finish_contexts(g_ceph_context, ls,0);
 }
 
 
index f659f32c5aa6dbdd1ade9118f80dab235bfbb749..d25d77b702aa21cef5ae213b62017bef6c18b071 100644 (file)
@@ -942,7 +942,7 @@ void Migrator::export_go_synced(CDir *dir)
   cache->adjust_subtree_auth(dir, mds->get_nodeid(), dest);
 
   // take away the popularity we're sending.
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   mds->balancer->subtract_export(dir, now);
   
   // fill export message with cache data
@@ -1481,8 +1481,8 @@ void Migrator::export_finish(CDir *dir)
   assert(g_conf->mds_kill_export_at != 13);
   
   // finish export (adjust local cache state)
-  C_Contexts *fin = new C_Contexts(&g_ceph_context);
-  finish_export_dir(dir, fin->contexts, ceph_clock_now(&g_ceph_context));
+  C_Contexts *fin = new C_Contexts(g_ceph_context);
+  finish_export_dir(dir, fin->contexts, ceph_clock_now(g_ceph_context));
   dir->add_waiter(CDir::WAIT_UNFREEZE, fin);
 
   // unfreeze
@@ -1858,7 +1858,7 @@ void Migrator::handle_export_dir(MExportDir *m)
   CDir *dir = cache->get_dirfrag(m->dirfrag);
   assert(dir);
   
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   int oldauth = m->get_source().num();
   dout(7) << "handle_export_dir importing " << *dir << " from " << oldauth << dendl;
   assert(dir->is_auth() == false);
index ae585d9adbb5eb65dfad97f1c893e272c69cdf91..08da58b3667793527f11ba056335a87163a09fd5 100644 (file)
@@ -50,7 +50,7 @@ public:
     Dispatcher(messenger_->cct),
     messenger(messenger_),
     monc(monc_),
-    lock("Resetter::lock"), timer(&g_ceph_context, lock)
+    lock("Resetter::lock"), timer(g_ceph_context, lock)
   {}
 
   virtual ~Resetter();
index ceef8048a3f49d71c9e96bdfee52e6d70b0a788a..05198cb2fab135efac7f02857ee2376f54341ab2 100644 (file)
@@ -81,8 +81,8 @@ void Server::open_logger()
 
   char name[80];
   snprintf(name, sizeof(name), "mds.%s.server.log", g_conf->name.get_id().c_str());
-  logger = new ProfLogger(&g_ceph_context, name, &mdserver_logtype);
-  g_ceph_context.GetProfLoggerCollection()->logger_add(logger);
+  logger = new ProfLogger(g_ceph_context, name, &mdserver_logtype);
+  g_ceph_context->GetProfLoggerCollection()->logger_add(logger);
 }
 
 
@@ -403,7 +403,7 @@ void Server::find_idle_sessions()
   
   // timeout/stale
   //  (caps go stale, lease die)
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   utime_t cutoff = now;
   cutoff -= g_conf->mds_session_timeout;  
   while (1) {
@@ -514,7 +514,7 @@ void Server::reconnect_clients()
 
   // clients will get the mdsmap and discover we're reconnecting via the monitor.
   
-  reconnect_start = ceph_clock_now(&g_ceph_context);
+  reconnect_start = ceph_clock_now(g_ceph_context);
   dout(1) << "reconnect_clients -- " << client_reconnect_gather.size() << " sessions" << dendl;
   mds->sessionmap.dump();
 }
@@ -533,7 +533,7 @@ void Server::handle_client_reconnect(MClientReconnect *m)
     return;
   }
 
-  utime_t delay = ceph_clock_now(&g_ceph_context);
+  utime_t delay = ceph_clock_now(g_ceph_context);
   delay -= reconnect_start;
   dout(10) << " reconnect_start " << reconnect_start << " delay " << delay << dendl;
 
@@ -657,7 +657,7 @@ void Server::reconnect_tick()
 {
   utime_t reconnect_end = reconnect_start;
   reconnect_end += g_conf->mds_reconnect_timeout;
-  if (ceph_clock_now(&g_ceph_context) >= reconnect_end &&
+  if (ceph_clock_now(g_ceph_context) >= reconnect_end &&
       !client_reconnect_gather.empty()) {
     dout(10) << "reconnect timed out" << dendl;
     for (set<client_t>::iterator p = client_reconnect_gather.begin();
@@ -830,7 +830,7 @@ void Server::early_reply(MDRequest *mdr, CInode *tracei, CDentry *tracedn)
   mdr->did_early_reply = true;
 
   mds->logger->inc(l_mds_reply);
-  double lat = ceph_clock_now(&g_ceph_context) - mdr->client_request->get_recv_stamp();
+  double lat = ceph_clock_now(g_ceph_context) - mdr->client_request->get_recv_stamp();
   mds->logger->favg(l_mds_replyl, lat);
   dout(20) << "lat " << lat << dendl;
 }
@@ -872,7 +872,7 @@ void Server::reply_request(MDRequest *mdr, MClientReply *reply, CInode *tracei,
   if (!did_early_reply && !is_replay) {
 
     mds->logger->inc(l_mds_reply);
-    double lat = ceph_clock_now(&g_ceph_context) - mdr->client_request->get_recv_stamp();
+    double lat = ceph_clock_now(g_ceph_context) - mdr->client_request->get_recv_stamp();
     mds->logger->favg(l_mds_replyl, lat);
     dout(20) << "lat " << lat << dendl;
     
@@ -965,7 +965,7 @@ void Server::set_trace_dist(Session *session, MClientReply *reply,
   bufferlist bl;
   int whoami = mds->get_nodeid();
   client_t client = session->get_client();
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   dout(20) << "set_trace_dist snapid " << snapid << dendl;
 
@@ -2035,7 +2035,7 @@ void Server::handle_client_stat(MDRequest *mdr)
   if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
     return;
 
-  mds->balancer->hit_inode(ceph_clock_now(&g_ceph_context), ref, META_POP_IRD,
+  mds->balancer->hit_inode(ceph_clock_now(g_ceph_context), ref, META_POP_IRD,
                           mdr->client_request->get_source().num());
 
   // reply
@@ -2400,7 +2400,7 @@ void Server::handle_client_open(MDRequest *mdr)
   }
   
   // hit pop
-  mdr->now = ceph_clock_now(&g_ceph_context);
+  mdr->now = ceph_clock_now(g_ceph_context);
   if (cmode == CEPH_FILE_MODE_RDWR ||
       cmode == CEPH_FILE_MODE_WR) 
     mds->balancer->hit_inode(mdr->now, cur, META_POP_IWR);
@@ -2512,7 +2512,7 @@ void Server::handle_client_openc(MDRequest *mdr)
 
     
   // create inode.
-  mdr->now = ceph_clock_now(&g_ceph_context);
+  mdr->now = ceph_clock_now(g_ceph_context);
 
   SnapRealm *realm = diri->find_snaprealm();   // use directory's realm; inode isn't attached yet.
   snapid_t follows = realm->get_newest_seq();
@@ -2614,7 +2614,7 @@ void Server::handle_client_readdir(MDRequest *mdr)
   dir->verify_fragstat();
 #endif
 
-  mdr->now = ceph_clock_now(&g_ceph_context);
+  mdr->now = ceph_clock_now(g_ceph_context);
 
   snapid_t snapid = mdr->snapid;
 
@@ -2763,7 +2763,7 @@ void Server::handle_client_readdir(MDRequest *mdr)
           << " complete=" << (int)complete << dendl;
 
   // bump popularity.  NOTE: this doesn't quite capture it.
-  mds->balancer->hit_dir(ceph_clock_now(&g_ceph_context), dir, META_POP_IRD, -1, numfiles);
+  mds->balancer->hit_dir(ceph_clock_now(g_ceph_context), dir, META_POP_IRD, -1, numfiles);
   
   // reply
   reply_request(mdr, reply, diri);
@@ -3008,7 +3008,7 @@ void Server::handle_client_setattr(MDRequest *mdr)
 
   pi = cur->project_inode();
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   if (mask & CEPH_SETATTR_MODE)
     pi->mode = (pi->mode & ~07777) | (req->head.args.setattr.mode & 07777);
@@ -3074,7 +3074,7 @@ void Server::do_open_truncate(MDRequest *mdr, int cmode)
 
   // prepare
   inode_t *pi = in->project_inode();
-  pi->mtime = pi->ctime = ceph_clock_now(&g_ceph_context);
+  pi->mtime = pi->ctime = ceph_clock_now(g_ceph_context);
   pi->version = in->pre_dirty();
 
   pi->truncate_from = pi->size;
@@ -3163,7 +3163,7 @@ void Server::handle_client_setlayout(MDRequest *mdr)
   inode_t *pi = cur->project_inode();
   pi->layout = layout;
   pi->version = cur->pre_dirty();
-  pi->ctime = ceph_clock_now(&g_ceph_context);
+  pi->ctime = ceph_clock_now(g_ceph_context);
   
   // log + wait
   mdr->ls = mdlog->get_current_segment();
@@ -3310,7 +3310,7 @@ void Server::handle_client_setxattr(MDRequest *mdr)
   map<string,bufferptr> *px = new map<string,bufferptr>;
   inode_t *pi = cur->project_inode(px);
   pi->version = cur->pre_dirty();
-  pi->ctime = ceph_clock_now(&g_ceph_context);
+  pi->ctime = ceph_clock_now(g_ceph_context);
   pi->xattr_version++;
   px->erase(name);
   (*px)[name] = buffer::create(len);
@@ -3362,7 +3362,7 @@ void Server::handle_client_removexattr(MDRequest *mdr)
   map<string,bufferptr> *px = new map<string,bufferptr>;
   inode_t *pi = cur->project_inode(px);
   pi->version = cur->pre_dirty();
-  pi->ctime = ceph_clock_now(&g_ceph_context);
+  pi->ctime = ceph_clock_now(g_ceph_context);
   pi->xattr_version++;
   px->erase(name);
 
@@ -3465,7 +3465,7 @@ void Server::handle_client_mknod(MDRequest *mdr)
 
   SnapRealm *realm = dn->get_dir()->inode->find_snaprealm();
   snapid_t follows = realm->get_newest_seq();
-  mdr->now = ceph_clock_now(&g_ceph_context);
+  mdr->now = ceph_clock_now(g_ceph_context);
 
   CInode *newi = prepare_new_inode(mdr, dn->get_dir(), inodeno_t(req->head.ino),
                                   req->head.args.mknod.mode, &layout);
@@ -3545,7 +3545,7 @@ void Server::handle_client_mkdir(MDRequest *mdr)
   // new inode
   SnapRealm *realm = dn->get_dir()->inode->find_snaprealm();
   snapid_t follows = realm->get_newest_seq();
-  mdr->now = ceph_clock_now(&g_ceph_context);
+  mdr->now = ceph_clock_now(g_ceph_context);
 
   unsigned mode = req->head.args.mkdir.mode;
   mode &= ~S_IFMT;
@@ -3619,7 +3619,7 @@ void Server::handle_client_symlink(MDRequest *mdr)
   if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
     return;
 
-  mdr->now = ceph_clock_now(&g_ceph_context);
+  mdr->now = ceph_clock_now(g_ceph_context);
   snapid_t follows = dn->get_dir()->inode->find_snaprealm()->get_newest_seq();
 
   unsigned mode = S_IFLNK | 0777;
@@ -3695,7 +3695,7 @@ void Server::handle_client_link(MDRequest *mdr)
 
   // pick mtime
   if (mdr->now == utime_t())
-    mdr->now = ceph_clock_now(&g_ceph_context);
+    mdr->now = ceph_clock_now(g_ceph_context);
 
   // does the target need an anchor?
   if (targeti->is_auth()) {
@@ -4331,7 +4331,7 @@ void Server::handle_client_unlink(MDRequest *mdr)
 
   // yay!
   if (mdr->now == utime_t())
-    mdr->now = ceph_clock_now(&g_ceph_context);
+    mdr->now = ceph_clock_now(g_ceph_context);
 
   // NOTE: this is non-optimal.  we create an anchor at the old
   // location, and then change it.  we can do better, but it's more
@@ -4881,7 +4881,7 @@ void Server::handle_client_rename(MDRequest *mdr)
 
   // -- declare now --
   if (mdr->now == utime_t())
-    mdr->now = ceph_clock_now(&g_ceph_context);
+    mdr->now = ceph_clock_now(g_ceph_context);
 
   // -- prepare witnesses --
 
@@ -4933,7 +4933,7 @@ void Server::handle_client_rename(MDRequest *mdr)
       vector<Anchor> trace;
       destdn->make_anchor_trace(trace, srcdnl->get_inode());
       
-      anchorgather = new C_Gather(&g_ceph_context, new C_MDS_RetryRequest(mdcache, mdr));
+      anchorgather = new C_Gather(g_ceph_context, new C_MDS_RetryRequest(mdcache, mdr));
       mds->anchorclient->prepare_update(srcdnl->get_inode()->ino(), trace, &mdr->more()->src_reanchor_atid, 
                                        anchorgather->new_sub());
     }
@@ -4947,7 +4947,7 @@ void Server::handle_client_rename(MDRequest *mdr)
       straydn->make_anchor_trace(trace, destdnl->get_inode());
       
       if (!anchorgather)
-       anchorgather = new C_Gather(&g_ceph_context, new C_MDS_RetryRequest(mdcache, mdr));
+       anchorgather = new C_Gather(g_ceph_context, new C_MDS_RetryRequest(mdcache, mdr));
       mds->anchorclient->prepare_update(destdnl->get_inode()->ino(), trace, &mdr->more()->dst_reanchor_atid, 
                                        anchorgather->new_sub());
     }
@@ -6108,7 +6108,7 @@ void Server::handle_client_lssnap(MDRequest *mdr)
   map<snapid_t,SnapInfo*> infomap;
   realm->get_snap_info(infomap, diri->get_oldest_snap());
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   __u32 num = 0;
   bufferlist dnbl;
   for (map<snapid_t,SnapInfo*>::iterator p = infomap.begin();
@@ -6209,7 +6209,7 @@ void Server::handle_client_mksnap(MDRequest *mdr)
   }
 
   if (mdr->now == utime_t())
-    mdr->now = ceph_clock_now(&g_ceph_context);
+    mdr->now = ceph_clock_now(g_ceph_context);
 
   // anchor
   if (!diri->is_anchored()) {
@@ -6360,7 +6360,7 @@ void Server::handle_client_rmsnap(MDRequest *mdr)
 
   // journal
   inode_t *pi = diri->project_inode();
-  pi->ctime = ceph_clock_now(&g_ceph_context);
+  pi->ctime = ceph_clock_now(g_ceph_context);
   pi->version = diri->pre_dirty();
   
   mdr->ls = mdlog->get_current_segment();
index cee38eac2dbc327ed906dd141ce46ad9ffa550f0..ec1ee66793fd9b40d4a58715932408176548fd8c 100644 (file)
@@ -57,7 +57,7 @@ public:
     terminating_sessions(false) {
   }
   ~Server() {
-    g_ceph_context.GetProfLoggerCollection()->logger_remove(logger);
+    g_ceph_context->GetProfLoggerCollection()->logger_remove(logger);
     delete logger;
   }
 
index 0a7bfcd23d6bcf9f56c96921766a60be8d0d1ce2..54b684db85daf113388f6b09f113b17d083ba34a 100644 (file)
@@ -84,7 +84,7 @@ void SessionMap::_load_finish(int r, bufferlist &bl)
           << dendl;
   projected = committing = committed = version;
   dump();
-  finish_contexts(&g_ceph_context, waiting_for_load);
+  finish_contexts(g_ceph_context, waiting_for_load);
 }
 
 
@@ -123,7 +123,7 @@ void SessionMap::save(Context *onsave, version_t needv)
 
   mds->objecter->write_full(oid, oloc,
                            snapc,
-                           bl, ceph_clock_now(&g_ceph_context), 0,
+                           bl, ceph_clock_now(g_ceph_context), 0,
                            NULL, new C_SM_Save(this, version));
 }
 
@@ -132,7 +132,7 @@ void SessionMap::_save_finish(version_t v)
   dout(10) << "_save_finish v" << v << dendl;
   committed = v;
 
-  finish_contexts(&g_ceph_context, commit_waiters[v]);
+  finish_contexts(g_ceph_context, commit_waiters[v]);
   commit_waiters.erase(v);
 }
 
@@ -163,7 +163,7 @@ void SessionMap::encode(bufferlist& bl)
 
 void SessionMap::decode(bufferlist::iterator& p)
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   uint64_t pre;
   ::decode(pre, p);
   if (pre == (uint64_t)-1) {
index 9596bc830f0171cfdb6282565be17c754d9f8111..2f209cb6f7045285e5e79b4065c91c146bbf8395 100644 (file)
@@ -268,7 +268,7 @@ public:
     else
       s = session_map[i.name] = new Session;
     s->inst = i;
-    s->last_cap_renew = ceph_clock_now(&g_ceph_context);
+    s->last_cap_renew = ceph_clock_now(g_ceph_context);
     return s;
   }
   void add_session(Session *s) {
@@ -286,7 +286,7 @@ public:
   void touch_session(Session *session) {
     if (session->item_session_list.is_on_list()) {
       by_state[session->state].push_back(&session->item_session_list);
-      session->last_cap_renew = ceph_clock_now(&g_ceph_context);
+      session->last_cap_renew = ceph_clock_now(g_ceph_context);
     } else {
       assert(0);  // hrm, should happen?
     }
index b4b7bb960def1afbc8acd39385aa5625c343c7cc..0f280978fd070623bbbd2aeb4c67f1e83e4181cb 100644 (file)
@@ -102,14 +102,14 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
     dout(20) << " dirty_inode " << **p << dendl;
     assert((*p)->is_auth());
     if ((*p)->is_base()) {
-      if (!gather) gather = new C_Gather(&g_ceph_context);
+      if (!gather) gather = new C_Gather(g_ceph_context);
       (*p)->store(gather->new_sub());
     } else
       commit.insert((*p)->get_parent_dn()->get_dir());
   }
 
   if (!commit.empty()) {
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     
     for (set<CDir*>::iterator p = commit.begin();
         p != commit.end();
@@ -131,7 +131,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
        p != uncommitted_masters.end();
        p++) {
     dout(10) << "try_to_expire waiting for slaves to ack commit on " << *p << dendl;
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     mds->mdcache->wait_for_uncommitted_master(*p, gather->new_sub());
   }
 
@@ -139,19 +139,19 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
   for (elist<CInode*>::iterator p = dirty_dirfrag_dir.begin(); !p.end(); ++p) {
     CInode *in = *p;
     dout(10) << "try_to_expire waiting for dirlock flush on " << *in << dendl;
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     mds->locker->scatter_nudge(&in->filelock, gather->new_sub());
   }
   for (elist<CInode*>::iterator p = dirty_dirfrag_dirfragtree.begin(); !p.end(); ++p) {
     CInode *in = *p;
     dout(10) << "try_to_expire waiting for dirfragtreelock flush on " << *in << dendl;
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     mds->locker->scatter_nudge(&in->dirfragtreelock, gather->new_sub());
   }
   for (elist<CInode*>::iterator p = dirty_dirfrag_nest.begin(); !p.end(); ++p) {
     CInode *in = *p;
     dout(10) << "try_to_expire waiting for nest flush on " << *in << dendl;
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     mds->locker->scatter_nudge(&in->nestlock, gather->new_sub());
   }
 
@@ -195,7 +195,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
       }
     }
     if (le) {
-      if (!gather) gather = new C_Gather(&g_ceph_context);
+      if (!gather) gather = new C_Gather(g_ceph_context);
       mds->mdlog->submit_entry(le, gather->new_sub());
       dout(10) << "try_to_expire waiting for open files to rejournal" << dendl;
     }
@@ -206,7 +206,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
     CInode *in = *p;
     dout(10) << "try_to_expire waiting for dir parent pointer update on " << *in << dendl;
     assert(in->state_test(CInode::STATE_DIRTYPARENT));
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     in->store_parent(gather->new_sub());
   }
 
@@ -217,7 +217,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
     MDSlaveUpdate *su = *p;
     dout(10) << "try_to_expire waiting on slave update " << su << dendl;
     assert(su->waiter == 0);
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     su->waiter = gather->new_sub();
   }
 
@@ -227,7 +227,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
              << ", committed is " << mds->inotable->get_committed_version()
              << " (" << mds->inotable->get_committing_version() << ")"
              << dendl;
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     mds->inotable->save(gather->new_sub(), inotablev);
   }
 
@@ -237,7 +237,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
              << ", committed is " << mds->sessionmap.committed
              << " (" << mds->sessionmap.committing << ")"
              << dendl;
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     mds->sessionmap.save(gather->new_sub(), sessionmapv);
   }
 
@@ -249,7 +249,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
     for (hash_set<version_t>::iterator q = p->second.begin();
         q != p->second.end();
         ++q) {
-      if (!gather) gather = new C_Gather(&g_ceph_context);
+      if (!gather) gather = new C_Gather(g_ceph_context);
       dout(10) << "try_to_expire " << get_mdstable_name(p->first) << " transaction " << *q 
               << " pending commit (not yet acked), waiting" << dendl;
       assert(!client->has_committed(*q));
@@ -265,7 +265,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
     if (p->second > server->get_committed_version()) {
       dout(10) << "try_to_expire waiting for " << get_mdstable_name(p->first) 
               << " to save, need " << p->second << dendl;
-      if (!gather) gather = new C_Gather(&g_ceph_context);
+      if (!gather) gather = new C_Gather(g_ceph_context);
       server->save(gather->new_sub());
     }
   }
@@ -275,7 +275,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
        p != truncating_inodes.end();
        p++) {
     dout(10) << "try_to_expire waiting for truncate of " << **p << dendl;
-    if (!gather) gather = new C_Gather(&g_ceph_context);
+    if (!gather) gather = new C_Gather(g_ceph_context);
     (*p)->add_waiter(CInode::WAIT_TRUNC, gather->new_sub());
   }
   
index 0f7e1788a9b77352df97dd3db4dd7fccc27da3ae..c8aa8991cc51875e4f9a772edcac7723e5385105 100644 (file)
@@ -1036,7 +1036,7 @@ inline void decode(dirfrag_load_vec_t& c, const utime_t &t, bufferlist::iterator
 inline ostream& operator<<(ostream& out, dirfrag_load_vec_t& dl)
 {
   // ugliness!
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   DecayRate rate(g_conf->mds_decay_halflife);
   return out << "[" << dl.vec[0].get(now, rate) << "," << dl.vec[1].get(now, rate) 
             << " " << dl.meta_load(now, rate)
@@ -1134,7 +1134,7 @@ public:
   DecayCounter count;
 
 public:
-  load_spread_t() : p(0), n(0), count(ceph_clock_now(&g_ceph_context))
+  load_spread_t() : p(0), n(0), count(ceph_clock_now(g_ceph_context))
   {
     for (int i=0; i<MAX; i++)
       last[i] = -1;
@@ -1517,7 +1517,7 @@ protected:
   void finish_waiting(uint64_t mask, int result = 0) {
     list<Context*> finished;
     take_waiting(mask, finished);
-    finish_contexts(&g_ceph_context, finished, result);
+    finish_contexts(g_ceph_context, finished, result);
   }
 
 
index f3f9416f1b9f9997de126d73355f82f070cfc00f..a2d8a6a85688e18b7b2bb8ca4bd8359e68f1a6a3 100644 (file)
@@ -66,7 +66,7 @@ class MMonPaxos : public Message {
     op(o), machine_id(mid),
     first_committed(0), last_committed(0), pn_from(0), pn(0), uncommitted_pn(0),
     latest_version(0) {
-    sent_timestamp = ceph_clock_now(&g_ceph_context);
+    sent_timestamp = ceph_clock_now(g_ceph_context);
   }
 
 private:
index 0a64440e4be8c36953f62df8c932909e29674e3e..7d02efaa46249537466cae8f36b963549573db59 100644 (file)
@@ -94,7 +94,7 @@ void AuthMonitor::create_initial(bufferlist& bl)
   dout(10) << "create_initial -- creating initial map" << dendl;
 
   KeyRing keyring;
-  if (keyring.load(&g_ceph_context, g_conf->keyring) == 0) {
+  if (keyring.load(g_ceph_context, g_conf->keyring) == 0) {
     import_keyring(keyring);
   }
 
@@ -365,7 +365,7 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable)
       goto reply;
     }
 
-    s->auth_handler = get_auth_service_handler(&g_ceph_context,
+    s->auth_handler = get_auth_service_handler(g_ceph_context,
                                               &mon->key_server, supported);
     if (!s->auth_handler) {
       ret = -ENOTSUP;
index a3c7f206097b73565196cc5ce7066efd2319ec20..e4acab0481140a2402344de179bb41dad7551a09 100644 (file)
@@ -67,7 +67,7 @@ void Elector::start()
   // start by trying to elect me
   if (epoch % 2 == 0) 
     bump_epoch(epoch+1);  // odd == election cycle
-  start_stamp = ceph_clock_now(&g_ceph_context);
+  start_stamp = ceph_clock_now(g_ceph_context);
   electing_me = true;
   acked_me.insert(mon->rank);
 
@@ -95,7 +95,7 @@ void Elector::defer(int who)
 
   // ack them
   leader_acked = who;
-  ack_stamp = ceph_clock_now(&g_ceph_context);
+  ack_stamp = ceph_clock_now(g_ceph_context);
   mon->messenger->send_message(new MMonElection(MMonElection::OP_ACK, epoch, mon->monmap),
                               mon->monmap->get_inst(who));
   
@@ -285,7 +285,7 @@ void Elector::dispatch(Message *m)
     {
       MMonElection *em = (MMonElection*)m;
 
-      MonMap *peermap = new MonMap(ceph_clock_now(&g_ceph_context));
+      MonMap *peermap = new MonMap(ceph_clock_now(g_ceph_context));
       peermap->decode(em->monmap_bl);
       if (peermap->epoch > mon->monmap->epoch) {
        dout(0) << m->get_source_inst() << " has newer monmap epoch " << peermap->epoch
index 6a3f1e2d071f1d4a52d2228fe6ecad339bd65e26..5b8605dc80cde8274db8b4bf77638b83f32cfbef 100644 (file)
@@ -81,7 +81,7 @@ void LogMonitor::create_initial(bufferlist& bl)
   dout(10) << "create_initial -- creating initial map" << dendl;
   LogEntry e;
   memset(&e.who, 0, sizeof(e.who));
-  e.stamp = ceph_clock_now(&g_ceph_context);
+  e.stamp = ceph_clock_now(g_ceph_context);
   e.type = CLOG_INFO;
   std::stringstream ss;
   ss << "mkfs " << mon->monmap->get_fsid();
index 99b92feb10da11feaab261f0714456cb61d8ec8e..d5c797eb83de3a0be1806839864e9e93caeae615 100644 (file)
@@ -56,7 +56,7 @@ void MDSMonitor::print_map(MDSMap &m, int dbl)
 void MDSMonitor::create_new_fs(MDSMap &m, int metadata_pool, int data_pool)
 {
   m.max_mds = g_conf->max_mds;
-  m.created = ceph_clock_now(&g_ceph_context);
+  m.created = ceph_clock_now(g_ceph_context);
   m.data_pg_pools.push_back(data_pool);
   m.metadata_pg_pool = metadata_pool;
   m.cas_pg_pool = -1;
@@ -112,7 +112,7 @@ void MDSMonitor::encode_pending(bufferlist &bl)
 {
   dout(10) << "encode_pending e" << pending_mdsmap.epoch << dendl;
 
-  pending_mdsmap.modified = ceph_clock_now(&g_ceph_context);
+  pending_mdsmap.modified = ceph_clock_now(g_ceph_context);
 
   //print_map(pending_mdsmap);
 
@@ -150,7 +150,7 @@ void MDSMonitor::_note_beacon(MMDSBeacon *m)
   version_t seq = m->get_seq();
 
   dout(15) << "_note_beacon " << *m << " noting time" << dendl;
-  last_beacon[gid].stamp = ceph_clock_now(&g_ceph_context);  
+  last_beacon[gid].stamp = ceph_clock_now(g_ceph_context);  
   last_beacon[gid].seq = seq;
 }
 
@@ -360,7 +360,7 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m)
     }
 
     // initialize the beacon timer
-    last_beacon[gid].stamp = ceph_clock_now(&g_ceph_context);
+    last_beacon[gid].stamp = ceph_clock_now(g_ceph_context);
     last_beacon[gid].seq = seq;
 
     // new incompat?
@@ -500,7 +500,7 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
          p = 0;
          r = -ENOENT;
        } else {
-         p = new MDSMap(&g_ceph_context);
+         p = new MDSMap(g_ceph_context);
          p->decode(b);
        }
       }
@@ -522,7 +522,7 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
        if (!b.length()) {
          r = -ENOENT;
        } else {
-         MDSMap m(&g_ceph_context);
+         MDSMap m(g_ceph_context);
          m.decode(b);
          m.encode(rdata);
          ss << "got mdsmap epoch " << m.get_epoch();
@@ -631,7 +631,7 @@ int MDSMonitor::fail_mds(std::ostream &ss, const std::string &arg)
   if (pending_mdsmap.up.count(w)) {
     uint64_t gid = pending_mdsmap.up[w];
     if (pending_mdsmap.mds_info.count(gid)) {
-      utime_t until = ceph_clock_now(&g_ceph_context);
+      utime_t until = ceph_clock_now(g_ceph_context);
       until += g_conf->mds_blacklist_interval;
       MDSMap::mds_info_t& info = pending_mdsmap.mds_info[pending_mdsmap.up[w]];
       pending_mdsmap.last_failure_osd_epoch = mon->osdmon()->blacklist(info.addr, until);
@@ -662,7 +662,7 @@ int MDSMonitor::cluster_fail(std::ostream &ss)
   // --- reset the cluster map ---
   if (pending_mdsmap.mds_info.size()) {
     // blacklist all old mds's
-    utime_t until = ceph_clock_now(&g_ceph_context);
+    utime_t until = ceph_clock_now(g_ceph_context);
     until += g_conf->mds_blacklist_interval;
     for (map<int32_t,uint64_t>::iterator p = pending_mdsmap.up.begin();
         p != pending_mdsmap.up.end();
@@ -715,7 +715,7 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
       ss << "max_mds = " << pending_mdsmap.max_mds;
     }
     else if (m->cmd[1] == "setmap" && m->cmd.size() == 3) {
-      MDSMap map(&g_ceph_context);
+      MDSMap map(g_ceph_context);
       map.decode(m->get_data());
       epoch_t e = atoi(m->cmd[2].c_str());
       //if (ceph_fsid_compare(&map.get_fsid(), &mon->monmap->fsid) == 0) {
@@ -812,7 +812,7 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
        }
       }
     } else if (m->cmd[1] == "newfs" && m->cmd.size() == 4) {
-      MDSMap newmap(&g_ceph_context);
+      MDSMap newmap(g_ceph_context);
       int metadata = atoi(m->cmd[2].c_str());
       int data = atoi(m->cmd[3].c_str());
       pending_mdsmap = newmap;
@@ -905,7 +905,7 @@ void MDSMonitor::tick()
   }
 
   // check beacon timestamps
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   utime_t cutoff = now;
   cutoff -= g_conf->mds_beacon_grace;
 
@@ -918,7 +918,7 @@ void MDSMonitor::tick()
       dout(10) << " adding " << p->second.addr << " mds" << info.rank << "." << info.inc
               << " " << ceph_mds_state_name(info.state)
               << " to last_beacon" << dendl;
-      last_beacon[p->first].stamp = ceph_clock_now(&g_ceph_context);
+      last_beacon[p->first].stamp = ceph_clock_now(g_ceph_context);
       last_beacon[p->first].seq = 0;
     }
   }
@@ -1162,7 +1162,7 @@ void MDSMonitor::do_stop()
     case MDSMap::STATE_CLIENTREPLAY:
       // BUG: hrm, if this is the case, the STOPPING guys won't be able to stop, will they?
       {
-       utime_t until = ceph_clock_now(&g_ceph_context);
+       utime_t until = ceph_clock_now(g_ceph_context);
        until += g_conf->mds_blacklist_interval;
        pending_mdsmap.last_failure_osd_epoch = mon->osdmon()->blacklist(info.addr, until);
        propose_osdmap = true;
index 7150fbf547efc997417697bef3a2c52a7d143cc6..8abf44cdce4ad639e975fb81e82eca045ea6d5fd 100644 (file)
@@ -105,8 +105,8 @@ class MDSMonitor : public PaxosService {
 public:
   MDSMonitor(Monitor *mn, Paxos *p)
     : PaxosService(mn, p),
-      mdsmap(&g_ceph_context),
-      pending_mdsmap(&g_ceph_context)
+      mdsmap(g_ceph_context),
+      pending_mdsmap(g_ceph_context)
   {
   }
 
index d9a5d792f6b8d490141b3dd9e55fe45e5b98a96c..863a9538c47bf7fa2904f2110badf16fd170a767 100644 (file)
@@ -263,7 +263,7 @@ epoch_t Monitor::get_epoch()
 void Monitor::win_election(epoch_t epoch, set<int>& active) 
 {
   state = STATE_LEADER;
-  leader_since = ceph_clock_now(&g_ceph_context);
+  leader_since = ceph_clock_now(g_ceph_context);
   leader = rank;
   quorum = active;
   dout(10) << "win_election, epoch " << epoch << " quorum is " << quorum << dendl;
@@ -499,7 +499,7 @@ void Monitor::forward_request_leader(PaxosServiceMessage *req)
   } else if (session && !session->closed) {
     RoutedRequest *rr = new RoutedRequest;
     rr->tid = ++routed_request_tid;
-    encode_message(&g_ceph_context, req, rr->request_bl);
+    encode_message(g_ceph_context, req, rr->request_bl);
     rr->session = (MonSession *)session->get();
     routed_requests[rr->tid] = rr;
     session->routed_request_tids.insert(rr->tid);
@@ -556,7 +556,7 @@ void Monitor::try_send_message(Message *m, entity_inst_t to)
   dout(10) << "try_send_message " << *m << " to " << to << dendl;
 
   bufferlist bl;
-  encode_message(&g_ceph_context, m, bl);
+  encode_message(g_ceph_context, m, bl);
 
   messenger->send_message(m, to);
 
@@ -744,7 +744,7 @@ bool Monitor::_ms_dispatch(Message *m)
        dout(10) << "setting timeout on session" << dendl;
        // set an initial timeout here, so we will trim this session even if they don't
        // do anything.
-       s->until = ceph_clock_now(&g_ceph_context);
+       s->until = ceph_clock_now(g_ceph_context);
        s->until += g_conf->mon_subscribe_interval;
       } else {
        //give it monitor caps; the peer type has been authenticated
@@ -903,7 +903,7 @@ void Monitor::handle_subscribe(MMonSubscribe *m)
     return;
   }
 
-  s->until = ceph_clock_now(&g_ceph_context);
+  s->until = ceph_clock_now(g_ceph_context);
   s->until += g_conf->mon_subscribe_interval;
   for (map<string,ceph_mon_subscribe_item>::iterator p = m->what.begin();
        p != m->what.end();
@@ -1037,7 +1037,7 @@ void Monitor::tick()
     (*p)->tick();
   
   // trim sessions
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   xlist<MonSession*>::iterator p = session_map.sessions.begin();
   while (!p.end()) {
     MonSession *s = *p;
@@ -1131,7 +1131,7 @@ bool Monitor::ms_get_authorizer(int service_id, AuthAuthorizer **authorizer, boo
   if (service_id != CEPH_ENTITY_TYPE_MON)
     return false;
 
-  if (!is_supported_auth(CEPH_AUTH_CEPHX, &g_ceph_context))
+  if (!is_supported_auth(CEPH_AUTH_CEPHX, g_ceph_context))
     return false;
 
   CephXServiceTicketInfo auth_ticket_info;
@@ -1169,7 +1169,7 @@ bool Monitor::ms_get_authorizer(int service_id, AuthAuthorizer **authorizer, boo
   ::encode(blob, ticket_data);
 
   bufferlist::iterator iter = ticket_data.begin();
-  CephXTicketHandler handler(&g_ceph_context, service_id);
+  CephXTicketHandler handler(g_ceph_context, service_id);
   ::decode(handler.ticket, iter);
 
   handler.session_key = info.session_key;
@@ -1188,7 +1188,7 @@ bool Monitor::ms_verify_authorizer(Connection *con, int peer_type,
           << " protocol " << protocol << dendl;
 
   if (peer_type == CEPH_ENTITY_TYPE_MON &&
-      is_supported_auth(CEPH_AUTH_CEPHX, &g_ceph_context)) {
+      is_supported_auth(CEPH_AUTH_CEPHX, g_ceph_context)) {
     // monitor, and cephx is enabled
     isvalid = false;
     if (protocol == CEPH_AUTH_CEPHX) {
@@ -1196,7 +1196,7 @@ bool Monitor::ms_verify_authorizer(Connection *con, int peer_type,
       CephXServiceTicketInfo auth_ticket_info;
       
       if (authorizer_data.length()) {
-       int ret = cephx_verify_authorizer(&g_ceph_context, &key_server, iter,
+       int ret = cephx_verify_authorizer(g_ceph_context, &key_server, iter,
                                          auth_ticket_info, authorizer_reply);
        if (ret >= 0)
          isvalid = true;
index 176b35786d1a5bac07d2e2bae581a907f11fd949..0050c4dcfe08b93c4471dc92b33fce5ba8eb2a79 100644 (file)
@@ -87,7 +87,7 @@ void MonmapMonitor::create_pending()
 {
   pending_map = *mon->monmap;
   pending_map.epoch++;
-  pending_map.last_changed = ceph_clock_now(&g_ceph_context);
+  pending_map.last_changed = ceph_clock_now(g_ceph_context);
   dout(10) << "create_pending monmap epoch " << pending_map.epoch << dendl;
 }
 
@@ -203,7 +203,7 @@ bool MonmapMonitor::prepare_command(MMonCommand *m)
       }
 
       pending_map.add(name, addr);
-      pending_map.last_changed = ceph_clock_now(&g_ceph_context);
+      pending_map.last_changed = ceph_clock_now(g_ceph_context);
       ss << "added mon." << name << " at " << addr;
       getline(ss, rs);
       paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
@@ -219,7 +219,7 @@ bool MonmapMonitor::prepare_command(MMonCommand *m)
 
       entity_addr_t addr = pending_map.get_addr(name);
       pending_map.remove(name);
-      pending_map.last_changed = ceph_clock_now(&g_ceph_context);
+      pending_map.last_changed = ceph_clock_now(g_ceph_context);
       ss << "removed mon." << name << " at " << addr << ", there are now " << pending_map.size() << " monitors" ;
       getline(ss, rs);
       // send reply immediately in case we get removed
index be987f6bfddab967ada1d33c39db584e080138ed..8322c55a928ee4abc9eb0497ff40bdb99aa8526a 100644 (file)
@@ -37,7 +37,7 @@ class MMonCommand;
 class MonmapMonitor : public PaxosService {
  public:
   MonmapMonitor(Monitor *mn, Paxos *p) 
-    : PaxosService(mn, p), pending_map(ceph_clock_now(&g_ceph_context))
+    : PaxosService(mn, p), pending_map(ceph_clock_now(g_ceph_context))
   {
   }
   MonMap pending_map; //the pending map awaiting passage
index 20b975483c0c1dbc75c302826a60f21526939f66..63e09f81539287a3509dff14b54a9e86a1adb26f 100644 (file)
@@ -61,7 +61,7 @@ void OSDMonitor::create_initial(bufferlist& bl)
   newmap.decode(bl);
   newmap.set_epoch(1);
   newmap.set_fsid(mon->monmap->fsid);
-  newmap.created = newmap.modified = ceph_clock_now(&g_ceph_context);
+  newmap.created = newmap.modified = ceph_clock_now(g_ceph_context);
 
   // encode into pending incremental
   newmap.encode(pending_inc.fullmap);
@@ -113,7 +113,7 @@ bool OSDMonitor::update_from_paxos()
     if (osdmap.is_down(o) && osdmap.is_in(o) &&
        down_pending_out.count(o) == 0) {
       dout(10) << " adding osd" << o << " to down_pending_out map" << dendl;
-      down_pending_out[o] = ceph_clock_now(&g_ceph_context);
+      down_pending_out[o] = ceph_clock_now(g_ceph_context);
     }
 
   if (mon->is_leader()) {
@@ -240,7 +240,7 @@ void OSDMonitor::encode_pending(bufferlist &bl)
           << dendl;
   
   // finalize up pending_inc
-  pending_inc.modified = ceph_clock_now(&g_ceph_context);
+  pending_inc.modified = ceph_clock_now(g_ceph_context);
 
   // tell me about it
   for (map<int32_t,uint8_t>::iterator i = pending_inc.new_state.begin();
@@ -990,7 +990,7 @@ void OSDMonitor::tick()
   bool do_propose = false;
 
   // mark down osds out?
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   map<int,utime_t>::iterator i = down_pending_out.begin();
   while (i != down_pending_out.end()) {
     int o = i->first;
@@ -1588,7 +1588,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
        ss << "unable to parse address " << m->cmd[3];
       else if (m->cmd[2] == "add") {
 
-       utime_t expires = ceph_clock_now(&g_ceph_context);
+       utime_t expires = ceph_clock_now(g_ceph_context);
        double d = 60*60;  // 1 hour default
        if (m->cmd.size() > 4)
          d = atof(m->cmd[4].c_str());
@@ -1637,7 +1637,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
              pp = &pending_inc.new_pools[pool];
              *pp = *p;
            }
-           pp->add_snap(snapname.c_str(), ceph_clock_now(&g_ceph_context));
+           pp->add_snap(snapname.c_str(), ceph_clock_now(g_ceph_context));
            pp->set_snap_epoch(pending_inc.epoch);
            ss << "created pool " << m->cmd[3] << " snap " << snapname;
            getline(ss, rs);
@@ -1942,7 +1942,7 @@ bool OSDMonitor::prepare_pool_op(MPoolOp *m)
 
   switch (m->op) {
   case POOL_OP_CREATE_SNAP:
-    pp->add_snap(m->name.c_str(), ceph_clock_now(&g_ceph_context));
+    pp->add_snap(m->name.c_str(), ceph_clock_now(g_ceph_context));
     dout(10) << "create snap in pool " << m->pool << " " << m->name << " seq " << pp->get_snap_epoch() << dendl;
     break;
 
index c6a71a4a4f7b0b767cc93542b56cffd37c8ae167..7d3acc624bb09c6d7371e6a229ec52605b3a3fe2 100644 (file)
@@ -129,7 +129,7 @@ bool PGMonitor::update_from_paxos()
   } 
 
   // walk through incrementals
-  utime_t now(ceph_clock_now(&g_ceph_context));
+  utime_t now(ceph_clock_now(g_ceph_context));
   while (paxosv > pg_map.version) {
     bufferlist bl;
     bool success = paxos->read(pg_map.version+1, bl);
@@ -185,7 +185,7 @@ void PGMonitor::handle_osd_timeouts()
 {
   if (!mon->is_leader())
     return;
-  utime_t now(ceph_clock_now(&g_ceph_context));
+  utime_t now(ceph_clock_now(g_ceph_context));
   utime_t timeo(g_conf->mon_osd_report_timeout, 0);
   if (now - mon->get_leader_since() < timeo) {
     // We haven't been the leader for long enough to consider OSD timeouts
@@ -392,7 +392,7 @@ bool PGMonitor::prepare_pg_stats(MPGStats *stats)
     return false;
   }
 
-  last_osd_report[from] = ceph_clock_now(&g_ceph_context);
+  last_osd_report[from] = ceph_clock_now(g_ceph_context);
 
   if (!stats->get_orig_source().is_osd() ||
       !mon->osdmon()->osdmap.is_up(from) ||
@@ -695,7 +695,7 @@ void PGMonitor::send_pg_creates()
   dout(10) << "send_pg_creates to " << pg_map.creating_pgs.size() << " pgs" << dendl;
 
   map<int, MOSDPGCreate*> msg;
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   
   OSDMap *osdmap = &mon->osdmon()->osdmap;
   int max = MIN(osdmap->get_max_osd(), osdmap->crush.get_max_devices());
@@ -739,7 +739,7 @@ void PGMonitor::send_pg_creates()
        p++) {
     dout(10) << "sending pg_create to osd" << p->first << dendl;
     mon->messenger->send_message(p->second, mon->osdmon()->osdmap.get_inst(p->first));
-    last_sent_pg_create[p->first] = ceph_clock_now(&g_ceph_context);
+    last_sent_pg_create[p->first] = ceph_clock_now(g_ceph_context);
   }
 }
 
index 803bf705ca3f6e2ea996dd35d3148f2b3549e1ce..bc8e3af2b854ef2308a438bd30438ba42c3a33da 100644 (file)
@@ -294,9 +294,9 @@ void Paxos::handle_last(MMonPaxos *last)
        extend_lease();
 
        // wake people up
-       finish_contexts(&g_ceph_context, waiting_for_active);
-       finish_contexts(&g_ceph_context, waiting_for_readable);
-       finish_contexts(&g_ceph_context, waiting_for_writeable);
+       finish_contexts(g_ceph_context, waiting_for_active);
+       finish_contexts(g_ceph_context, waiting_for_readable);
+       finish_contexts(g_ceph_context, waiting_for_writeable);
       }
     }
   } else {
@@ -344,10 +344,10 @@ void Paxos::begin(bufferlist& v)
     // we're alone, take it easy
     commit();
     state = STATE_ACTIVE;
-    finish_contexts(&g_ceph_context, waiting_for_active);
-    finish_contexts(&g_ceph_context, waiting_for_commit);
-    finish_contexts(&g_ceph_context, waiting_for_readable);
-    finish_contexts(&g_ceph_context, waiting_for_writeable);
+    finish_contexts(g_ceph_context, waiting_for_active);
+    finish_contexts(g_ceph_context, waiting_for_commit);
+    finish_contexts(g_ceph_context, waiting_for_readable);
+    finish_contexts(g_ceph_context, waiting_for_writeable);
     update_observers();
     return;
   }
@@ -450,10 +450,10 @@ void Paxos::handle_accept(MMonPaxos *accept)
     extend_lease();
   
     // wake people up
-    finish_contexts(&g_ceph_context, waiting_for_active);
-    finish_contexts(&g_ceph_context, waiting_for_commit);
-    finish_contexts(&g_ceph_context, waiting_for_readable);
-    finish_contexts(&g_ceph_context, waiting_for_writeable);
+    finish_contexts(g_ceph_context, waiting_for_active);
+    finish_contexts(g_ceph_context, waiting_for_commit);
+    finish_contexts(g_ceph_context, waiting_for_readable);
+    finish_contexts(g_ceph_context, waiting_for_writeable);
   }
   accept->put();
 }
@@ -478,7 +478,7 @@ void Paxos::commit()
 
   // commit locally
   last_committed++;
-  last_commit_time = ceph_clock_now(&g_ceph_context);
+  last_commit_time = ceph_clock_now(g_ceph_context);
   mon->store->put_int(last_committed, machine_name, "last_committed");
 
   // tell everyone
@@ -518,7 +518,7 @@ void Paxos::handle_commit(MMonPaxos *commit)
   
   commit->put();
 
-  finish_contexts(&g_ceph_context, waiting_for_commit);
+  finish_contexts(g_ceph_context, waiting_for_commit);
 }
 
 void Paxos::extend_lease()
@@ -526,7 +526,7 @@ void Paxos::extend_lease()
   assert(mon->is_leader());
   assert(is_active());
 
-  lease_expire = ceph_clock_now(&g_ceph_context);
+  lease_expire = ceph_clock_now(g_ceph_context);
   lease_expire += g_conf->mon_lease;
   acked_lease.clear();
   acked_lease.insert(mon->rank);
@@ -562,7 +562,7 @@ void Paxos::extend_lease()
 
 void Paxos::warn_on_future_time(utime_t t, entity_name_t from)
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   if (t > now) {
     utime_t diff = t - now;
     if (diff > g_conf->mon_clock_drift_allowed) {
@@ -571,7 +571,7 @@ void Paxos::warn_on_future_time(utime_t t, entity_name_t from)
          pow(g_conf->mon_clock_drift_warn_backoff, clock_drift_warned)) {
        mon->clog.warn() << "message from " << from << " was stamped " << diff
                         << "s in the future, clocks not synchronized";
-       last_clock_drift_warn = ceph_clock_now(&g_ceph_context);
+       last_clock_drift_warn = ceph_clock_now(g_ceph_context);
        ++clock_drift_warned;
       }
     }
@@ -606,7 +606,7 @@ void Paxos::handle_lease(MMonPaxos *lease)
   MMonPaxos *ack = new MMonPaxos(mon->get_epoch(), MMonPaxos::OP_LEASE_ACK, machine_id);
   ack->last_committed = last_committed;
   ack->first_committed = first_committed;
-  ack->lease_timestamp = ceph_clock_now(&g_ceph_context);
+  ack->lease_timestamp = ceph_clock_now(g_ceph_context);
   mon->messenger->send_message(ack, lease->get_source_inst());
 
   // (re)set timeout event.
@@ -619,9 +619,9 @@ void Paxos::handle_lease(MMonPaxos *lease)
   trim_to(lease->first_committed);
   
   // kick waiters
-  finish_contexts(&g_ceph_context, waiting_for_active);
+  finish_contexts(g_ceph_context, waiting_for_active);
   if (is_readable())
-    finish_contexts(&g_ceph_context, waiting_for_readable);
+    finish_contexts(g_ceph_context, waiting_for_readable);
 
   lease->put();
 }
@@ -780,8 +780,8 @@ void Paxos::peon_init()
   dout(10) << "peon_init -- i am a peon" << dendl;
 
   // no chance to write now!
-  finish_contexts(&g_ceph_context, waiting_for_writeable, -1);
-  finish_contexts(&g_ceph_context, waiting_for_commit, -1);
+  finish_contexts(g_ceph_context, waiting_for_writeable, -1);
+  finish_contexts(g_ceph_context, waiting_for_commit, -1);
 }
 
 void Paxos::election_starting()
@@ -790,7 +790,7 @@ void Paxos::election_starting()
   cancel_events();
   new_value.clear();
 
-  finish_contexts(&g_ceph_context, waiting_for_commit, -1);
+  finish_contexts(g_ceph_context, waiting_for_commit, -1);
 }
 
 
@@ -862,7 +862,7 @@ void Paxos::register_observer(entity_inst_t inst, version_t v)
     observers[inst] = observer = new Observer(inst, v);
   }  
 
-  utime_t timeout = ceph_clock_now(&g_ceph_context);
+  utime_t timeout = ceph_clock_now(g_ceph_context);
   timeout += g_conf->paxos_observer_timeout;
   observer->timeout = timeout;
 
@@ -883,7 +883,7 @@ void Paxos::update_observers()
     Observer *observer = iter->second;
 
     // timed out?
-    if (ceph_clock_now(&g_ceph_context) > observer->timeout) {
+    if (ceph_clock_now(g_ceph_context) > observer->timeout) {
       delete observer;
       observers.erase(iter++);
       continue;
@@ -920,7 +920,7 @@ void Paxos::update_observers()
 
 bool Paxos::is_readable(version_t v)
 {
-  dout(1) << "is_readable now=" << ceph_clock_now(&g_ceph_context) << " lease_expire=" << lease_expire
+  dout(1) << "is_readable now=" << ceph_clock_now(g_ceph_context) << " lease_expire=" << lease_expire
          << " has v" << v << " lc " << last_committed << dendl;
   if (v > last_committed)
     return false;
@@ -929,7 +929,7 @@ bool Paxos::is_readable(version_t v)
     (is_active() || is_updating()) &&
     last_committed > 0 &&           // must have a value
     (mon->get_quorum().size() == 1 ||  // alone, or
-     ceph_clock_now(&g_ceph_context) < lease_expire);    // have lease
+     ceph_clock_now(g_ceph_context) < lease_expire);    // have lease
 }
 
 bool Paxos::read(version_t v, bufferlist &bl)
@@ -957,7 +957,7 @@ bool Paxos::is_writeable()
   return
     mon->is_leader() &&
     is_active() &&
-    ceph_clock_now(&g_ceph_context) < lease_expire;
+    ceph_clock_now(g_ceph_context) < lease_expire;
 }
 
 bool Paxos::propose_new_value(bufferlist& bl, Context *oncommit)
index 9769078df223b665caa3922d4f695e0c68d96d6a..e1c1cc9a4b9794f466648c4a8be818e3e9d4a506 100644 (file)
@@ -94,7 +94,7 @@ bool PaxosService::should_propose(double& delay)
   if (paxos->last_committed <= 1)
     delay = 0.0;
   else {
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     if ((now - paxos->last_commit_time) > g_conf->paxos_propose_interval)
       delay = (double)g_conf->paxos_min_wait;
     else
index de3ed9a441715137607b11a485f9308c3c05a592..7f1fbd9479bb25efab645aaef2f33f1ebd7f79ba 100644 (file)
@@ -51,7 +51,7 @@ int main(int argc, const char **argv)
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
              CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
   FOR_EACH_ARG(args) {
     if (CEPH_ARGPARSE_EQ("help", '\0')) {
       usage();
@@ -92,7 +92,7 @@ int main(int argc, const char **argv)
   if (!fn)
     usage();
   
-  MonMap monmap(ceph_clock_now(&g_ceph_context));
+  MonMap monmap(ceph_clock_now(g_ceph_context));
 
   cout << me << ": monmap file " << fn << std::endl;
 
index a4f4f8305249e856e33cb710931ce5388fab7592..a6a66283be6e98797f4d317589d1374ff7c51f91 100644 (file)
@@ -765,7 +765,7 @@ void FileJournal::do_write(bufferlist& bl)
           << (hbp.length() ? " + header":"")
           << dendl;
   
-  utime_t from = ceph_clock_now(&g_ceph_context);
+  utime_t from = ceph_clock_now(g_ceph_context);
 
   // entry
   off64_t pos = write_pos;
@@ -839,7 +839,7 @@ void FileJournal::do_write(bufferlist& bl)
 #endif
   }
 
-  utime_t lat = ceph_clock_now(&g_ceph_context) - from;    
+  utime_t lat = ceph_clock_now(g_ceph_context) - from;    
   dout(20) << "do_write latency " << lat << dendl;
 
   write_lock.Lock();    
index fa0741b66d5054a6f931f4643a2ab1448b177703..fce4726ca4f7b29e630997d6e0a70c07ed27f711 100644 (file)
@@ -864,14 +864,14 @@ FileStore::FileStore(const std::string &base, const std::string &jdev) :
   basedir_fd(-1), current_fd(-1),
   attrs(this), fake_attrs(false),
   collections(this), fake_collections(false),
-  ondisk_finisher(&g_ceph_context),
+  ondisk_finisher(g_ceph_context),
   lock("FileStore::lock"),
   force_sync(false), sync_epoch(0),
   sync_entry_timeo_lock("sync_entry_timeo_lock"),
-  timer(&g_ceph_context, sync_entry_timeo_lock),
+  timer(g_ceph_context, sync_entry_timeo_lock),
   stop(false), sync_thread(this),
-  op_queue_len(0), op_queue_bytes(0), op_finisher(&g_ceph_context), next_finish(0),
-  op_tp(&g_ceph_context, "FileStore::op_tp", g_conf->filestore_op_threads), op_wq(this, &op_tp),
+  op_queue_len(0), op_queue_bytes(0), op_finisher(g_ceph_context), next_finish(0),
+  op_tp(g_ceph_context, "FileStore::op_tp", g_conf->filestore_op_threads), op_wq(this, &op_tp),
   flusher_queue_len(0), flusher_thread(this),
   logger(NULL)
 {
@@ -1902,11 +1902,11 @@ void FileStore::start_logger(int whoami, utime_t tare)
 
   char name[80];
   snprintf(name, sizeof(name), "osd.%d.fs.log", whoami);
-  logger = new ProfLogger(&g_ceph_context, name, (ProfLogType*)&fs_logtype);
+  logger = new ProfLogger(g_ceph_context, name, (ProfLogType*)&fs_logtype);
   if (journal)
     journal->logger = logger;
   {
-    ProfLoggerCollection *coll = g_ceph_context.GetProfLoggerCollection();
+    ProfLoggerCollection *coll = g_ceph_context->GetProfLoggerCollection();
     coll->logger_add(logger);
     coll->logger_tare(tare);
     coll->logger_start();
@@ -1919,7 +1919,7 @@ void FileStore::stop_logger()
   if (logger) {
     if (journal)
       journal->logger = NULL;
-    g_ceph_context.GetProfLoggerCollection()->logger_remove(logger);
+    g_ceph_context->GetProfLoggerCollection()->logger_remove(logger);
     delete logger;
     logger = NULL;
   }
@@ -3011,10 +3011,10 @@ void FileStore::sync_entry()
     utime_t min_interval;
     min_interval.set_from_double(g_conf->filestore_min_sync_interval);
 
-    utime_t startwait = ceph_clock_now(&g_ceph_context);
+    utime_t startwait = ceph_clock_now(g_ceph_context);
     if (!force_sync) {
       dout(20) << "sync_entry waiting for max_interval " << max_interval << dendl;
-      sync_cond.WaitInterval(&g_ceph_context, lock, max_interval);
+      sync_cond.WaitInterval(g_ceph_context, lock, max_interval);
     } else {
       dout(20) << "sync_entry not waiting, force_sync set" << dendl;
     }
@@ -3024,7 +3024,7 @@ void FileStore::sync_entry()
       force_sync = false;
     } else {
       // wait for at least the min interval
-      utime_t woke = ceph_clock_now(&g_ceph_context);
+      utime_t woke = ceph_clock_now(g_ceph_context);
       woke -= startwait;
       dout(20) << "sync_entry woke after " << woke << dendl;
       if (woke < min_interval) {
@@ -3032,7 +3032,7 @@ void FileStore::sync_entry()
        t -= woke;
        dout(20) << "sync_entry waiting for another " << t 
                 << " to reach min interval " << min_interval << dendl;
-       sync_cond.WaitInterval(&g_ceph_context, lock, t);
+       sync_cond.WaitInterval(g_ceph_context, lock, t);
       }
     }
 
@@ -3042,7 +3042,7 @@ void FileStore::sync_entry()
     lock.Unlock();
     
     if (commit_start()) {
-      utime_t start = ceph_clock_now(&g_ceph_context);
+      utime_t start = ceph_clock_now(g_ceph_context);
       uint64_t cp = committing_seq;
 
       SyncEntryTimeout *sync_entry_timeo = new SyncEntryTimeout();
@@ -3122,7 +3122,7 @@ void FileStore::sync_entry()
        }
       }
       
-      utime_t done = ceph_clock_now(&g_ceph_context);
+      utime_t done = ceph_clock_now(g_ceph_context);
       done -= start;
       dout(10) << "sync_entry commit took " << done << dendl;
       commit_finish();
@@ -3157,7 +3157,7 @@ void FileStore::sync_entry()
     }
     
     lock.Lock();
-    finish_contexts(&g_ceph_context, fin, 0);
+    finish_contexts(g_ceph_context, fin, 0);
     fin.clear();
     if (!sync_waiters.empty()) {
       dout(10) << "sync_entry more waiters, committing again" << dendl;
index 2addfe9ce69ffa4631a01ac165bc5f3c9a103235..a04feec55763e5409db86ad26c1919cbc9fa4abf 100644 (file)
@@ -69,7 +69,7 @@ public:
   JournalingObjectStore() : op_seq(0), 
                            applied_seq(0), committing_seq(0), committed_seq(0), 
                            open_ops(0), blocked(false),
-                           journal(NULL), finisher(&g_ceph_context),
+                           journal(NULL), finisher(g_ceph_context),
                            journal_lock("JournalingObjectStore::journal_lock"),
                            com_lock("JournalingObjectStore::com_lock") { }
   
index dd70b63dbf953439b73b3aaafd857081db68009f..fb8afd7e9b89ed1671cf82eb7c65f9ba9f15998e 100644 (file)
@@ -58,7 +58,7 @@ uint64_t Ager::age_fill(float pc, utime_t until) {
   bl.push_back(bp);
   uint64_t wrote = 0;
   while (1) {
-    if (ceph_clock_now(&g_ceph_context) > until) break;
+    if (ceph_clock_now(g_ceph_context) > until) break;
     
     struct statfs st;
     store->statfs(&st);
@@ -199,7 +199,7 @@ void Ager::age(int time,
   store->_fake_writes(true);
   srand(0);
 
-  utime_t start = ceph_clock_now(&g_ceph_context);
+  utime_t start = ceph_clock_now(g_ceph_context);
   utime_t until = start;
   until.sec_ref() += time;
   
@@ -248,7 +248,7 @@ void Ager::age(int time,
   uint64_t wrote = 0;
 
   for (int c=1; c<=count; c++) {
-    if (ceph_clock_now(&g_ceph_context) > until) break;
+    if (ceph_clock_now(g_ceph_context) > until) break;
     
     //if (c == 7) start_debug = true;
     
@@ -278,7 +278,7 @@ void Ager::age(int time,
 
     // dump freelist?
     /*
-    if (ceph_clock_now(&g_ceph_context) > nextfl) {
+    if (ceph_clock_now(g_ceph_context) > nextfl) {
       elapsed += freelist_inc;
       save_freelist(elapsed);
       nextfl.sec_ref() += freelist_inc;
index 416ed018fb2280a0be2f05b86b56087fe3eb8433..5ad1a608de01b962b267dcaba3bfa003ae919cd4 100644 (file)
@@ -195,7 +195,7 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, ceph_fsid_t fsid,
       bp.zero();
       bl.push_back(bp);
       dout(0) << "testing disk bandwidth..." << dendl;
-      utime_t start = ceph_clock_now(&g_ceph_context);
+      utime_t start = ceph_clock_now(g_ceph_context);
       object_t oid("disk_bw_test");
       for (int i=0; i<1000; i++) {
        ObjectStore::Transaction *t = new ObjectStore::Transaction;
@@ -203,7 +203,7 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, ceph_fsid_t fsid,
        store->queue_transaction(NULL, t);
       }
       store->sync();
-      utime_t end = ceph_clock_now(&g_ceph_context);
+      utime_t end = ceph_clock_now(g_ceph_context);
       end -= start;
       dout(0) << "measured " << (1000.0 / (double)end) << " mb/sec" << dendl;
       ObjectStore::Transaction tr;
@@ -427,7 +427,7 @@ OSD::OSD(int id, Messenger *internal_messenger, Messenger *external_messenger,
   heartbeat_thread(this),
   heartbeat_dispatcher(this),
   decayrate(5.0),
-  stat_oprate(ceph_clock_now(&g_ceph_context)),
+  stat_oprate(ceph_clock_now(g_ceph_context)),
   peer_stat_lock("OSD::peer_stat_lock"),
   read_latency_calc(g_conf->osd_max_opq<1 ? 1:g_conf->osd_max_opq),
   qlen_calc(3),
@@ -480,7 +480,7 @@ OSD::~OSD()
 {
   delete map_in_progress_cond;
   delete class_handler;
-  g_ceph_context.GetProfLoggerCollection()->logger_remove(logger);
+  g_ceph_context->GetProfLoggerCollection()->logger_remove(logger);
   delete logger;
   delete store;
 }
@@ -695,8 +695,8 @@ void OSD::open_logger()
 
   char name[80];
   snprintf(name, sizeof(name), "osd.%d.log", whoami);
-  logger = new ProfLogger(&g_ceph_context, name, (ProfLogType*)&osd_logtype);
-  g_ceph_context.GetProfLoggerCollection()->logger_add(logger);
+  logger = new ProfLogger(g_ceph_context, name, (ProfLogType*)&osd_logtype);
+  g_ceph_context->GetProfLoggerCollection()->logger_add(logger);
 
   if (osdmap->get_epoch() > 0)
     start_logger();
@@ -704,7 +704,7 @@ void OSD::open_logger()
 
 void OSD::start_logger()
 {
-  ProfLoggerCollection *coll = g_ceph_context.GetProfLoggerCollection();
+  ProfLoggerCollection *coll = g_ceph_context->GetProfLoggerCollection();
   coll->logger_tare(osdmap->get_created());
   coll->logger_start();
   logger_started = true;
@@ -1170,7 +1170,7 @@ PG *OSD::get_or_create_pg(const PG::Info& info, epoch_t epoch, int from, int& cr
 
     // ok, create PG locally using provided Info and History
     *pt = new ObjectStore::Transaction;
-    *pfin = new C_Contexts(&g_ceph_context);
+    *pfin = new C_Contexts(g_ceph_context);
     if (create) {
       pg = _create_lock_new_pg(info.pgid, acting, **pt);
     } else {
@@ -1202,7 +1202,7 @@ PG *OSD::get_or_create_pg(const PG::Info& info, epoch_t epoch, int from, int& cr
       return NULL;
     }
     *pt = new ObjectStore::Transaction;
-    *pfin = new C_Contexts(&g_ceph_context);
+    *pfin = new C_Contexts(g_ceph_context);
   }
   return pg;
 }
@@ -1425,7 +1425,7 @@ void OSD::update_heartbeat_peers()
   old_from.swap(heartbeat_from);
   old_con.swap(heartbeat_con);
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   heartbeat_epoch = osdmap->get_epoch();
 
@@ -1658,7 +1658,7 @@ void OSD::handle_osd_ping(MOSDPing *m)
       if (locked && !is_booting())
        _share_map_outgoing(osdmap->get_cluster_inst(from));
       
-      heartbeat_from_stamp[from] = ceph_clock_now(&g_ceph_context);  // don't let _my_ lag interfere.
+      heartbeat_from_stamp[from] = ceph_clock_now(g_ceph_context);  // don't let _my_ lag interfere.
       
       // remove from failure lists if needed
       if (failure_pending.count(from)) {
@@ -1698,7 +1698,7 @@ void OSD::heartbeat_entry()
     utime_t w;
     w.set_from_double(wait);
     dout(30) << "heartbeat_entry sleeping for " << wait << dendl;
-    heartbeat_cond.WaitInterval(&g_ceph_context, heartbeat_lock, w);
+    heartbeat_cond.WaitInterval(g_ceph_context, heartbeat_lock, w);
     dout(30) << "heartbeat_entry woke up" << dendl;
   }
   heartbeat_lock.Unlock();
@@ -1710,7 +1710,7 @@ void OSD::heartbeat_check()
   // we should also have map_lock rdlocked.
 
   // check for incoming heartbeats (move me elsewhere?)
-  utime_t grace = ceph_clock_now(&g_ceph_context);
+  utime_t grace = ceph_clock_now(g_ceph_context);
   grace -= g_conf->osd_heartbeat_grace;
   for (map<int, epoch_t>::iterator p = heartbeat_from.begin();
        p != heartbeat_from.end();
@@ -1728,7 +1728,7 @@ void OSD::heartbeat_check()
 
 void OSD::heartbeat()
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   dout(30) << "heartbeat" << dendl;
 
@@ -1852,7 +1852,7 @@ void OSD::tick()
   check_replay_queue();
 
   // mon report?
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   if (now - last_pg_stats_sent > g_conf->osd_mon_report_interval_max) {
     osd_stat_updated = true;
     do_mon_report();
@@ -1898,7 +1898,7 @@ void OSD::do_mon_report()
 {
   dout(7) << "do_mon_report" << dendl;
 
-  utime_t now(ceph_clock_now(&g_ceph_context));
+  utime_t now(ceph_clock_now(g_ceph_context));
   last_mon_report = now;
 
   // do any pending reports
@@ -1918,7 +1918,7 @@ void OSD::ms_handle_connect(Connection *con)
     send_alive();
     send_pg_temp();
     send_failures();
-    send_pg_stats(ceph_clock_now(&g_ceph_context));
+    send_pg_stats(ceph_clock_now(g_ceph_context));
   }
 }
 
@@ -1989,7 +1989,7 @@ bool OSD::ms_handle_reset(Connection *con)
                << " from " << obc->obs.oi << dendl;
        entity_name_t entity = witer->first;
        watch_info_t& w = obc->obs.oi.watchers[entity];
-       utime_t expire = ceph_clock_now(&g_ceph_context);
+       utime_t expire = ceph_clock_now(g_ceph_context);
        expire += w.timeout_seconds;
        obc->unconnected_watchers[entity] = expire;
        dout(10) << " disconnected watch " << w << " by " << entity << " session " << session
@@ -2047,7 +2047,7 @@ void OSD::handle_notify_timeout(void *_notif)
     if (witer != obc->watchers.end()) {
       watch_info_t& w = obc->obs.oi.watchers[notif_iter->first];
       obc->watchers.erase(witer);   // FIXME: hmm? notify timeout may be different than watch timeout?
-      utime_t expire = ceph_clock_now(&g_ceph_context);
+      utime_t expire = ceph_clock_now(g_ceph_context);
       expire += w.timeout_seconds;
       obc->unconnected_watchers[notif_iter->first] = expire;
     }
@@ -2100,7 +2100,7 @@ void OSD::queue_want_up_thru(epoch_t want)
     up_thru_wanted = want;
 
     // expedite, a bit.  WARNING this will somewhat delay other mon queries.
-    last_mon_report = ceph_clock_now(&g_ceph_context);
+    last_mon_report = ceph_clock_now(g_ceph_context);
     send_alive();
   } else {
     dout(10) << "queue_want_up_thru want " << want << " <= queued " << up_thru_wanted 
@@ -2274,7 +2274,7 @@ void OSD::handle_command(MMonCommand *m)
     ObjectStore::Transaction *cleanupt = new ObjectStore::Transaction;
 
     store->sync_and_flush();
-    utime_t start = ceph_clock_now(&g_ceph_context);
+    utime_t start = ceph_clock_now(g_ceph_context);
     for (uint64_t pos = 0; pos < count; pos += bsize) {
       char nm[30];
       snprintf(nm, sizeof(nm), "disk_bw_test_%lld", (long long)pos);
@@ -2286,7 +2286,7 @@ void OSD::handle_command(MMonCommand *m)
       cleanupt->remove(coll_t::META_COLL, soid);
     }
     store->sync_and_flush();
-    utime_t end = ceph_clock_now(&g_ceph_context);
+    utime_t end = ceph_clock_now(g_ceph_context);
 
     // clean up
     store->queue_transaction(NULL, cleanupt);
@@ -2327,9 +2327,9 @@ void OSD::handle_command(MMonCommand *m)
 
     }
   } else if (m->cmd.size() == 2 && m->cmd[0] == "logger" && m->cmd[1] == "reset") {
-    g_ceph_context.GetProfLoggerCollection()->logger_reset_all();
+    g_ceph_context->GetProfLoggerCollection()->logger_reset_all();
   } else if (m->cmd.size() == 2 && m->cmd[0] == "logger" && m->cmd[1] == "reopen") {
-    g_ceph_context.reopen_logs();
+    g_ceph_context->reopen_logs();
   } else if (m->cmd[0] == "heap") {
     if (ceph_using_tcmalloc())
       ceph_heap_profiler_handle_command(m->cmd, clog);
@@ -2383,7 +2383,7 @@ void OSD::handle_command(MMonCommand *m)
       clog.info() << "kicking recovery queue. set osd_recovery_delay_start "
                    << "to " << g_conf->osd_recovery_delay_start << "\n";
 
-      defer_recovery_until = ceph_clock_now(&g_ceph_context);
+      defer_recovery_until = ceph_clock_now(g_ceph_context);
       defer_recovery_until += g_conf->osd_recovery_delay_start;
       recovery_wq.kick();
     }
@@ -2601,7 +2601,7 @@ bool OSD::ms_verify_authorizer(Connection *con, int peer_type,
                               bool& isvalid)
 {
   AuthAuthorizeHandler *authorize_handler =
-      get_authorize_handler(protocol, &g_ceph_context);
+      get_authorize_handler(protocol, g_ceph_context);
   if (!authorize_handler) {
     dout(0) << "No AuthAuthorizeHandler found for protocol " << protocol << dendl;
     isvalid = false;
@@ -2613,7 +2613,7 @@ bool OSD::ms_verify_authorizer(Connection *con, int peer_type,
   uint64_t global_id;
   uint64_t auid = CEPH_AUTH_UID_DEFAULT;
 
-  isvalid = authorize_handler->verify_authorizer(&g_ceph_context, monc->rotating_secrets,
+  isvalid = authorize_handler->verify_authorizer(g_ceph_context, monc->rotating_secrets,
                                                 authorizer_data, authorizer_reply, name, global_id, caps_info, &auid);
 
   dout(10) << "OSD::ms_verify_authorizer name=" << name << " auid=" << auid << dendl;
@@ -2876,7 +2876,7 @@ void OSD::sched_scrub()
   dout(20) << "sched_scrub" << dendl;
 
   pair<utime_t,pg_t> pos;
-  utime_t max = ceph_clock_now(&g_ceph_context);
+  utime_t max = ceph_clock_now(g_ceph_context);
   max -= g_conf->osd_scrub_max_interval;
   
   sched_scrub_lock.Lock();
@@ -3183,16 +3183,16 @@ void OSD::handle_osd_map(MOSDMap *m)
        note_down_osd(*p);
     
     if (!logger_started)
-      g_ceph_context.GetProfLoggerCollection()->logger_start();
+      g_ceph_context->GetProfLoggerCollection()->logger_start();
 
     osdmap = newmap;
 
     superblock.current_epoch = cur;
     advance_map(t);
-    had_map_since = ceph_clock_now(&g_ceph_context);
+    had_map_since = ceph_clock_now(g_ceph_context);
   }
 
-  C_Contexts *fin = new C_Contexts(&g_ceph_context);
+  C_Contexts *fin = new C_Contexts(g_ceph_context);
   if (osdmap->is_up(whoami) &&
       osdmap->get_addr(whoami) == client_messenger->get_myaddr()) {
 
@@ -3805,7 +3805,7 @@ void OSD::kick_pg_split_queue()
 
     // create and lock children
     ObjectStore::Transaction *t = new ObjectStore::Transaction;
-    C_Contexts *fin = new C_Contexts(&g_ceph_context);
+    C_Contexts *fin = new C_Contexts(g_ceph_context);
     map<pg_t,PG*> children;
     for (set<pg_t>::iterator q = p->second.begin();
         q != p->second.end();
@@ -4045,7 +4045,7 @@ void OSD::handle_pg_create(MOSDPGCreate *m)
     
     if (can_create_pg(pgid)) {
       ObjectStore::Transaction *t = new ObjectStore::Transaction;
-      C_Contexts *fin = new C_Contexts(&g_ceph_context);
+      C_Contexts *fin = new C_Contexts(g_ceph_context);
 
       PG *pg = _create_lock_new_pg(pgid, creating_pgs[pgid].acting, *t);
       creating_pgs.erase(pgid);
@@ -4676,7 +4676,7 @@ void OSD::generate_backlog(PG *pg)
   map< int, map<pg_t,PG::Query> > query_map;
   map< int, MOSDPGInfo* > info_map;
   ObjectStore::Transaction *t = new ObjectStore::Transaction;
-  C_Contexts *fin = new C_Contexts(&g_ceph_context);
+  C_Contexts *fin = new C_Contexts(g_ceph_context);
   PG::RecoveryCtx rctx(&query_map, &info_map, 0, &fin->contexts, t);
 
   if (!pg->generate_backlog_epoch) {
@@ -4721,7 +4721,7 @@ void OSD::generate_backlog(PG *pg)
 
 void OSD::check_replay_queue()
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   list< pair<pg_t,utime_t> > pgids;
   replay_queue_lock.Lock();
   while (!replay_queue.empty() &&
@@ -4778,7 +4778,7 @@ bool OSD::_recover_now()
             << " >= max " << g_conf->osd_recovery_max_active << dendl;
     return false;
   }
-  if (ceph_clock_now(&g_ceph_context) < defer_recovery_until) {
+  if (ceph_clock_now(g_ceph_context) < defer_recovery_until) {
     dout(15) << "_recover_now defer until " << defer_recovery_until << dendl;
     return false;
   }
@@ -4978,7 +4978,7 @@ void OSD::handle_op(MOSDOp *op)
   // ...
   throttle_op_queue();
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   int r = init_op_flags(op);
   if (r) {
index db31c569f66d5c29a199c6eb08a8f4fab39b5713..acfc42b177812cf0f64266857d83348ebf22718e 100644 (file)
@@ -270,7 +270,7 @@ public:
   public:
     OSD *osd;
     HeartbeatDispatcher(OSD *o) 
-      : Dispatcher(&g_ceph_context), osd(o)
+      : Dispatcher(g_ceph_context), osd(o)
     {
     }
   } heartbeat_dispatcher;
@@ -739,7 +739,7 @@ protected:
        osd->recovery_queue.push_back(&pg->recovery_item);
 
        if (g_conf->osd_recovery_delay_start > 0) {
-         osd->defer_recovery_until = ceph_clock_now(&g_ceph_context);
+         osd->defer_recovery_until = ceph_clock_now(g_ceph_context);
          osd->defer_recovery_until += g_conf->osd_recovery_delay_start;
        }
        return true;
index 403169d0ba82aa6fe5c0d03d745ea4e84e9139ab..5e56197a28ab7f382eff854c07a00aebd8ba273f 100644 (file)
@@ -1120,7 +1120,7 @@ void PG::mark_all_unfound_as_lost(ObjectStore::Transaction& t)
   log.print(*_dout);
   *_dout << dendl;
 
-  utime_t mtime = ceph_clock_now(&g_ceph_context);
+  utime_t mtime = ceph_clock_now(g_ceph_context);
   eversion_t old_last_update = info.last_update;
   info.last_update.epoch = osd->osdmap->get_epoch();
   map<sobject_t, Missing::item>::iterator m = missing.missing.begin();
@@ -1479,7 +1479,7 @@ void PG::activate(ObjectStore::Transaction& t, list<Context*>& tfin,
   assert(!is_active());
   // -- crash recovery?
   if (is_crashed()) {
-    replay_until = ceph_clock_now(&g_ceph_context);
+    replay_until = ceph_clock_now(g_ceph_context);
     replay_until += g_conf->osd_replay_window;
     dout(10) << "crashed, allowing op replay for " << g_conf->osd_replay_window
             << " until " << replay_until << dendl;
@@ -2565,7 +2565,7 @@ bool PG::sched_scrub()
   }
 
   // just scrubbed?
-  if (info.history.last_scrub_stamp + g_conf->osd_scrub_min_interval > ceph_clock_now(&g_ceph_context)) {
+  if (info.history.last_scrub_stamp + g_conf->osd_scrub_min_interval > ceph_clock_now(g_ceph_context)) {
     dout(20) << "sched_scrub: just scrubbed, skipping" << dendl;
     return true;
   }
@@ -3319,7 +3319,7 @@ void PG::scrub_finalize() {
   // finish up
   osd->unreg_last_pg_scrub(info.pgid, info.history.last_scrub_stamp);
   info.history.last_scrub = info.last_update;
-  info.history.last_scrub_stamp = ceph_clock_now(&g_ceph_context);
+  info.history.last_scrub_stamp = ceph_clock_now(g_ceph_context);
   osd->reg_last_pg_scrub(info.pgid, info.history.last_scrub_stamp);
 
   {
@@ -4683,9 +4683,9 @@ void PG::RecoveryState::RecoveryMachine::log_enter(const char *state_name)
 
 void PG::RecoveryState::RecoveryMachine::log_exit(const char *state_name, utime_t enter_time)
 {
-  utime_t dur = ceph_clock_now(&g_ceph_context) - enter_time;
+  utime_t dur = ceph_clock_now(g_ceph_context) - enter_time;
   dout(20) << "exit " << state_name << " " << dur << " " << event_count << " " << event_time << dendl;
-  pg->osd->pg_recovery_stats.log_exit(state_name, ceph_clock_now(&g_ceph_context) - enter_time,
+  pg->osd->pg_recovery_stats.log_exit(state_name, ceph_clock_now(g_ceph_context) - enter_time,
                                      event_count, event_time);
   event_count = 0;
   event_time = utime_t();
index de82541b3a9fb76d8d4f744b13900b7e7c40b151..1c1695027202421499ffada66824aca339f6a700 100644 (file)
@@ -866,12 +866,12 @@ public:
       assert(!rctx);
       rctx = new_ctx;
       if (rctx)
-       rctx->start_time = ceph_clock_now(&g_ceph_context);
+       rctx->start_time = ceph_clock_now(g_ceph_context);
     }
 
     void end_handle() {
       if (rctx) {
-       utime_t dur = ceph_clock_now(&g_ceph_context) - rctx->start_time;
+       utime_t dur = ceph_clock_now(g_ceph_context) - rctx->start_time;
        machine.event_time += dur;
       }
       machine.event_count++;
@@ -995,7 +995,7 @@ public:
       const char *state_name;
       utime_t enter_time;
       const char *get_state_name() { return state_name; }
-      NamedState() : enter_time(ceph_clock_now(&g_ceph_context)) {}
+      NamedState() : enter_time(ceph_clock_now(g_ceph_context)) {}
       virtual ~NamedState() {}
     };
 
index 7cfad83a113f4e86b4b48c227b37018a29a5e48a..cb0f6704d9ad0318e841c28a9e7a344900035664 100644 (file)
@@ -569,7 +569,7 @@ void ReplicatedPG::do_op(MOSDOp *op)
   }
 
   // note my stats
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   // note some basic context for op replication that prepare_transaction may clobber
   eversion_t old_last_update = log.head;
@@ -645,7 +645,7 @@ void ReplicatedPG::log_op_stats(OpContext *ctx)
     osd->logger->inc(l_osd_c_rd);
     osd->logger->inc(l_osd_c_rdb, ctx->outdata.length());
 
-    utime_t now = ceph_clock_now(&g_ceph_context);
+    utime_t now = ceph_clock_now(g_ceph_context);
     utime_t diff = now;
     diff -= ctx->op->get_recv_stamp();
     //dout(20) <<  "do_op " << ctx->reqid << " total op latency " << diff << dendl;
@@ -798,7 +798,7 @@ bool ReplicatedPG::snap_trimmer()
       tid_t rep_tid = osd->get_tid();
       osd_reqid_t reqid(osd->cluster_messenger->get_myname(), 0, rep_tid);
       OpContext *ctx = new OpContext(NULL, reqid, ops, &obc->obs, this);
-      ctx->mtime = ceph_clock_now(&g_ceph_context);
+      ctx->mtime = ceph_clock_now(g_ceph_context);
 
       ctx->at_version.epoch = osd->osdmap->get_epoch();
       ctx->at_version.version = log.head.version + 1;
@@ -2302,7 +2302,7 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx)
       }
 
       // unconnected
-      utime_t now = ceph_clock_now(&g_ceph_context);
+      utime_t now = ceph_clock_now(g_ceph_context);
       for (map<entity_name_t, utime_t>::iterator q = obc->unconnected_watchers.begin();
           q != obc->unconnected_watchers.end();
           q++) {
@@ -2688,7 +2688,7 @@ void ReplicatedPG::eval_repop(RepGather *repop)
        repop->sent_ack = true;
       }
       
-      utime_t now = ceph_clock_now(&g_ceph_context);
+      utime_t now = ceph_clock_now(g_ceph_context);
       now -= repop->start;
       osd->logger->finc(l_osd_rlsum, now);
       osd->logger->inc(l_osd_rlnum, 1);
@@ -2788,7 +2788,7 @@ ReplicatedPG::RepGather *ReplicatedPG::new_repop(OpContext *ctx, ObjectContext *
     repop->waitfor_disk.insert(osd);
   }
 
-  repop->start = ceph_clock_now(&g_ceph_context);
+  repop->start = ceph_clock_now(g_ceph_context);
 
   repop_queue.push_back(&repop->queue_item);
   repop_map[repop->rep_tid] = repop;
@@ -2901,7 +2901,7 @@ ReplicatedPG::ObjectContext *ReplicatedPG::get_object_context(const sobject_t& s
 
       if (!obc->obs.oi.watchers.empty()) {
        // populate unconnected_watchers
-       utime_t now = ceph_clock_now(&g_ceph_context);
+       utime_t now = ceph_clock_now(g_ceph_context);
        for (map<entity_name_t, watch_info_t>::iterator p = obc->obs.oi.watchers.begin();
             p != obc->obs.oi.watchers.end();
             p++) {
@@ -3211,7 +3211,7 @@ void ReplicatedPG::sub_op_modify_applied(RepModify *rm)
   if (!rm->committed) {
     // send ack to acker only if we haven't sent a commit already
     MOSDSubOpReply *ack = new MOSDSubOpReply(rm->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ACK);
-    ack->set_peer_stat(osd->get_my_stat_for(ceph_clock_now(&g_ceph_context), rm->ackerosd));
+    ack->set_peer_stat(osd->get_my_stat_for(ceph_clock_now(g_ceph_context), rm->ackerosd));
     ack->set_priority(CEPH_MSG_PRIO_HIGH); // this better match commit priority!
     osd->cluster_messenger->
       send_message(ack, osd->osdmap->get_cluster_inst(rm->ackerosd));
@@ -3254,7 +3254,7 @@ void ReplicatedPG::sub_op_modify_commit(RepModify *rm)
     MOSDSubOpReply *commit = new MOSDSubOpReply(rm->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ONDISK);
     commit->set_last_complete_ondisk(rm->last_complete);
     commit->set_priority(CEPH_MSG_PRIO_HIGH); // this better match ack priority!
-    commit->set_peer_stat(osd->get_my_stat_for(ceph_clock_now(&g_ceph_context), rm->ackerosd));
+    commit->set_peer_stat(osd->get_my_stat_for(ceph_clock_now(g_ceph_context), rm->ackerosd));
     osd->cluster_messenger->
       send_message(commit, osd->osdmap->get_cluster_inst(rm->ackerosd));
   }
@@ -4373,7 +4373,7 @@ int ReplicatedPG::start_recovery_ops(int max)
     dout(10) << __func__ << ": all OSDs in the PG are up-to-date!" << dendl;
     log.reset_recovery_pointers();
     ObjectStore::Transaction *t = new ObjectStore::Transaction;
-    C_Contexts *fin = new C_Contexts(&g_ceph_context);
+    C_Contexts *fin = new C_Contexts(g_ceph_context);
     finish_recovery(*t, fin->contexts);
     int tr = osd->store->queue_transaction(&osr, t, new ObjectStore::C_DeleteTransaction(t), fin);
     assert(tr == 0);
index 536d63fac7e33e4531d199830674cd80a89c8977..938837945f80cc39e95886e821ee93bc4bb3e25d 100644 (file)
@@ -194,9 +194,9 @@ class Filer {
     } else {
       C_Gather *gack = 0, *gcom = 0;
       if (onack)
-       gack = new C_Gather(&g_ceph_context, onack);
+       gack = new C_Gather(g_ceph_context, onack);
       if (oncommit)
-       gcom = new C_Gather(&g_ceph_context, oncommit);
+       gcom = new C_Gather(g_ceph_context, oncommit);
       for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
        vector<OSDOp> ops(1);
        ops[0].op.op = CEPH_OSD_OP_TRIMTRUNC;
@@ -231,9 +231,9 @@ class Filer {
     } else {
       C_Gather *gack = 0, *gcom = 0;
       if (onack)
-       gack = new C_Gather(&g_ceph_context, onack);
+       gack = new C_Gather(g_ceph_context, onack);
       if (oncommit)
-       gcom = new C_Gather(&g_ceph_context, oncommit);
+       gcom = new C_Gather(g_ceph_context, oncommit);
       for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
        if (p->offset == 0 && p->length == layout->fl_object_size)
          objecter->remove(p->oid, p->oloc,
index 819cf61282c759d13b7685a0cd3e223223a1cb6c..d9e41ec59eb9a72354ec9d264a278c7df1f43b2e 100644 (file)
@@ -195,7 +195,7 @@ void Journaler::_finish_read_head(int r, bufferlist& bl)
     state = STATE_ACTIVE;
     list<Context*> ls;
     ls.swap(waitfor_recover);
-    finish_contexts(&g_ceph_context, ls, 0);
+    finish_contexts(g_ceph_context, ls, 0);
     return;
   } 
 
@@ -209,7 +209,7 @@ void Journaler::_finish_read_head(int r, bufferlist& bl)
            << magic << "'" << dendl;
     list<Context*> ls;
     ls.swap(waitfor_recover);
-    finish_contexts(&g_ceph_context, ls, -EINVAL);
+    finish_contexts(g_ceph_context, ls, -EINVAL);
     return;
   }
 
@@ -283,7 +283,7 @@ void Journaler::_finish_probe_end(int r, uint64_t end)
   // done.
   list<Context*> ls;
   ls.swap(waitfor_recover);
-  finish_contexts(&g_ceph_context, ls, 0);
+  finish_contexts(g_ceph_context, ls, 0);
 }
 
 class Journaler::C_RereadHeadProbe : public Context
@@ -334,7 +334,7 @@ void Journaler::write_head(Context *oncommit)
   last_written.write_pos = safe_pos;
   dout(10) << "write_head " << last_written << dendl;
   
-  last_wrote_head = ceph_clock_now(&g_ceph_context);
+  last_wrote_head = ceph_clock_now(g_ceph_context);
 
   bufferlist bl;
   ::encode(last_written, bl);
@@ -342,7 +342,7 @@ void Journaler::write_head(Context *oncommit)
   
   object_t oid = file_object_t(ino, 0);
   object_locator_t oloc(pg_pool);
-  objecter->write_full(oid, oloc, snapc, bl, ceph_clock_now(&g_ceph_context), 0, 
+  objecter->write_full(oid, oloc, snapc, bl, ceph_clock_now(g_ceph_context), 0, 
                       NULL, 
                       new C_WriteHead(this, last_written, oncommit));
 }
@@ -385,7 +385,7 @@ void Journaler::_finish_flush(int r, uint64_t start, utime_t stamp)
 
   // calc latency?
   if (logger) {
-    utime_t lat = ceph_clock_now(&g_ceph_context);
+    utime_t lat = ceph_clock_now(g_ceph_context);
     lat -= stamp;
     logger->favg(logger_key_lat, lat);
   }
@@ -408,7 +408,7 @@ void Journaler::_finish_flush(int r, uint64_t start, utime_t stamp)
   while (!waitfor_safe.empty()) {
     if (waitfor_safe.begin()->first > safe_pos)
       break;
-    finish_contexts(&g_ceph_context, waitfor_safe.begin()->second);
+    finish_contexts(g_ceph_context, waitfor_safe.begin()->second);
     waitfor_safe.erase(waitfor_safe.begin());
   }
 }
@@ -499,7 +499,7 @@ void Journaler::_do_flush(unsigned amount)
   
   // submit write for anything pending
   // flush _start_ pos to _finish_flush
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   SnapContext snapc;
 
   Context *onsafe = new C_Flush(this, flush_pos, now);  // on COMMIT
@@ -515,7 +515,7 @@ void Journaler::_do_flush(unsigned amount)
   }
 
   filer.write(ino, &layout, snapc,
-             flush_pos, len, write_bl, ceph_clock_now(&g_ceph_context),
+             flush_pos, len, write_bl, ceph_clock_now(g_ceph_context),
              0,
              NULL, onsafe);
 
@@ -586,7 +586,7 @@ void Journaler::flush(Context *onsafe)
   }
 
   // write head?
-  if (last_wrote_head.sec() + g_conf->journaler_write_head_interval < ceph_clock_now(&g_ceph_context).sec()) {
+  if (last_wrote_head.sec() + g_conf->journaler_write_head_interval < ceph_clock_now(g_ceph_context).sec()) {
     write_head();
   }
 }
@@ -635,7 +635,7 @@ void Journaler::_issue_prezero()
     }
     SnapContext snapc;
     Context *c = new C_Journaler_Prezero(this, prezeroing_pos, len);
-    filer.zero(ino, &layout, snapc, prezeroing_pos, len, ceph_clock_now(&g_ceph_context), 0, NULL, c);
+    filer.zero(ino, &layout, snapc, prezeroing_pos, len, ceph_clock_now(g_ceph_context), 0, NULL, c);
     prezeroing_pos += len;
   }
 }
@@ -989,7 +989,7 @@ void Journaler::trim()
   uint64_t first = trimming_pos / period;
   uint64_t num = (trim_to - trimming_pos) / period;
   SnapContext snapc;
-  filer.purge_range(ino, &layout, snapc, first, num, ceph_clock_now(&g_ceph_context), 0, 
+  filer.purge_range(ino, &layout, snapc, first, num, ceph_clock_now(g_ceph_context), 0, 
                    new C_Trim(this, trim_to));
   trimming_pos = trim_to;  
 }
@@ -1010,7 +1010,7 @@ void Journaler::_trim_finish(int r, uint64_t to)
   // finishers?
   while (!waitfor_trim.empty() &&
         waitfor_trim.begin()->first <= trimmed_pos) {
-    finish_contexts(&g_ceph_context, waitfor_trim.begin()->second, 0);
+    finish_contexts(g_ceph_context, waitfor_trim.begin()->second, 0);
     waitfor_trim.erase(waitfor_trim.begin());
   }
 }
index 139bc54e9ebccdc63f5a5d35ef745ad06bb210e5..6d50f66be00331bd47d3013ea73d4a9416c883ec 100644 (file)
@@ -520,7 +520,7 @@ void ObjectCacher::bh_read_finish(int poolid, sobject_t oid, loff_t start, uint6
            p++)
         ls.splice(ls.end(), p->second);
       bh->waitfor_read.clear();
-      finish_contexts(&g_ceph_context, ls);
+      finish_contexts(g_ceph_context, ls);
 
       // clean up?
       ob->try_merge_bh(bh);
@@ -617,7 +617,7 @@ void ObjectCacher::lock_ack(int poolid, list<sobject_t>& oids, tid_t tid)
                << " tid " << tid << " obsolete" << dendl;
     }
 
-    finish_contexts(&g_ceph_context, ls);
+    finish_contexts(g_ceph_context, ls);
 
   }
 }
@@ -678,7 +678,7 @@ void ObjectCacher::bh_write_ack(int poolid, sobject_t oid, loff_t start, uint64_
       list<Context*> ls;
       ls.splice(ls.begin(), ob->waitfor_ack[tid]);
       ob->waitfor_ack.erase(tid);
-      finish_contexts(&g_ceph_context, ls);
+      finish_contexts(g_ceph_context, ls);
     }
 
     // is the entire object set now clean?
@@ -713,7 +713,7 @@ void ObjectCacher::bh_write_commit(int poolid, sobject_t oid, loff_t start, uint
       list<Context*> ls;
       ls.splice(ls.begin(), ob->waitfor_commit[tid]);
       ob->waitfor_commit.erase(tid);
-      finish_contexts(&g_ceph_context, ls);
+      finish_contexts(g_ceph_context, ls);
     }
 
     // is the entire object set now clean and fully committed?
@@ -736,7 +736,7 @@ void ObjectCacher::bh_write_commit(int poolid, sobject_t oid, loff_t start, uint
 
 void ObjectCacher::flush(loff_t amount)
 {
-  utime_t cutoff = ceph_clock_now(&g_ceph_context);
+  utime_t cutoff = ceph_clock_now(g_ceph_context);
   //cutoff.sec_ref() -= g_conf->client_oc_max_dirty_age;
 
   dout(10) << "flush " << amount << dendl;
@@ -960,7 +960,7 @@ int ObjectCacher::readx(OSDRead *rd, ObjectSet *oset, Context *onfinish)
 
 int ObjectCacher::writex(OSDWrite *wr, ObjectSet *oset)
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   
   for (vector<ObjectExtent>::iterator ex_it = wr->extents.begin();
        ex_it != wr->extents.end();
@@ -1071,7 +1071,7 @@ void ObjectCacher::flusher_entry()
       }
       else {
         // check tail of lru for old dirty items
-        utime_t cutoff = ceph_clock_now(&g_ceph_context);
+        utime_t cutoff = ceph_clock_now(g_ceph_context);
         cutoff.sec_ref()--;
         BufferHead *bh = 0;
         while ((bh = (BufferHead*)lru_dirty.lru_get_next_expire()) != 0 &&
@@ -1083,7 +1083,7 @@ void ObjectCacher::flusher_entry()
       }
     }
     if (flusher_stop) break;
-    flusher_cond.WaitInterval(&g_ceph_context, lock, utime_t(1,0));
+    flusher_cond.WaitInterval(g_ceph_context, lock, utime_t(1,0));
   }
   lock.Unlock();
   dout(10) << "flusher finish" << dendl;
@@ -1488,7 +1488,7 @@ bool ObjectCacher::flush_set(ObjectSet *oset, Context *onfinish)
     if (!flush(ob)) {
       // we'll need to gather...
       if (!gather && onfinish) 
-        gather = new C_Gather(&g_ceph_context, onfinish);
+        gather = new C_Gather(g_ceph_context, onfinish);
       safe = false;
 
       dout(10) << "flush_set " << oset << " will wait for ack tid " 
@@ -1535,7 +1535,7 @@ bool ObjectCacher::commit_set(ObjectSet *oset, Context *onfinish)
       dout(10) << "commit_set " << oset << " " << *ob 
                << " will finish on commit tid " << ob->last_write_tid
                << dendl;
-      if (!gather && onfinish) gather = new C_Gather(&g_ceph_context, onfinish);
+      if (!gather && onfinish) gather = new C_Gather(g_ceph_context, onfinish);
       safe = false;
       if (gather)
         ob->waitfor_commit[ob->last_write_tid].push_back( gather->new_sub() );
@@ -1735,7 +1735,7 @@ void ObjectCacher::kick_sync_writers(ObjectSet *oset)
     ls.splice(ls.begin(), ob->waitfor_wr);
   }
 
-  finish_contexts(&g_ceph_context, ls);
+  finish_contexts(g_ceph_context, ls);
 }
 
 void ObjectCacher::kick_sync_readers(ObjectSet *oset)
@@ -1756,7 +1756,7 @@ void ObjectCacher::kick_sync_readers(ObjectSet *oset)
     ls.splice(ls.begin(), ob->waitfor_rd);
   }
 
-  finish_contexts(&g_ceph_context, ls);
+  finish_contexts(g_ceph_context, ls);
 }
 
 
index 6cee31561c84e6a065683c5c8263fe66a16ea6b8..ab562a54b082d4c0d9ba327ff8ab25f3d1a5b983 100644 (file)
@@ -416,7 +416,7 @@ class ObjectCacher {
   void mark_dirty(BufferHead *bh) { 
     bh_set_state(bh, BufferHead::STATE_DIRTY); 
     lru_dirty.lru_touch(bh);
-    //bh->set_dirty_stamp(ceph_clock_now(&g_ceph_context));
+    //bh->set_dirty_stamp(ceph_clock_now(g_ceph_context));
   };
 
   void bh_add(Object *ob, BufferHead *bh) {
index 1e17cd301681f9aa0dd209cf0fb39aa18f760360..4f833102bb26054010294b842ab5dba2d5763adc 100644 (file)
@@ -409,7 +409,7 @@ void Objecter::tick()
   set<OSDSession*> toping;
 
   // look for laggy requests
-  utime_t cutoff = ceph_clock_now(&g_ceph_context);
+  utime_t cutoff = ceph_clock_now(g_ceph_context);
   cutoff -= g_conf->objecter_timeout;  // timeout
 
   for (hash_map<tid_t,Op*>::iterator p = ops.begin();
@@ -440,7 +440,7 @@ void Objecter::tick()
 
 void Objecter::resend_mon_ops()
 {
-  utime_t cutoff = ceph_clock_now(&g_ceph_context);
+  utime_t cutoff = ceph_clock_now(g_ceph_context);
   cutoff -= g_conf->objecter_mon_retry_interval;
 
 
@@ -651,7 +651,7 @@ void Objecter::send_op(Op *op)
 
   op->paused = false;
   op->incarnation = op->session->incarnation;
-  op->stamp = ceph_clock_now(&g_ceph_context);
+  op->stamp = ceph_clock_now(g_ceph_context);
 
   MOSDOp *m = new MOSDOp(client_inc, op->tid, 
                         op->oid, op->oloc, op->pgid, osdmap->get_epoch(),
@@ -1081,7 +1081,7 @@ void Objecter::pool_op_submit(PoolOp *op) {
   if (op->snapid) m->snapid = op->snapid;
   if (op->crush_rule) m->crush_rule = op->crush_rule;
   monc->send_mon_message(m);
-  op->last_submit = ceph_clock_now(&g_ceph_context);
+  op->last_submit = ceph_clock_now(g_ceph_context);
 }
 
 /**
@@ -1142,7 +1142,7 @@ void Objecter::poolstat_submit(PoolStatOp *op)
 {
   dout(10) << "poolstat_submit " << op->tid << dendl;
   monc->send_mon_message(new MGetPoolStats(monc->get_fsid(), op->tid, op->pools, last_seen_pgmap_version));
-  op->last_submit = ceph_clock_now(&g_ceph_context);
+  op->last_submit = ceph_clock_now(g_ceph_context);
 }
 
 void Objecter::handle_get_pool_stats_reply(MGetPoolStatsReply *m)
@@ -1184,7 +1184,7 @@ void Objecter::fs_stats_submit(StatfsOp *op)
 {
   dout(10) << "fs_stats_submit" << op->tid << dendl;
   monc->send_mon_message(new MStatfs(monc->get_fsid(), op->tid, last_seen_pgmap_version));
-  op->last_submit = ceph_clock_now(&g_ceph_context);
+  op->last_submit = ceph_clock_now(g_ceph_context);
 }
 
 void Objecter::handle_fs_stats_reply(MStatfsReply *m) {
index cfa17ea83ce709b01bb791b49b1d3252c902d316..1532681866fbcf1048cf55a0d8c0f83efc9cf196 100644 (file)
@@ -1061,7 +1061,7 @@ public:
       read_trunc(extents[0].oid, extents[0].oloc, extents[0].offset, extents[0].length,
           snap, bl, flags, trunc_size, trunc_seq, onfinish);
     } else {
-      C_Gather *g = new C_Gather(&g_ceph_context);
+      C_Gather *g = new C_Gather(g_ceph_context);
       vector<bufferlist> resultbl(extents.size());
       int i=0;
       for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
@@ -1085,9 +1085,9 @@ public:
     } else {
       C_Gather *gack = 0, *gcom = 0;
       if (onack)
-       gack = new C_Gather(&g_ceph_context, onack);
+       gack = new C_Gather(g_ceph_context, onack);
       if (oncommit)
-       gcom = new C_Gather(&g_ceph_context, oncommit);
+       gcom = new C_Gather(g_ceph_context, oncommit);
       for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
        bufferlist cur;
        for (map<__u32,__u32>::iterator bit = p->buffer_extents.begin();
index 22a435b998567bb6799d46d246581a86a1a1d703..9420fb4cbfc1b51b1017b5252d6edff5d7219a4e 100644 (file)
@@ -167,10 +167,10 @@ int write_bench(librados::Rados& rados, librados::IoCtx& io_ctx,
 
   pthread_create(&print_thread, NULL, status_printer, (void *)data);
   dataLock.Lock();
-  data->start_time = ceph_clock_now(&g_ceph_context);
+  data->start_time = ceph_clock_now(g_ceph_context);
   dataLock.Unlock();
   for (int i = 0; i<concurrentios; ++i) {
-    start_times[i] = ceph_clock_now(&g_ceph_context);
+    start_times[i] = ceph_clock_now(g_ceph_context);
     completions[i] = rados.aio_create_completion((void *) &cond, 0,
                                                 &_aio_cb);
     r = io_ctx.aio_write(name[i], completions[i], *contents[i], data->object_size, 0);
@@ -192,7 +192,7 @@ int write_bench(librados::Rados& rados, librados::IoCtx& io_ctx,
 
   runtime.set_from_double(secondsToRun);
   stopTime = data->start_time + runtime;
-  while( ceph_clock_now(&g_ceph_context) < stopTime ) {
+  while( ceph_clock_now(g_ceph_context) < stopTime ) {
     dataLock.Lock();
     while (1) {
       for (slot = 0; slot < concurrentios; ++slot) {
@@ -219,7 +219,7 @@ int write_bench(librados::Rados& rados, librados::IoCtx& io_ctx,
       dataLock.Unlock();
       goto ERR;
     }
-    data->cur_latency = ceph_clock_now(&g_ceph_context) - start_times[slot];
+    data->cur_latency = ceph_clock_now(g_ceph_context) - start_times[slot];
     total_latency += data->cur_latency;
     if( data->cur_latency > data->max_latency) data->max_latency = data->cur_latency;
     if (data->cur_latency < data->min_latency) data->min_latency = data->cur_latency;
@@ -229,11 +229,11 @@ int write_bench(librados::Rados& rados, librados::IoCtx& io_ctx,
     dataLock.Unlock();
     completions[slot]->release();
     completions[slot] = 0;
-    timePassed = ceph_clock_now(&g_ceph_context) - data->start_time;
+    timePassed = ceph_clock_now(g_ceph_context) - data->start_time;
 
     //write new stuff to rados, then delete old stuff
     //and save locations of new stuff for later deletion
-    start_times[slot] = ceph_clock_now(&g_ceph_context);
+    start_times[slot] = ceph_clock_now(g_ceph_context);
     completions[slot] = rados.aio_create_completion((void *) &cond, 0, &_aio_cb);
     r = io_ctx.aio_write(newName, completions[slot], *newContents, data->object_size, 0);
     if (r < 0) {//naughty; doesn't clean up heap space.
@@ -258,7 +258,7 @@ int write_bench(librados::Rados& rados, librados::IoCtx& io_ctx,
       dataLock.Unlock();
       goto ERR;
     }
-    data->cur_latency = ceph_clock_now(&g_ceph_context) - start_times[slot];
+    data->cur_latency = ceph_clock_now(g_ceph_context) - start_times[slot];
     total_latency += data->cur_latency;
     if (data->cur_latency > data->max_latency) data->max_latency = data->cur_latency;
     if (data->cur_latency < data->min_latency) data->min_latency = data->cur_latency;
@@ -272,7 +272,7 @@ int write_bench(librados::Rados& rados, librados::IoCtx& io_ctx,
     delete contents[slot];
   }
 
-  timePassed = ceph_clock_now(&g_ceph_context) - data->start_time;
+  timePassed = ceph_clock_now(g_ceph_context) - data->start_time;
   dataLock.Lock();
   data->done = true;
   dataLock.Unlock();
@@ -352,13 +352,13 @@ int seq_read_bench(librados::Rados& rados, librados::IoCtx& io_ctx, int seconds_
   pthread_create(&print_thread, NULL, status_printer, (void *)data);
 
   dataLock.Lock();
-  data->start_time = ceph_clock_now(&g_ceph_context);
+  data->start_time = ceph_clock_now(g_ceph_context);
   dataLock.Unlock();
   utime_t finish_time = data->start_time + time_to_run;
   //start initial reads
   for (int i = 0; i < concurrentios; ++i) {
     index[i] = i;
-    start_times[i] = ceph_clock_now(&g_ceph_context);
+    start_times[i] = ceph_clock_now(g_ceph_context);
     completions[i] = rados.aio_create_completion((void *) &cond, &_aio_cb, 0);
     r = io_ctx.aio_read(name[i], completions[i], contents[i], data->object_size, 0);
     if (r < 0) { //naughty, doesn't clean up heap -- oh, or handle the print thread!
@@ -376,7 +376,7 @@ int seq_read_bench(librados::Rados& rados, librados::IoCtx& io_ctx, int seconds_
   char* newName;
   bufferlist *cur_contents;
 
-  while (seconds_to_run && (ceph_clock_now(&g_ceph_context) < finish_time) &&
+  while (seconds_to_run && (ceph_clock_now(g_ceph_context) < finish_time) &&
       write_data->finished > data->started) {
     dataLock.Lock();
     while (1) {
@@ -403,7 +403,7 @@ int seq_read_bench(librados::Rados& rados, librados::IoCtx& io_ctx, int seconds_
       dataLock.Unlock();
       goto ERR;
     }
-    data->cur_latency = ceph_clock_now(&g_ceph_context) - start_times[slot];
+    data->cur_latency = ceph_clock_now(g_ceph_context) - start_times[slot];
     total_latency += data->cur_latency;
     if( data->cur_latency > data->max_latency) data->max_latency = data->cur_latency;
     if (data->cur_latency < data->min_latency) data->min_latency = data->cur_latency;
@@ -416,7 +416,7 @@ int seq_read_bench(librados::Rados& rados, librados::IoCtx& io_ctx, int seconds_
     cur_contents = contents[slot];
 
     //start new read and check data if requested
-    start_times[slot] = ceph_clock_now(&g_ceph_context);
+    start_times[slot] = ceph_clock_now(g_ceph_context);
     contents[slot] = new bufferlist();
     completions[slot] = rados.aio_create_completion((void *) &cond, &_aio_cb, 0);
     r = io_ctx.aio_read(newName, completions[slot], contents[slot], data->object_size, 0);
@@ -448,7 +448,7 @@ int seq_read_bench(librados::Rados& rados, librados::IoCtx& io_ctx, int seconds_
       dataLock.Unlock();
       goto ERR;
     }
-    data->cur_latency = ceph_clock_now(&g_ceph_context) - start_times[slot];
+    data->cur_latency = ceph_clock_now(g_ceph_context) - start_times[slot];
     total_latency += data->cur_latency;
     if (data->cur_latency > data->max_latency) data->max_latency = data->cur_latency;
     if (data->cur_latency < data->min_latency) data->min_latency = data->cur_latency;
@@ -467,7 +467,7 @@ int seq_read_bench(librados::Rados& rados, librados::IoCtx& io_ctx, int seconds_
     delete contents[slot];
   }
 
-  runtime = ceph_clock_now(&g_ceph_context) - data->start_time;
+  runtime = ceph_clock_now(g_ceph_context) - data->start_time;
   dataLock.Lock();
   data->done = true;
   dataLock.Unlock();
@@ -534,7 +534,7 @@ void *status_printer(void * data_store) {
       / (1024*1024)
       / cycleSinceChange;
     avg_bandwidth = (double) (data->trans_size) * (data->finished)
-      / (double)(ceph_clock_now(&g_ceph_context) - data->start_time) / (1024*1024);
+      / (double)(ceph_clock_now(g_ceph_context) - data->start_time) / (1024*1024);
     if (previous_writes != data->finished) {
       previous_writes = data->finished;
       cycleSinceChange = 0;
@@ -561,7 +561,7 @@ void *status_printer(void * data_store) {
     }
     ++i;
     ++cycleSinceChange;
-    cond.WaitInterval(&g_ceph_context, dataLock, ONE_SECOND);
+    cond.WaitInterval(g_ceph_context, dataLock, ONE_SECOND);
   }
   dataLock.Unlock();
   return NULL;
index 76a20c20247615fd5cc3b9da11c145058211439d..a8acb989c8edbedf1b81e1199c00b4e16a998512 100644 (file)
@@ -51,7 +51,7 @@ int main(int argc, const char **argv)
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
              CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   const char *me = argv[0];
 
@@ -148,7 +148,7 @@ int main(int argc, const char **argv)
     }
     ceph_fsid_t fsid;
     memset(&fsid, 0, sizeof(ceph_fsid_t));
-    osdmap.build_simple(&g_ceph_context, 0, fsid, num_osd, num_dom, pg_bits, pgp_bits, lpg_bits);
+    osdmap.build_simple(g_ceph_context, 0, fsid, num_osd, num_dom, pg_bits, pgp_bits, lpg_bits);
     modified = true;
   }
 
index d99a41f07879804e4619b34c3cdbb97e795db3ea..ac71b561690f3972cd0af69be6a4471182b7f97a 100644 (file)
@@ -206,7 +206,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
 
   // open rados
   Rados rados;
-  ret = rados.init_with_context(&g_ceph_context);
+  ret = rados.init_with_context(g_ceph_context);
   if (ret) {
      cerr << "couldn't initialize rados! error " << ret << std::endl;
      return ret;
@@ -662,7 +662,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   std::map < std::string, std::string > opts;
   std::vector<const char*>::iterator i;
index f421db665460ba1adcc6d766207deeef0a0cee11..486a94bd6f56aa91f0b0705da8d7011466178c97 100644 (file)
@@ -1113,7 +1113,7 @@ int rados_tool_sync(const std::map < std::string, std::string > &opts,
 
   // open rados
   Rados rados;
-  if (rados.init_with_context(&g_ceph_context) < 0) {
+  if (rados.init_with_context(g_ceph_context) < 0) {
      cerr << "rados" << ": failed to initialize Rados!" << std::endl;
      exit(1);
   }
index 54bd0c4f5ce4afdfdeadb0a803a01db7212aabad..94f8e7b1894967562cd3ff2cfb4f1ec5fb99a33e 100644 (file)
@@ -507,8 +507,8 @@ static int do_watch(librados::IoCtx& pp, const char *imgname)
 
 static int do_kernel_add(const char *poolname, const char *imgname, const char *secretfile, const char *user)
 {
-  MonMap monmap(ceph_clock_now(&g_ceph_context));
-  int r = MonClient::build_initial_monmap(&g_ceph_context, monmap);
+  MonMap monmap(ceph_clock_now(g_ceph_context));
+  int r = MonClient::build_initial_monmap(g_ceph_context, monmap);
   if (r < 0)
     return r;
 
@@ -825,7 +825,7 @@ int main(int argc, const char **argv)
 
   int opt_cmd = OPT_NO_CMD;
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   const char *poolname = NULL;
   uint64_t size = 0;
@@ -942,7 +942,7 @@ int main(int argc, const char **argv)
   }
 
   bool talk_to_cluster = (opt_cmd != OPT_MAP && opt_cmd != OPT_UNMAP);
-  if (talk_to_cluster && rados.init_with_context(&g_ceph_context) < 0) {
+  if (talk_to_cluster && rados.init_with_context(g_ceph_context) < 0) {
     cerr << "error: couldn't initialize rados!" << std::endl;
     exit(1);
   }
index 8c4833eae5db1ecc6d7cee3d86ea952665774105..66d305dd479bd5470c1fb37c0683782efe894d28 100644 (file)
@@ -48,10 +48,10 @@ int librgw_create(librgw_t *rgw, const char * const id)
     common_init_finish(cct);
   }
   else {
-    cct = &g_ceph_context;
+    cct = g_ceph_context;
   }
   librgw_init_mutex.Unlock();
-  *rgw = &g_ceph_context;
+  *rgw = g_ceph_context;
   return 0;
 }
 
index f366b7f06ebc043f4ddf1514cbde8173103b98d9..6ab0479fb22fcdab4c33fc9ef7f9e55cb71838f3 100644 (file)
@@ -348,7 +348,7 @@ int main(int argc, char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   const char *user_id = 0;
   const char *access_key = 0;
@@ -477,7 +477,7 @@ int main(int argc, char **argv)
                     opt_cmd == OPT_SUBUSER_CREATE || opt_cmd == OPT_SUBUSER_RM ||
                     opt_cmd == OPT_KEY_CREATE || opt_cmd == OPT_KEY_RM);
 
-  store = RGWAccess::init_storage_provider("rados", &g_ceph_context);
+  store = RGWAccess::init_storage_provider("rados", g_ceph_context);
   if (!store) {
     cerr << "couldn't init storage provider" << std::endl;
     return 5; //EIO
index 25371631e83401fb2ad9b24c7fef3c748471734e..96aa4a15617e4cd9a79e5afc0add66cddaa659e0 100644 (file)
@@ -53,7 +53,7 @@ int rgw_log_op(struct req_state *s)
     entry.owner = s->acl->get_owner().get_id();
 
   entry.time = s->time;
-  entry.total_time = ceph_clock_now(&g_ceph_context) - s->time;
+  entry.total_time = ceph_clock_now(g_ceph_context) - s->time;
   entry.bytes_sent = s->bytes_sent;
   entry.bytes_received = s->bytes_received;
   if (s->err.http_ret) {
index 4e1c95866030b36ffe1cce09f55cac1ab2129987..b29999fa2a9d21b0dcf54326f7bf5c9f80e6b6df 100644 (file)
@@ -75,9 +75,9 @@ int main(int argc, const char **argv)
   argv_to_vec(argc, argv, args);
   env_to_vec(args);
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
-  if (!RGWAccess::init_storage_provider("rados", &g_ceph_context)) {
+  if (!RGWAccess::init_storage_provider("rados", g_ceph_context)) {
     derr << "Couldn't init storage provider (RADOS)" << dendl;
     return EIO;
   }
index dd2a9b89e977fe1e8039fc17a1788e6b1a69e7c3..5abaf979903ae762d5d0f328ca4e79c76aeba91e 100644 (file)
@@ -625,7 +625,7 @@ void RGWPutObj::execute()
       info.num = atoi(part_num.c_str());
       info.etag = etag;
       info.size = s->obj_size;
-      info.modified = ceph_clock_now(&g_ceph_context);
+      info.modified = ceph_clock_now(g_ceph_context);
       ::encode(info, bl);
       RGW_LOG(0) << "JJJ name=" << p << "bl.length()=" << bl.length() << dendl;
       meta_attrs[p] = bl;
@@ -1310,7 +1310,7 @@ void RGWHandler::init_state(struct req_state *s, struct fcgx_state *fcgx)
   s->os_auth_token = NULL;
   s->os_user = NULL;
   s->os_groups = NULL;
-  s->time = ceph_clock_now(&g_ceph_context);
+  s->time = ceph_clock_now(g_ceph_context);
   s->user.clear();
   s->perm_mask = 0;
 }
index c0c6b852d3758f5d5266852873ec6b3648b21985..302f05327a7ed00ff17ceca5dd79ed52a49616a6 100644 (file)
@@ -44,7 +44,7 @@ static int encode_token(string& os_user, string& key, bufferlist& bl)
   if (ret < 0)
     return ret;
 
-  utime_t expiration = ceph_clock_now(&g_ceph_context);
+  utime_t expiration = ceph_clock_now(g_ceph_context);
   expiration += RGW_OS_TOKEN_EXPIRATION; // 15 minutes
 
   ret = build_token(os_user, key, nonce, expiration, bl);
@@ -87,8 +87,8 @@ int rgw_os_verify_signed_token(const char *token, RGWUserInfo& info)
     RGW_LOG(0) << "failed to decode token" << dendl;
     return -EINVAL;
   }
-  if (expiration < ceph_clock_now(&g_ceph_context)) {
-    RGW_LOG(0) << "old timed out token was used now=" << ceph_clock_now(&g_ceph_context) << " token.expiration=" << expiration << dendl;
+  if (expiration < ceph_clock_now(g_ceph_context)) {
+    RGW_LOG(0) << "old timed out token was used now=" << ceph_clock_now(g_ceph_context) << " token.expiration=" << expiration << dendl;
     return -EPERM;
   }
 
index 15bf13fc1bb774e6768f04df43ec793d7c649b6e..4dc19ba43a99d9cda7d389d6300fc1afaf255bb3 100644 (file)
@@ -78,14 +78,14 @@ struct C_Ack : public Context {
   off_t off;
   C_Ack(off_t o) : off(o) {}
   void finish(int r) {
-    set_ack(off, ceph_clock_now(&g_ceph_context));
+    set_ack(off, ceph_clock_now(g_ceph_context));
   }
 };
 struct C_Commit : public Context {
   off_t off;
   C_Commit(off_t o) : off(o) {}
   void finish(int r) {
-    set_commit(off, ceph_clock_now(&g_ceph_context));
+    set_commit(off, ceph_clock_now(g_ceph_context));
   }
 };
 
@@ -97,7 +97,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   // args
   if (args.size() < 3) return -1;
@@ -133,7 +133,7 @@ int main(int argc, const char **argv)
   ft.create_collection(coll_t());
   fs->apply_transaction(ft);
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
   utime_t end = now;
   end += seconds;
   off_t pos = 0;
@@ -142,7 +142,7 @@ int main(int argc, const char **argv)
   while (now < end) {
     sobject_t poid(object_t("streamtest"), 0);
 
-    set_start(pos, ceph_clock_now(&g_ceph_context));
+    set_start(pos, ceph_clock_now(g_ceph_context));
     ObjectStore::Transaction *t = new ObjectStore::Transaction;
     t->write(coll_t(), poid, pos, bytes, bl);
     fs->queue_transaction(NULL, t, new C_Ack(pos), new C_Commit(pos));
index eb72e855a4eb2d82233872adbfea37e354325f71..1cce7d9f756556c7545e155b298b17e4b3fa6d7b 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   DoutStreambuf<char> *dos = new DoutStreambuf<char>();
 
index bf74a248f3001e661121923801b2825877a9ca40..3a8acefe6ac7ec09b3c020059dfdc332e40710d4 100644 (file)
@@ -95,7 +95,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   DEFINE_CONF_VARS(usage);
   FOR_EACH_ARG(args) {
index 6ef51a004028794b525b65e1a3120a04003a82b0..8ec059a55adb9fc98485637e8f6dbf9cdb1be50d 100644 (file)
@@ -94,7 +94,7 @@ static int basic_timer_test(T &timer, Mutex *lock)
     if (lock)
       lock->Lock();
     utime_t inc(2 * i, 0);
-    utime_t t = ceph_clock_now(&g_ceph_context) + inc;
+    utime_t t = ceph_clock_now(g_ceph_context) + inc;
     timer.add_event_at(t, test_contexts[i]);
     if (lock)
       lock->Unlock();
@@ -133,7 +133,7 @@ static int test_out_of_order_insertion(SafeTimer &timer, Mutex *lock)
 
   {
     utime_t inc(100, 0);
-    utime_t t = ceph_clock_now(&g_ceph_context) + inc;
+    utime_t t = ceph_clock_now(g_ceph_context) + inc;
     lock->Lock();
     timer.add_event_at(t, test_contexts[0]);
     lock->Unlock();
@@ -141,7 +141,7 @@ static int test_out_of_order_insertion(SafeTimer &timer, Mutex *lock)
 
   {
     utime_t inc(2, 0);
-    utime_t t = ceph_clock_now(&g_ceph_context) + inc;
+    utime_t t = ceph_clock_now(g_ceph_context) + inc;
     lock->Lock();
     timer.add_event_at(t, test_contexts[1]);
     lock->Unlock();
@@ -182,7 +182,7 @@ static int safe_timer_cancel_all_test(SafeTimer &safe_timer, Mutex& safe_timer_l
   safe_timer_lock.Lock();
   for (int i = 0; i < MAX_TEST_CONTEXTS; ++i) {
     utime_t inc(4 * i, 0);
-    utime_t t = ceph_clock_now(&g_ceph_context) + inc;
+    utime_t t = ceph_clock_now(g_ceph_context) + inc;
     safe_timer.add_event_at(t, test_contexts[i]);
   }
   safe_timer_lock.Unlock();
@@ -220,7 +220,7 @@ static int safe_timer_cancellation_test(SafeTimer &safe_timer, Mutex& safe_timer
   safe_timer_lock.Lock();
   for (int i = 0; i < MAX_TEST_CONTEXTS; ++i) {
     utime_t inc(4 * i, 0);
-    utime_t t = ceph_clock_now(&g_ceph_context) + inc;
+    utime_t t = ceph_clock_now(g_ceph_context) + inc;
     safe_timer.add_event_at(t, test_contexts[i]);
   }
   safe_timer_lock.Unlock();
@@ -256,11 +256,11 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   int ret;
   Mutex safe_timer_lock("safe_timer_lock");
-  SafeTimer safe_timer(&g_ceph_context, safe_timer_lock);
+  SafeTimer safe_timer(g_ceph_context, safe_timer_lock);
 
   ret = basic_timer_test <SafeTimer>(safe_timer, &safe_timer_lock);
   if (ret)
index 5b64aecd54b3b428250d594c68a14b487e5842f4..f6b4e629354393184958a2243b3e85000720ff78 100644 (file)
@@ -25,7 +25,7 @@ public:
 };
 
 TEST(ContextGather, Constructor) {
-  C_Gather *gather = new C_Gather(&g_ceph_context );
+  C_Gather *gather = new C_Gather(g_ceph_context );
   EXPECT_TRUE(gather->empty());
   EXPECT_EQ(0, gather->get_num());
   EXPECT_EQ(0, gather->get_num_remaining());
@@ -33,7 +33,7 @@ TEST(ContextGather, Constructor) {
 }
 
 TEST(ContextGather, OneSub) {
-  C_Gather *gather = new C_Gather(&g_ceph_context);
+  C_Gather *gather = new C_Gather(g_ceph_context);
   Context *sub = gather->new_sub();
   EXPECT_EQ(1, gather->get_num());
   EXPECT_EQ(1, gather->get_num_remaining());
@@ -50,7 +50,7 @@ TEST(ContextGather, OneSub) {
 }
 
 TEST(ContextGather, ManySubs) {
-  C_Gather *gather = new C_Gather(&g_ceph_context);
+  C_Gather *gather = new C_Gather(g_ceph_context);
   int sub_count = 8;
   bool finish_called = false;
   int result = 0;
@@ -81,7 +81,7 @@ TEST(ContextGather, ManySubs) {
 }
 
 TEST(ContextGather, AlternatingSubCreateFinish) {
-  C_Gather *gather = new C_Gather(&g_ceph_context);
+  C_Gather *gather = new C_Gather(g_ceph_context);
   int sub_count = 8;
   bool finish_called = false;
   int result = 0;
index 8595455836b769e2cae59fd5f8abde3335821a1b..40d0df3fe8b3d53c2d8760ed1a6ef83c986d00c6 100644 (file)
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
   }
   
  
-  utime_t start = ceph_clock_now(&g_ceph_context);
+  utime_t start = ceph_clock_now(g_ceph_context);
   while (loop++ < count) {
     ret = safe_write(fd, buf, bsize);
     if (ret)
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
   }
   ::fsync(fd);
   ::close(fd);
-  utime_t end = ceph_clock_now(&g_ceph_context);
+  utime_t end = ceph_clock_now(g_ceph_context);
   end -= start;
 
 
index 42548325de5facb8cc22c93323af4e908c35371c..aedb32a2ae0b5fce69337113e36ebb64eb7e7d3f 100644 (file)
@@ -36,7 +36,7 @@ int main(int argc, char **argv)
     
     int s = blocks*4096;
 
-    utime_t start = ceph_clock_now(&g_ceph_context);
+    utime_t start = ceph_clock_now(g_ceph_context);
     for (int i=0; i<count; i++) {
       off64_t so, o = (lrand48() % numblocks) * 4096;
       //cout << "s = " << s << " o = " << o << endl;
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
       //int r = ::read(fd, buf, s);
       if (r < 0) cout << "r = " << r << " " << strerror(errno) << endl;
     }
-    utime_t end = ceph_clock_now(&g_ceph_context);
+    utime_t end = ceph_clock_now(g_ceph_context);
     
     double timeper = end - start;
     timeper /= count;
index 407a722adf660b250eb75aad79c1cbbb69fb2389..cd2585d465cb25864413651b77cda9fb8e168437 100644 (file)
@@ -50,10 +50,10 @@ int main(int argc, char **argv)
       so = o + 4096*((rand() % range) );//- range/2);
       //cout << o << " " << so << " " << (so-o) << endl;
 
-      utime_t start = ceph_clock_now(&g_ceph_context);
+      utime_t start = ceph_clock_now(g_ceph_context);
       lseek64(fd, so, SEEK_SET);
       r = ::read(fd, buf, blocks*4096);
-      utime_t end = ceph_clock_now(&g_ceph_context);
+      utime_t end = ceph_clock_now(g_ceph_context);
       timeper += (end-start);
     }
     
index a69dd73dc2b1897c413f288b05b340a1d0000a5d..2d42eba864bb2d387c88a3636214b48d4717588f 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
   DecayCounter dc(hl);
   RealCounter rc;
 
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   for (int ms=0; ms < 300*1000; ms++) {
        if (ms % 30000 == 0) {
index bdcfb99f0758e301ad22d70d05aaa738c853d580..dc7c554e7836fbd6b6a5f0e1866c1f40af947a20 100644 (file)
@@ -6,7 +6,7 @@ CephContext *get_global_context(void)
 }
 
 /* This program exists to test that we can build libcommon without
- * referencing g_ceph_context.
+ * referencing g_ceph_context->
  *
  * This program will go away as soon as we actually don't use g_ceph_context in
  * more programs. Obviously, at that point, those programs will provide an
index b3faf7a86aa916858a8969eae85669800bc1ebdd..8ebb44176387d628f7ec50627e8afdba65447f37 100644 (file)
@@ -44,7 +44,7 @@ int main(int argc, const char **argv)
   argv_to_vec(argc, argv, args);
   env_to_vec(args);
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   string val;
   string oid("test_object");
@@ -67,7 +67,7 @@ int main(int argc, const char **argv)
   }
 
   Rados rados;
-  if (rados.init_with_context(&g_ceph_context) < 0) {
+  if (rados.init_with_context(g_ceph_context) < 0) {
      cerr << "couldn't initialize rados!" << std::endl;
      return 1;
   }
index 916798384638900085eb39bdb1ac8d58a12c03e0..2a12c15b12d060cf41eb399fb9f849b43439888d 100644 (file)
@@ -36,7 +36,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   // args
   if (args.size() < 2) return -1;
index 49b3258705c235ec8f3054aa9ab71c9ab5c01b98..f8abdad6e68cb170a29ddb841384957ac44b1318 100644 (file)
@@ -11,7 +11,7 @@ int main(int argc, char *argv[])
   char aes_key[AES_KEY_LEN];
   memset(aes_key, 0x77, sizeof(aes_key));
   bufferptr keybuf(aes_key, sizeof(aes_key));
-  CryptoKey key(CEPH_CRYPTO_AES, ceph_clock_now(&g_ceph_context), keybuf);
+  CryptoKey key(CEPH_CRYPTO_AES, ceph_clock_now(g_ceph_context), keybuf);
 
   const char *msg="hello! this is a message\n";
   char pad[16];
index 2ad90895c39e95327a7adbb49cbb823660b0a3ed..6d04305b089a0fd11950d41a205036b19946f7bb 100644 (file)
@@ -12,9 +12,9 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
-  KeyServer server(&g_ceph_context);
+  KeyServer server(g_ceph_context);
 
   dout(0) << "server created" << dendl;
 
@@ -24,7 +24,7 @@ int main(int argc, const char **argv)
   char aes_key[AES_KEY_LEN];
   memset(aes_key, 0x77, sizeof(aes_key));
   bufferptr keybuf(aes_key, sizeof(aes_key));
-  CryptoKey key(CEPH_CRYPTO_AES, ceph_clock_now(&g_ceph_context), keybuf);
+  CryptoKey key(CEPH_CRYPTO_AES, ceph_clock_now(g_ceph_context), keybuf);
 
   const char *msg="hello! this is a message\n";
   char pad[16];
index feb8d0b3171c9e953f4e375d2508c4f4c6cc6ddd..6fb7198b763ea8c2ab3de7231ecf66d956c30ca2 100644 (file)
@@ -47,7 +47,7 @@ uint64_t received = 0;
 class Admin : public Dispatcher {
 public:
   Admin() 
-    : Dispatcher(&g_ceph_context)
+    : Dispatcher(g_ceph_context)
   {
   }
 private:
@@ -77,14 +77,14 @@ int main(int argc, const char **argv, const char *envp[]) {
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   vec_to_argv(args, argc, argv);
 
   dout(0) << "i am mon " << args[0] << dendl;
 
   // get monmap
-  MonClient mc(&g_ceph_context);
+  MonClient mc(g_ceph_context);
   if (mc.build_initial_monmap() < 0)
     return -1;
   
@@ -92,7 +92,7 @@ int main(int argc, const char **argv, const char *envp[]) {
   int whoami = mc.monmap.get_rank(args[0]);
   assert(whoami >= 0);
   g_conf->public_addr = mc.monmap.get_addr(whoami);
-  SimpleMessenger *rank = new SimpleMessenger(&g_ceph_context);
+  SimpleMessenger *rank = new SimpleMessenger(g_ceph_context);
   int err = rank->bind(getpid());
   if (err < 0)
     return 1;
index 92cb25eecf98aa8b34904c64a8b8b48e440b2868..33d0a14bd4f4cb3a9924071244a97074b232a0b9 100644 (file)
@@ -117,7 +117,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   vec_to_argv(args, argc, argv);
 
index 23da5449075c476d176fd9776e34b14a58c1fea9..3392edb533d011f8bc3cf5c5bc5f72051d3ed8f9 100644 (file)
@@ -90,7 +90,7 @@ static void handle_observe(CephToolCtx *ctx, MMonObserve *observe)
 
 static void handle_notify(CephToolCtx *ctx, MMonObserveNotify *notify)
 {
-  utime_t now = ceph_clock_now(&g_ceph_context);
+  utime_t now = ceph_clock_now(g_ceph_context);
 
   dout(1) << notify->get_source() << " -> " << get_paxos_name(notify->machine_id)
          << " v" << notify->ver
@@ -273,14 +273,14 @@ static void send_command(CephToolCtx *ctx)
   m->set_data(pending_bl);
 
   if (!ctx->concise)
-    *ctx->log << ceph_clock_now(&g_ceph_context) << " mon" << " <- " << pending_cmd << std::endl;
+    *ctx->log << ceph_clock_now(g_ceph_context) << " mon" << " <- " << pending_cmd << std::endl;
   ctx->mc.send_mon_message(m);
 }
 
 class Admin : public Dispatcher {
 public:
   Admin(CephToolCtx *ctx_)
-    : Dispatcher(&g_ceph_context),
+    : Dispatcher(g_ceph_context),
       ctx(ctx_)
   {
   }
@@ -340,7 +340,7 @@ static int do_command(CephToolCtx *ctx,
   rs = rs;
   rbl = reply_bl;
   if (!ctx->concise)
-    *ctx->log << ceph_clock_now(&g_ceph_context) << " "
+    *ctx->log << ceph_clock_now(g_ceph_context) << " "
           << reply_from.name << " -> '"
           << reply_rs << "' (" << reply_rc << ")"
           << std::endl;
@@ -530,7 +530,7 @@ CephToolCtx* ceph_tool_common_init(ceph_tool_mode_t mode, bool concise)
   ceph_tool_mode = mode;
 
   std::auto_ptr <CephToolCtx> ctx;
-  ctx.reset(new CephToolCtx(&g_ceph_context, concise));
+  ctx.reset(new CephToolCtx(g_ceph_context, concise));
 
   // get monmap
   if (ctx->mc.build_initial_monmap() < 0)
@@ -540,7 +540,7 @@ CephToolCtx* ceph_tool_common_init(ceph_tool_mode_t mode, bool concise)
   tok = tok_init(NULL);
 
   // start up network
-  messenger = new SimpleMessenger(&g_ceph_context);
+  messenger = new SimpleMessenger(g_ceph_context);
   messenger->register_entity(entity_name_t::CLIENT());
   messenger->start_with_nonce(getpid());
   ctx->dispatcher = new Admin(ctx.get());
index 17e61825e0fdb11f380ef5599a34b7be7f1fccbf..e91d1ca6879f1c35c526ade16a48fc22446c91df 100644 (file)
@@ -61,7 +61,7 @@ public:
   CephToolCtx(CephContext *cct_, bool concise_) :
     cct(cct_),
     mdsmap(cct_),
-    mc(&g_ceph_context),
+    mc(g_ceph_context),
     updates(EVERYTHING_UPDATE),
     log(&std::cout),
     slog(NULL),
index 7a80fb3f33cccf8ba0ffae21c838cc58f0911882..9fd0b9f5e5e84b62db9c2f0278cf61c1ba10b39a 100644 (file)
@@ -79,7 +79,7 @@ int main(int argc, const char **argv)
   env_to_vec(args);
 
   global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
-  common_init_finish(&g_ceph_context);
+  common_init_finish(g_ceph_context);
 
   vec_to_argv(args, argc, argv);
 
index ad8353fc542c826afea879ff19473234ba188b33..f1c94dc325fba57e3c397e20fc664884a6a233ae 100644 (file)
@@ -133,7 +133,7 @@ public:
     CephToolCtx *ctx = gui->ctx;
     ctx->lock.Lock();
     while (true) {
-      utime_t t(ceph_clock_now(&g_ceph_context));
+      utime_t t(ceph_clock_now(g_ceph_context));
       t += 3.0;
       ctx->gui_cond.WaitUntil(ctx->lock, t);
       if (shutting_down) {