]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
csyn chunk stub
authorSage Weil <sage@newdream.net>
Wed, 21 May 2008 00:26:58 +0000 (17:26 -0700)
committerSage Weil <sage@newdream.net>
Wed, 21 May 2008 00:26:58 +0000 (17:26 -0700)
src/client/SyntheticClient.cc
src/client/SyntheticClient.h
src/common/cas.h

index 4b29600ce61b3284702140c2c2ef14404df6d74f..6bd887f3ccffbcbf0369a704abb63420c662da9a 100644 (file)
@@ -216,6 +216,10 @@ void parse_syn_options(vector<const char*>& args)
        syn_sargs.push_back(args[++i]);
        syn_sargs.push_back(args[++i]);
        syn_iargs.push_back(atoi(args[++i]));
+
+      } else if (strcmp(args[i], "chunkfile") == 0) {
+       syn_modes.push_back(SYNCLIENT_MODE_CHUNK);
+       syn_sargs.push_back(args[++i]);
       } else {
         cerr << "unknown syn arg " << args[i] << std::endl;
         assert(0);
@@ -3042,3 +3046,22 @@ void SyntheticClient::import_find(const char *base, const char *find, bool data)
 
 }
 
+
+int SyntheticClient::chunk_file(string &filename)
+{
+  int fd = client->open(filename.c_str(), O_RDONLY);
+  if (fd < 0) return fd;
+
+  struct stat st;
+  client->fstat(fd, &st);
+  __u64 size = st.st_size;
+
+  dout(0) << "file " << filename << " size is " << size << dendl;
+
+
+
+
+
+  client->close(fd);
+  return 0;
+}
index 823ab80c42d297757698abc82a500de90f0a2b67..306f406d30386d2c7563321eed3ed90659555852 100644 (file)
@@ -75,6 +75,8 @@
 
 #define SYNCLIENT_MODE_IMPORTFIND 300
 
+#define SYNCLIENT_MODE_CHUNK    400
+
 
 
 void parse_syn_options(vector<const char*>& args);
@@ -244,6 +246,7 @@ class SyntheticClient {
 
   void import_find(const char *basedir, const char *find, bool writedata);
 
+  int chunk_file(string &filename);
 };
 
 #endif
index f8691f1a71a4e7d27d917a93d0bf60689c6fdfd9..073c015ba22f6e56ec3b6703a9f3674a396c5a92 100644 (file)
@@ -8,4 +8,5 @@
 object_t calc_cas_name(bufferlist &bl);
 void chunk_buffer(bufferlist &bl, list<bufferlist> &chunks);
 
+
 #endif