From: Kefu Chai Date: Sun, 15 Apr 2018 15:02:35 +0000 (+0800) Subject: Merge pull request #20398 from wjwithagen/wip-posix_fallocate X-Git-Tag: v13.1.0~250 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ccb44e667e019e72d5f4c4b7d3bec40eece154f5;p=ceph.git Merge pull request #20398 from wjwithagen/wip-posix_fallocate common: posix_fallocate on ZFS returns EINVAL Reviewed-by: Kefu Chai --- ccb44e667e019e72d5f4c4b7d3bec40eece154f5 diff --cc src/os/bluestore/BlueStore.cc index cdeac45764c0,130287ef2845..ffc3ee0c2737 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@@ -5318,25 -5317,9 +5317,9 @@@ int BlueStore::_setup_block_symlink_or_ VOID_TEMP_FAILURE_RETRY(::close(fd)); return -r; } - #else - char data[1024*128]; - for (uint64_t off = 0; off < size; off += sizeof(data)) { - if (off + sizeof(data) > size) - r = ::write(fd, data, size - off); - else - r = ::write(fd, data, sizeof(data)); - if (r < 0) { - r = -errno; - derr << __func__ << " failed to prefallocate w/ write " << name << " file to " - << size << ": " << cpp_strerror(r) << dendl; - VOID_TEMP_FAILURE_RETRY(::close(fd)); - return r; - } - } - #endif } dout(1) << __func__ << " resized " << name << " file to " - << pretty_si_t(size) << "B" << dendl; + << byte_u_t(size) << dendl; } VOID_TEMP_FAILURE_RETRY(::close(fd)); } else {