search for: nbdkit_extent_hol

Displaying 20 results from an estimated 53 matches for "nbdkit_extent_hol".

Did you mean: nbdkit_extent_hole
2019 Mar 23
2
Re: [PATCH nbdkit 7/8] vddk: Implement extents.
...; + /* The query returns blocks. We must insert holes between the > + * blocks as necessary. > + */ > + if (position < offset) { > + if (nbdkit_add_extent (extents, > + offset, length, > + NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO) == -1) > + goto error_in_add; > + } > + > + if (nbdkit_add_extent (extents, > + offset, length, 0 /* allocated data */) == -1) { > + error_in_add: > + DEBUG_CALL ("VixDiskLib_FreeBlockList&qu...
2019 Apr 29
0
[nbdkit PATCH 2/3] vddk: Do not report hole extents to be zero with single-link=true
...b/plugins/vddk/vddk.c index 8cf54f6e2b96..cda670325b85 100644 --- a/plugins/vddk/vddk.c +++ b/plugins/vddk/vddk.c @@ -773,9 +773,17 @@ static int add_extent (struct nbdkit_extents *extents, uint64_t *position, uint64_t next_position, bool is_hole) { - const uint32_t type = is_hole ? NBDKIT_EXTENT_HOLE|NBDKIT_EXTENT_ZERO : 0; + uint32_t type = 0; const uint64_t length = next_position - *position; + if (is_hole) { + type = NBDKIT_EXTENT_HOLE; + /* Images opened as single link might be backed by another file in the + chain, so the holes are not guaranteed to be zeros. */ + if...
2019 Nov 22
2
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...ant (m, "CACHE_NONE", NBDKIT_CACHE_NONE); > + PyModule_AddIntConstant (m, "CACHE_EMULATE", NBDKIT_CACHE_EMULATE); > + PyModule_AddIntConstant (m, "CACHE_NATIVE", NBDKIT_CACHE_NATIVE); > + > + PyModule_AddIntConstant (m, "EXTENT_HOLE", NBDKIT_EXTENT_HOLE); > + PyModule_AddIntConstant (m, "EXTENT_ZERO", NBDKIT_EXTENT_ZERO); > + > return m; > } > > -- > 2.23.0 >
2020 Jul 08
1
Re: [nbdkit PATCH 2/3] extents: Add nbdkit_extents_aligned()
...turn -1; > + e2 = extents2->extents.ptr[0]; > + assert (e2.offset == e.offset + e.length); > + e2.offset = e.offset; > + e2.length += e.length; > + e2.type &= e.type; So we're intersecting (&) the types defined as: #define NBDKIT_EXTENT_HOLE (1<<0) /* Same as NBD_STATE_HOLE */ #define NBDKIT_EXTENT_ZERO (1<<1) /* Same as NBD_STATE_ZERO */ If all extents are holes, then it's a hole. If all extents are zero, then it's a zero. Otherwise it's non-zero data. This seems correct. All looks good to me, so AC...
2019 Mar 29
2
Re: [PATCH nbdkit v5 FINAL 12/19] truncate: Implement extents for beyond end of truncated region.
...* If the entire request is beyond the end of the underlying plugin > + * then this is the easy case: return a hole. > + */ > + if (offset >= real_size_copy) > + return nbdkit_add_extent (extents, offset, (uint64_t) count, > + NBDKIT_EXTENT_ZERO|NBDKIT_EXTENT_HOLE); Why not return a hole up to the end of the file, rather than limiting things at the end of the client's request? > + > + /* We're asked first for extents information about the plugin, then > + * possibly (if truncating larger) for the hole after the plugin. > + * Since...
2019 Mar 23
2
Re: [PATCH nbdkit 6/8] data, memory: Implement extents.
...t n, type; > + void *p; > + > + while (count > 0) { > + p = lookup (sa, offset, false, &n, NULL); > + if (n > count) > + n = count; Why are we clamping the information we return? I'd move this clamp... > + > + if (p == NULL) > + type = NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO; > + else > + type = 0; /* allocated data */ > + if (nbdkit_add_extent (extents, offset, n, type) == -1) > + return -1; ...here, after we've recorded the maximum amount of information possible into the extents array. (We need the clamp to termi...
2019 Apr 23
2
Re: [PATCH nbdkit v5 FINAL 14/19] data, memory: Implement extents.
...false, &n, NULL); > + if (n > count) > + n = count; I know in earlier review I asked whether we can move the clamping... > + > + /* Work out the type of this extent. */ > + if (p == NULL) > + /* No backing page, so it's a hole. */ > + type = NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO; > + else { > + if (is_zero (p, n)) > + /* A backing page and it's all zero, it's a zero extent. */ > + type = NBDKIT_EXTENT_ZERO; > + else > + /* Normal allocated data. */ > + type = 0; > + } > +...
2019 Nov 22
1
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...IT_CACHE_NONE); > > > + PyModule_AddIntConstant (m, "CACHE_EMULATE", NBDKIT_CACHE_EMULATE); > > > + PyModule_AddIntConstant (m, "CACHE_NATIVE", NBDKIT_CACHE_NATIVE); > > > + > > > + PyModule_AddIntConstant (m, "EXTENT_HOLE", NBDKIT_EXTENT_HOLE); > > > + PyModule_AddIntConstant (m, "EXTENT_ZERO", NBDKIT_EXTENT_ZERO); > > > + > > > return m; > > > } > > > > > > -- > > > 2.23.0 > > > > > -- > Richard Jones, Virtualization Group, Red Hat http:...
2019 Apr 29
5
[nbdkit PATCH 0/3] Fix data integrity in vddk plugin
Couple of fixes to return correct data and one nice-to-have clean-up which is not needed. I just find it nicer to read. Martin Kletzander (3): vddk: Use a separate handle for single-link=true vddk: Do not report hole extents to be zero with single-link=true vddk: Eliminate one needless goto plugins/vddk/vddk.c | 48 +++++++++++++++++++++++++++++++++------------ 1 file changed, 36
2019 Mar 25
0
Re: [PATCH nbdkit 7/8] vddk: Implement extents.
...blocks. We must insert holes between the > > + * blocks as necessary. > > + */ > > + if (position < offset) { > > + if (nbdkit_add_extent (extents, > > + offset, length, > > + NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO) == -1) > > + goto error_in_add; > > + } > > + > > + if (nbdkit_add_extent (extents, > > + offset, length, 0 /* allocated data */) == -1) { > > + error_in_add: > > + DEBUG_CALL...
2019 Mar 25
0
Re: [PATCH nbdkit 6/8] data, memory: Implement extents.
...s clamp... It's a copy and paste from one of the previous sparse_array_* functions in the same file. I agree that we should return the most possible information and moving the clamp as you suggest is the way to do that. Rich. > > + > > + if (p == NULL) > > + type = NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO; > > + else > > + type = 0; /* allocated data */ > > + if (nbdkit_add_extent (extents, offset, n, type) == -1) > > + return -1; > > ...here, after we've recorded the maximum amount of information possible > into the extents...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 12/19] truncate: Implement extents for beyond end of truncated region.
...nlock (&lock); + + /* If the entire request is beyond the end of the underlying plugin + * then this is the easy case: return a hole. + */ + if (offset >= real_size_copy) + return nbdkit_add_extent (extents, offset, (uint64_t) count, + NBDKIT_EXTENT_ZERO|NBDKIT_EXTENT_HOLE); + + /* We're asked first for extents information about the plugin, then + * possibly (if truncating larger) for the hole after the plugin. + * Since we're not required to provide all of this information, the + * easiest thing is to only return data from the plugin. We will be +...
2019 Mar 29
0
Re: [PATCH nbdkit v5 FINAL 12/19] truncate: Implement extents for beyond end of truncated region.
...s beyond the end of the underlying plugin > > + * then this is the easy case: return a hole. > > + */ > > + if (offset >= real_size_copy) > > + return nbdkit_add_extent (extents, offset, (uint64_t) count, > > + NBDKIT_EXTENT_ZERO|NBDKIT_EXTENT_HOLE); > > Why not return a hole up to the end of the file, rather than limiting > things at the end of the client's request? Yes, very true - I'll add a small fix for this. > > + /* We're asked first for extents information about the plugin, then > > + * possibly...
2019 Apr 23
0
Re: [PATCH nbdkit v5 FINAL 14/19] data, memory: Implement extents.
...unt) > > + n = count; > > I know in earlier review I asked whether we can move the clamping... > > > + > > + /* Work out the type of this extent. */ > > + if (p == NULL) > > + /* No backing page, so it's a hole. */ > > + type = NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO; > > + else { > > + if (is_zero (p, n)) > > + /* A backing page and it's all zero, it's a zero extent. */ > > + type = NBDKIT_EXTENT_ZERO; > > + else > > + /* Normal allocated data. */ > > +...
2019 Nov 22
0
[PATCH nbdkit v2 02/10] python: Add various constants to the API.
...PyModule_AddIntConstant (m, "CACHE_NONE", NBDKIT_CACHE_NONE); + PyModule_AddIntConstant (m, "CACHE_EMULATE", NBDKIT_CACHE_EMULATE); + PyModule_AddIntConstant (m, "CACHE_NATIVE", NBDKIT_CACHE_NATIVE); + + PyModule_AddIntConstant (m, "EXTENT_HOLE", NBDKIT_EXTENT_HOLE); + PyModule_AddIntConstant (m, "EXTENT_ZERO", NBDKIT_EXTENT_ZERO); + return m; } -- 2.23.0
2019 Nov 22
0
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...NONE", NBDKIT_CACHE_NONE); > > + PyModule_AddIntConstant (m, "CACHE_EMULATE", NBDKIT_CACHE_EMULATE); > > + PyModule_AddIntConstant (m, "CACHE_NATIVE", NBDKIT_CACHE_NATIVE); > > + > > + PyModule_AddIntConstant (m, "EXTENT_HOLE", NBDKIT_EXTENT_HOLE); > > + PyModule_AddIntConstant (m, "EXTENT_ZERO", NBDKIT_EXTENT_ZERO); > > + > > return m; > > } > > > > -- > > 2.23.0 > > -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and v...
2019 Mar 13
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...dkit_extents_map *extents_map, + uint64_t offset, uint64_t length, uint32_t type); + +Add an extent covering C<[offset...offset+length-1]> of one of +the following four types: + +=over 4 + +=item C<type = 0> + +A normal, allocated data extent. + +=item C<type = NBDKIT_EXTENT_HOLE|NBDKIT_EXTENT_ZERO> + +An unallocated extent, a.k.a. a “hole”, which reads back as zeroes. +This is the normal type of hole applicable to most disks. + +=item C<type = NBDKIT_EXTENT_ZERO> + +An allocated extent which is known to contain only zeroes. + +=item C<type = NBDKIT_EXTENT_HOLE...
2019 Mar 20
0
[PATCH nbdkit 6/8] data, memory: Implement extents.
...uint32_t count, uint64_t offset, + struct nbdkit_extents *extents) +{ + uint32_t n, type; + void *p; + + while (count > 0) { + p = lookup (sa, offset, false, &n, NULL); + if (n > count) + n = count; + + if (p == NULL) + type = NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO; + else + type = 0; /* allocated data */ + if (nbdkit_add_extent (extents, offset, n, type) == -1) + return -1; + + count -= n; + offset += n; + } + + return 0; +} diff --git a/plugins/data/data.c b/plugins/data/data.c index f9d3881..c5540f6 100644 ---...
2019 Mar 26
0
[PATCH nbdkit v4 01/15] server: Implement extents/can_extents calls for plugins and filters.
...truct nbdkit_extents *extents, + uint64_t offset, uint64_t length, uint32_t type); + +Add an extent covering C<[offset...offset+length-1]> of one of +the following four types: + +=over 4 + +=item C<type = 0> + +A normal, allocated data extent. + +=item C<type = NBDKIT_EXTENT_HOLE|NBDKIT_EXTENT_ZERO> + +An unallocated extent, a.k.a. a “hole”, which reads back as zeroes. +This is the normal type of hole applicable to most disks. + +=item C<type = NBDKIT_EXTENT_ZERO> + +An allocated extent which is known to contain only zeroes. + +=item C<type = NBDKIT_EXTENT_HOLE...
2019 Mar 20
0
[PATCH nbdkit 1/8] server: Implement extents/can_extents calls for plugins and filters.
...truct nbdkit_extents *extents, + uint64_t offset, uint64_t length, uint32_t type); + +Add an extent covering C<[offset...offset+length-1]> of one of +the following four types: + +=over 4 + +=item C<type = 0> + +A normal, allocated data extent. + +=item C<type = NBDKIT_EXTENT_HOLE|NBDKIT_EXTENT_ZERO> + +An unallocated extent, a.k.a. a “hole”, which reads back as zeroes. +This is the normal type of hole applicable to most disks. + +=item C<type = NBDKIT_EXTENT_ZERO> + +An allocated extent which is known to contain only zeroes. + +=item C<type = NBDKIT_EXTENT_HOLE...