]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
enforce rados put aligment 1984/head
authorLluis Pamies-Juarez <lluis@pamies.cat>
Wed, 18 Jun 2014 17:00:09 +0000 (10:00 -0700)
committerLluis Pamies-Juarez <lluis@pamies.cat>
Wed, 18 Jun 2014 17:00:09 +0000 (10:00 -0700)
Signed-off-by: Lluis Pamies-Juarez <lluis.pamies-juarez@hgst.com>
src/tools/rados/rados.cc

index a043b77c355a41390f39ef981356d673a408b905..85c7340a0ff5625c4d8876868c92a2c26f3c96f5 100644 (file)
@@ -1361,6 +1361,15 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     }
   }
 
+  // align op_size
+  if (io_ctx.pool_requires_alignment()) {
+    const uint64_t align = io_ctx.pool_required_alignment();
+    const bool wrn = (op_size != (1<<22));
+    op_size = uint64_t((op_size + align - 1) / align) * align;
+    if (wrn)
+      cerr << "WARNING: op_size has been rounded to " << op_size << std::endl;
+  }
+
   // snapname?
   if (snapname) {
     ret = io_ctx.snap_lookup(snapname, &snapid);