Displaying 3 results from an estimated 3 matches for "find_extent".
2019 Mar 19
0
[PATCH nbdkit 1/9] server: Implement extents/can_extents calls for plugins and filters.
...t;nbdkit_extents_new: malloc: %m");
+ return NULL;
+ }
+ r->extents = NULL;
+ r->nr_extents = r->allocated = 0;
+ return r;
+}
+
+void
+nbdkit_extents_free (struct nbdkit_extents_map *map)
+{
+ if (map) {
+ free (map->extents);
+ free (map);
+ }
+}
+
+static ssize_t
+find_extent_recursive (const struct nbdkit_extents_map *map,
+ uint64_t offset, size_t first, size_t last)
+{
+ size_t i, h;
+
+ assert (first <= last);
+ assert (offset >= map->extents[first].offset);
+
+ if (last - first <= 8) {
+ /* Do a linear search for the last bi...
2019 Mar 20
2
Re: [PATCH nbdkit 1/9] server: Implement extents/can_extents calls for plugins and filters.
...("nbdkit_extent_add: "
> + "extent cannot exceed signed 64 bit limit: "
> + "offset=%" PRIu64 " length=%" PRIu64,
> + offset, length);
> + return -1;
> + }
> +
> + again:
> + lo = find_extent (map, offset);
> + hi = find_extent (map, offset + length - 1);
> +
> + /* "lo" and "hi" are -1 or they point to the extent
> + * overlapping-or-below the corresponding endpoints of the new
> + * extent.
> + *
> + * The algorithm here has two parts...
2019 Mar 19
15
[PATCH nbdkit 0/9] [mainly for discussion and early review] Implement extents.
I want to post this but mainly for discussion and early review. It's
not safe for these patches to all go upstream yet (because not all
filters have been checked/adjusted), but if any patches were to go
upstream then probably 1 & 2 only are safe.
File, VDDK, memory and data plugins all work, although I have only
done minimal testing on them.
The current tests, such as they are, all