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>
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;