]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 9 Jun 2005 19:37:06 +0000 (19:37 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 9 Jun 2005 19:37:06 +0000 (19:37 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@287 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/client/Client.cc
ceph/client/SyntheticClient.cc
ceph/config.cc
ceph/mds/MDCache.cc
ceph/mds/MDS.cc

index ec6c34fb48ee6be6f9da68eb199a309329ed1164..e4a14e3fc1538c5dcb8c60e0cb954466c0a4a3b0 100644 (file)
@@ -1043,7 +1043,7 @@ int Client::write(fileh_t fh, const char *buf, size_t size, off_t offset)
 
 
   // buffered write?
-  if (f->caps & CFILE_CAP_WRBUFFER) {
+  if (false && f->caps & CFILE_CAP_WRBUFFER) {
        // buffered write
        dout(10) << "buffered/async write" << endl;
 
index e4725389e0d1f6eba8dcdaf1690276074adf9e81..f0f11951b11c3058c69b4cf94d2b77ac6ff2c42d 100644 (file)
@@ -39,6 +39,7 @@ int SyntheticClient::run()
        break;
   case SYNCLIENT_MODE_WRITEFILE:
        write_file(sarg1, iarg1);
+       break;
   default:
        assert(0);
   }
@@ -166,15 +167,17 @@ int SyntheticClient::make_dirs(const char *basedir, int dirs, int files, int dep
 
 int SyntheticClient::write_file(string& fn, int size)   // size is in MB
 {
-  char *buf = new char[1024*1024];   // 1 MB
+  int wrsize = 1024*256;
+  char *buf = new char[wrsize];   // 1 MB
+  int chunks = size * 1024*1024 / wrsize;
 
-  int fd = client->open(fn.c_str(), O_WRONLY);
+  int fd = client->open(fn.c_str(), O_WRONLY|O_CREAT);
   dout(5) << "writing to " << fn << " fd " << fd << endl;
   if (fd < 0) return fd;
 
-  for (int i=0; i<size; i++) {
-       dout(5) << "writing block " << i << "/" << size << endl;
-       client->write(fd, buf, 1024*1024, i*1024*1024);
+  for (int i=0; i<chunks; i++) {
+       dout(2) << "writing block " << i << "/" << chunks << endl;
+       client->write(fd, buf, wrsize, i*wrsize);
   }
   
   client->close(fd);
index d03f5ec147fc7998502b94354907f6252bb78eea..4edad99301fb45bee7daed1985c766d01e63284c 100644 (file)
@@ -114,7 +114,7 @@ void parse_config_options(int argc, char **argv,
        else if (strcmp(argv[i], "--mds_bal_interval") == 0) 
          g_conf.mds_bal_interval = atoi(argv[++i]);
        else {
-         cout << "passing arg " << argv[i] << endl;
+         //cout << "passing arg " << argv[i] << endl;
          nargv[nargc++] = argv[i];
        }
   }
index 09aa9406b217d584ef86469f2f0cfd5282b591ea..46f87d44cf936f172b0c152b9ea389bdfad1aff9 100644 (file)
@@ -565,9 +565,10 @@ bool MDCache::shutdown_pass()
   } 
   
   // make a pass on the cache
-  dout(7) << "log is empty.  flushing cache" << endl;
-  trim(0);
-  
+  if (g_conf.mds_log_flush_on_shutdown) {
+       dout(7) << "log is empty.  flushing cache" << endl;
+       trim(0);
+  }
   dout(7) << "cache size now " << lru.lru_get_size() << endl;
   
   // send all imports back to 0.
@@ -610,7 +611,8 @@ bool MDCache::shutdown_pass()
   assert(inode_map.size() == lru.lru_get_size());
 
   // done?
-  if (lru.lru_get_size() == 0 && !mds->filer->is_active()) {
+  if ((lru.lru_get_size() == 0 || g_conf.mds_log_flush_on_shutdown == false) && 
+         !mds->filer->is_active()) {
        if (mds->get_nodeid() != 0) {
          dout(7) << "done, sending shutdown_finish" << endl;
          mds->messenger->send_message(new MGenericMessage(MSG_MDS_SHUTDOWNFINISH),
index 4fc5348eb6b7014d7359a14f311d2ad856235dcb..b37701f62a5e40d3b515723d6849873aebb30575 100644 (file)
@@ -454,10 +454,10 @@ void MDS::handle_client_mount(MClientMount *m)
                dout(3) << "wiping osds too" << endl;
                mds_paused = true;
                filer->mkfs(new C_MDS_Unpause(this));
+               waiting_for_unpause.push_back(new C_MDS_RetryMessage(this, m));
+               return;
          }
          
-         waiting_for_unpause.push_back(new C_MDS_RetryMessage(this, m));
-         return;
        }
   }