From 86a54a6e442c8226c53d8dff0b00a3ddb5655d61 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 23 Feb 2012 09:51:31 -0800 Subject: [PATCH] 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 --- src/os/FileStore.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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; -- 2.47.3