search for: zero_rang

Displaying 20 results from an estimated 24 matches for "zero_rang".

Did you mean: zero_range
2018 Aug 13
1
Re: [PATCH v2 2/4] file: Support zero without ZERO_RANGE
On 08/03/2018 02:28 PM, Nir Soffer wrote: > File systems not supporting FALLOC_FL_ZERO_RANGE yet fall back to manual > zeroing. > > We can avoid this by combining two fallocate calls: > > fallocate(FALLOC_FL_PUNCH_HOLE) > fallocate(0) > > Based on my tests this is much more efficient compared to manual > zeroing. The idea came from this qemu patch:...
2018 Jul 29
3
[PATCH] file: Zero support for block devices and NFS 4.2
If we may not trim, we tried ZERO_RANGE, but this is not well supported yet, for example it is not available on NFS 4.2. ZERO_RANGE and PUNCH_HOLE are supported now on block devices, but not on RHRL 7, so we fallback to slow manual zeroing there. Change the logic to support block devices on RHEL 7, and file systems that do not support...
2018 Aug 02
1
Re: [PATCH 2/3] file: Support zero without ZERO_RANGE
On Thu, Aug 02, 2018 at 10:05:28PM +0300, Nir Soffer wrote: > File systems not supporting FALLOC_FL_ZERO_RANGE yet fall back to manual > zeroing. > > We can avoid this by combining two fallocate calls: > > fallocate(FALLOC_FL_PUNHCH_HOLE) "PUNCH" > fallocate(0) > +#ifdef FALLOC_FL_PUNCH_HOLE > + /* If we can punch hole but may not trim, we can combine punchin...
2018 Aug 02
0
[PATCH 2/3] file: Support zero without ZERO_RANGE
File systems not supporting FALLOC_FL_ZERO_RANGE yet fall back to manual zeroing. We can avoid this by combining two fallocate calls: fallocate(FALLOC_FL_PUNHCH_HOLE) fallocate(0) Based on my tests this is much more efficient compared to manual zeroing. The idea came from this qemu patch: https://github.com/qemu/qemu/commit/1cdc3239f1...
2018 Aug 03
0
[PATCH v2 2/4] file: Support zero without ZERO_RANGE
File systems not supporting FALLOC_FL_ZERO_RANGE yet fall back to manual zeroing. We can avoid this by combining two fallocate calls: fallocate(FALLOC_FL_PUNCH_HOLE) fallocate(0) Based on my tests this is much more efficient compared to manual zeroing. The idea came from this qemu patch: https://github.com/qemu/qemu/commit/1cdc3239f1b...
2018 Aug 02
0
[PATCH] file: Zero support for block devices and NFS 4.2
If we may not trim, we tried ZERO_RANGE, but this is not well supported yet, for example it is not available on NFS 4.2. ZERO_RANGE and PUNCH_HOLE are supported now on block devices, but not on RHRL 7, so we fallback to slow manual zeroing there. Change the logic to support block devices on RHEL 7, and file systems that do not support...
2018 Aug 02
10
[PATCH 0/3] file: Zero for block devices and older file systems
This is the second version to support efficient zero for block devices on older kernels (e.g. RHEL 7.5), and file systems that do not support yet FALLOC_FS_ZERO_RANGE (e.g. NFS 4.2). Changes since v1: - Split to smaller patches - Skip linux only includes on other systems - Skip code using BLKZEROOUT if the macro is not defined - Try BLKZEROOUT only if the offset and count are aligned to device sector size. v1 was here: https://www.redhat.com/archives/libgue...
2018 Aug 19
1
Re: [PATCH v3 1/4] file: Avoid unsupported fallocate() calls
On Sun, Aug 19, 2018 at 01:13:05AM +0300, Nir Soffer wrote: > When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or > block device on kernel < 4.9, we used to call fallocate() for every > zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When > trimming, we used to try unsupported fallocate() on every call. > > Change file handle to remember if punching holes or z...
2018 Jul 30
0
Re: [PATCH] file: Zero support for block devices and NFS 4.2
On 07/29/2018 07:04 AM, Nir Soffer wrote: > If we may not trim, we tried ZERO_RANGE, but this is not well supported > yet, for example it is not available on NFS 4.2. ZERO_RANGE and > PUNCH_HOLE are supported now on block devices, but not on RHRL 7, so we > fallback to slow manual zeroing there. > > Change the logic to support block devices on RHEL 7, and file sys...
2018 Aug 03
0
[PATCH v2 1/4] file: Avoid unsupported fallocate() calls
When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or block device on kernel < 4.9, we used to call fallocate() for every zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When trimming, we used to try unsupported fallocate() on every call. Change file handle to remember if punching holes or zeroing range are supporte...
2018 Aug 18
0
[PATCH v3 1/4] file: Avoid unsupported fallocate() calls
When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or block device on kernel < 4.9, we used to call fallocate() for every zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When trimming, we used to try unsupported fallocate() on every call. Change file handle to remember if punching holes or zeroing range are supporte...
2018 Aug 19
0
[PATCH v4 1/4] file: Avoid unsupported fallocate() calls
When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or block device on kernel < 4.9, we used to call fallocate() for every zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When trimming, we used to try unsupported fallocate() on every call. Change file handle to remember if punching holes or zeroing range are supporte...
2018 Aug 19
9
[PATCH v3 0/4] file: Zero for block devices and older file systems
...- Reorder includes (Richard) - Return 0 or -1 instead of r (Richard) - Add common/include/isaligned.h to Makefile.am (Richard) v3 was here: https://www.redhat.com/archives/libguestfs/2018-August/msg00177.html Nir Soffer (4): file: Avoid unsupported fallocate() calls file: Support zero without ZERO_RANGE common: Add isaligned helper module file: Zero for block devices on old kernels common/include/Makefile.am | 1 + common/include/isaligned.h | 51 ++++++++++ plugins/file/Makefile.am | 3 +- plugins/file/file.c | 186 +++++++++++++++++++++++++++++-------- 4 files changed, 200 i...
2018 Aug 02
0
[PATCH 1/3] file: Avoid unsupported fallocate() calls
When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or block device on kernel < 4.9, we used to call fallocate() for every zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When trimming, we used to try unsupported fallocate() on every call. Change file handle to remember if punching holes or zeroing range are supporte...
2018 Aug 18
7
[PATCH v3 0/4] file: Zero for block devices and older file systems
...11.0 and 10.3 and there is no issue. I also look at NetBSD and OpenBSD source, and in alll ioctl() is defined in ioctl.h. v2 was here: https://www.redhat.com/archives/libguestfs/2018-August/msg00041.html Nir Soffer (4): file: Avoid unsupported fallocate() calls file: Support zero without ZERO_RANGE common: Add isaligned helper module file: Zero for block devices on old kernels common/include/isaligned.h | 51 +++++++++++ plugins/file/Makefile.am | 3 +- plugins/file/file.c | 182 +++++++++++++++++++++++++++++-------- 3 files changed, 197 insertions(+), 39 deletions(-) crea...
2018 Aug 13
2
Re: [PATCH v2 1/4] file: Avoid unsupported fallocate() calls
On 08/03/2018 02:28 PM, Nir Soffer wrote: > When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or > block device on kernel < 4.9, we used to call fallocate() for every > zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When > trimming, we used to try unsupported fallocate() on every call. > > Change file handle to remember if punching holes or z...
2018 Aug 03
10
[PATCH v2 0/4] file: Zero for block devices and older file systems
This is the third version to support efficient zero for block devices on older kernels (e.g. RHEL 7.5), and file systems that do not support yet FALLOC_FS_ZERO_RANGE (e.g. NFS 4.2). Changes since v2: - Revert file_can_trim change, since it is too late to change the value after negotiation. Changing the capability dinamically may be useful internally, but it should be done via other means. - Do not depend on FALLOC_FL_* when including <linux/fs.h>. -...
2018 Aug 02
2
Re: [PATCH 1/3] file: Avoid unsupported fallocate() calls
On 08/02/2018 02:05 PM, Nir Soffer wrote: > When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or > block device on kernel < 4.9, we used to call fallocate() for every > zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When > trimming, we used to try unsupported fallocate() on every call. > > Change file handle to remember if punching holes or z...
2018 Aug 02
0
Re: [PATCH 1/3] file: Avoid unsupported fallocate() calls
On Thu, Aug 2, 2018 at 10:30 PM Eric Blake <eblake@redhat.com> wrote: > On 08/02/2018 02:05 PM, Nir Soffer wrote: > > When using file systems not supporting ZERO_RANGE (e.g. NFS 4.2) or > > block device on kernel < 4.9, we used to call fallocate() for every > > zero, fail with EOPNOTSUPP, and fallback to manual zeroing. When > > trimming, we used to try unsupported fallocate() on every call. > > > > Change file handle to remembe...
2018 Jul 28
3
[PATCH] file: Normalize errno value for ENODEV
...- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/plugins/file/file.c b/plugins/file/file.c index a7c07fb..4210adb 100644 --- a/plugins/file/file.c +++ b/plugins/file/file.c @@ -50,6 +50,21 @@ static char *filename = NULL; +#if defined(FALLOC_FL_PUNCH_HOLE) || defined(FALLOC_FL_ZERO_RANGE) +static int +do_fallocate(int fd, int mode, off_t offset, off_t len) +{ + int r = -1; + r = fallocate (fd, mode, offset, len); + /* kernel 3.10 fails with ENODEV for block device. Kernel >= 4.9 fails + with EOPNOTSUPP in this case. Normlize errno to simplify callers. */ + if (r == -1 &...