Displaying 7 results from an estimated 7 matches for "nbdkit_extent_type_hole".
2019 Mar 12
1
Re: [PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...s (without error checking):
/* plugin method */
int extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags,
void *extents_h)
{
nbdkit_extent_add (extents_h, offset, count, NBDKIT_EXTENT_TYPE_DATA);
nbdkit_extent_add (extents_h, offset+count, 1024, NBDKIT_EXTENT_TYPE_HOLE);
return 0;
}
/* filter method */
int extents (struct nbdkit_next_ops *next_ops, void *nxdata,
void *handle, uint32_t count, uint64_t offset, uint32_t flags,
void *extents_h, int *err)
{
if (next_ops->extents (...) == -1) return -1;
/...
2019 Mar 12
2
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
Second version based on nbdkit_extent* calls, as discussed here:
https://www.redhat.com/archives/libguestfs/2019-March/msg00033.html
Note in particular there is some subtlety about how filters would work
in this implementation. See docs/nbdkit-filter.pod for the details.
Rich.
2019 Mar 12
2
Re: [PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...> + int nbdkit_extent_add (struct nbdkit_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 types:
> +
> +=over 4
> +
> +=item NBDKIT_EXTENT_TYPE_HOLE
> +
> +An unallocated extent, a.k.a. a “hole”.
> +
> +=item NBDKIT_EXTENT_TYPE_DATA
> +
> +A normal extent containing data.
> +
> +=item NBDKIT_EXTENT_TYPE_ZERO
> +
> +An extent which is allocated and contains all zero bytes.
The protocol allows all four combinations...
2019 Mar 12
4
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
This tentative commit implements extents/can_extents, roughly as
discussed in the previous thread here:
https://www.redhat.com/archives/libguestfs/2019-March/msg00017.html
I can't say that I'm a big fan of having the plugin allocate an
extents array. There are no other plugin callbacks currently where we
require the plugin to allocate complex data structures (or indeed do
any allocation
2019 Mar 12
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...not be statically allocated).
+
+ struct nbdkit_extent {
+ uint64_t offset;
+ uint64_t length;
+ uint32_t type; /* NBDKIT_EXTENT_TYPE_* */
+ };
+
+The C<offset> and C<length> describe the extent, and the C<type>
+should be one of the extent types:
+
+=over 4
+
+=item C<NBDKIT_EXTENT_TYPE_HOLE>
+
+This extent represents an unallocated hole in the disk.
+
+=item C<NBDKIT_EXTENT_TYPE_DATA>
+
+This extent represents normal allocated data.
+
+=item C<NBDKIT_EXTENT_TYPE_ZERO>
+
+This extent represents zeroes.
+
+=item C<NBDKIT_EXTENT_TYPE_NONE>
+
+This is a special type w...
2019 Mar 12
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...e available for plugins or filters to call:
+
+ int nbdkit_extent_add (struct nbdkit_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 types:
+
+=over 4
+
+=item NBDKIT_EXTENT_TYPE_HOLE
+
+An unallocated extent, a.k.a. a “hole”.
+
+=item NBDKIT_EXTENT_TYPE_DATA
+
+A normal extent containing data.
+
+=item NBDKIT_EXTENT_TYPE_ZERO
+
+An extent which is allocated and contains all zero bytes.
+
+=back
+
+If the new extent overlaps some previous extent in the map then the
+overlapping...
2019 Mar 12
0
Re: [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 types:
> > +
> > +=over 4
> > +
> > +=item NBDKIT_EXTENT_TYPE_HOLE
> > +
> > +An unallocated extent, a.k.a. a “hole”.
> > +
> > +=item NBDKIT_EXTENT_TYPE_DATA
> > +
> > +A normal extent containing data.
> > +
> > +=item NBDKIT_EXTENT_TYPE_ZERO
> > +
> > +An extent which is allocated and contains all zero...