From: Sage Weil Date: Thu, 23 Feb 2012 17:51:31 +0000 (-0800) Subject: filestore: use IOC_CLONERANGE intead of IOC_CLONE ioctl X-Git-Tag: v0.43~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=86a54a6e442c8226c53d8dff0b00a3ddb5655d61;p=ceph.git filestore: use IOC_CLONERANGE intead of IOC_CLONE ioctl This is functionally equivalent, except that valgrind doesn't complain about a bad pointer passed to an ioctl. Signed-off-by: Sage Weil Reviewed-by: Samuel Just --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 8ab125986c17..8bf6d408ea0c 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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;