]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: use IOC_CLONERANGE intead of IOC_CLONE ioctl
authorSage Weil <sage@newdream.net>
Thu, 23 Feb 2012 17:51:31 +0000 (09:51 -0800)
committerSage Weil <sage@newdream.net>
Thu, 23 Feb 2012 17:51:31 +0000 (09:51 -0800)
This is functionally equivalent, except that valgrind doesn't complain
about a bad pointer passed to an ioctl.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
src/os/FileStore.cc

index 8ab125986c17d349d03f5ed4488dcad69ecf5a22..8bf6d408ea0c14b32e4cb81065e4c851848f4a20 100644 (file)
@@ -2731,14 +2731,10 @@ int FileStore::_clone(coll_t cid, const hobject_t& oldoid, const hobject_t& newo
     r = n;
     goto out;
   }
-  if (btrfs)
-    r = ::ioctl(n, BTRFS_IOC_CLONE, o);
-  else {
-    struct stat st;
-    ::fstat(o, &st);
-    dout(10) << "clone " << cid << "/" << oldoid << " -> " << cid << "/" << newoid << " READ+WRITE" << dendl;
-    r = _do_clone_range(o, n, 0, st.st_size, 0);
-  }
+
+  struct stat st;
+  ::fstat(o, &st);
+  r = _do_clone_range(o, n, 0, st.st_size, 0);
   if (r < 0)
     r = -errno;