]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tools/cephfs: Remove cephfs-data-scan tmap_upgrade
authorDouglas Fuller <dfuller@redhat.com>
Fri, 1 Jul 2016 20:02:00 +0000 (13:02 -0700)
committerDouglas Fuller <dfuller@redhat.com>
Fri, 1 Jul 2016 20:02:00 +0000 (13:02 -0700)
tmap_upgrade was only for Jewel, so remove it for Kraken.

Fixes: http://tracker.ceph.com/issues/16144
Signed-off-by: Douglas Fuller <dfuller@redhat.com>
src/tools/cephfs/DataScan.cc
src/tools/cephfs/DataScan.h

index 986171d087647ecb73ab7e4d9f44848a8be28670..bbb8e366fccf7de15a5baebdcac5335bca710f82 100644 (file)
@@ -39,8 +39,6 @@ void DataScan::usage()
     << "    --force-pool: use data pool even if it is not in FSMap\n"
     << "\n"
     << "  cephfs-data-scan scan_frags [--force-corrupt]\n"
-    << "\n"
-    << "  cephfs-data-scan tmap_upgrade <metadata_pool>\n"
     << std::endl;
 
   generic_client_usage();
@@ -166,54 +164,11 @@ int DataScan::main(const std::vector<const char*> &args)
       continue;
     }
 
-    // Trailing positional argument
-    if (i + 1 == args.end() && (command == "tmap_upgrade")) {
-      metadata_pool_name = *i;
-      continue;
-    }
-
     // Fall through: unhandled
     std::cerr << "Unknown argument '" << *i << "'" << std::endl;
     return -EINVAL;
   }
 
-  if (command == "tmap_upgrade") {
-    // Special case tmap_upgrade away from other modes, as this is a
-    // specialized command that will only exist in the Jewel series,
-    // and doesn't require the initialization of the `driver` member
-    // that is done below.
-    r = rados.connect();
-    if (r < 0) {
-      std::cerr << "couldn't connect to cluster: " << cpp_strerror(r)
-                << std::endl;
-      return r;
-    }
-
-    // Initialize metadata_io from pool on command line
-    if (metadata_pool_name.empty()) {
-      std::cerr << "Metadata pool not specified" << std::endl;
-      usage();
-      return -EINVAL;
-    }
-
-    long metadata_pool_id = rados.pool_lookup(metadata_pool_name.c_str());
-    if (metadata_pool_id < 0) {
-      std::cerr << "Pool '" << metadata_pool_name << "' not found!" << std::endl;
-      return -ENOENT;
-    } else {
-      dout(4) << "pool '" << metadata_pool_name
-        << "' has ID " << metadata_pool_id << dendl;
-    }
-
-    r = rados.ioctx_create(metadata_pool_name.c_str(), metadata_io);
-    if (r != 0) {
-      return r;
-    }
-    std::cerr << "Created ioctx for " << metadata_pool_name << std::endl;
-
-    return tmap_upgrade();
-  }
-
   // If caller didn't specify a namespace, try to pick
   // one if only one exists
   if (fscid == FS_CLUSTER_ID_NONE) {
@@ -866,43 +821,6 @@ bool DataScan::valid_ino(inodeno_t ino) const
     || ino == MDS_INO_CEPH;
 }
 
-int DataScan::tmap_upgrade()
-{
-  librados::NObjectIterator i = metadata_io.nobjects_begin();
-  const librados::NObjectIterator i_end = metadata_io.nobjects_end();
-
-  int overall_r = 0;
-
-  for (; i != i_end; ++i) {
-    const std::string oid = i->get_oid();
-
-    uint64_t inode_no = 0;
-    uint64_t frag_id = 0;
-    int r = parse_oid(oid, &inode_no, &frag_id);
-    if (r == -EINVAL) {
-      dout(10) << "Not a dirfrag: '" << oid << "'" << dendl;
-      continue;
-    } else {
-      // parse_oid can only do 0 or -EINVAL
-      assert(r == 0);
-    }
-
-    if (!valid_ino(inode_no)) {
-      dout(10) << "Not a difrag (invalid ino): '" << oid << "'" << dendl;
-      continue;
-    }
-
-    r = metadata_io.tmap_to_omap(oid, true);
-    dout(20) << "tmap2omap(" << oid << "): " << r << dendl;
-    if (r < 0) {
-      derr << "Error converting '" << oid << "': " << cpp_strerror(r) << dendl;
-      overall_r = r;
-    }
-  }
-
-  return overall_r;
-}
-
 int DataScan::scan_frags()
 {
   bool roots_present;
index 3a6b25ccd9821a5806f17b2c695731126a95f198..4d1c169c0c18998c3ed91cf43931a49494674369 100644 (file)
@@ -264,11 +264,6 @@ class DataScan : public MDSUtility, public MetadataTool
      */
     bool valid_ino(inodeno_t ino) const;
 
-    /**
-     * Invoke tmap_to_omap on all metadata pool objects
-     */
-    int tmap_upgrade();
-
     // Accept pools which are not in the FSMap
     bool force_pool;
     // Respond to decode errors by overwriting