Displaying 16 results from an estimated 16 matches for "new_extent".
Did you mean:
new_extents
2020 Apr 15
0
[PATCH nbdkit 3/9] server: Use new vector library when building the list of extents.
...>extents.size);
+ return exts->extents.ptr[i];
}
/* Insert *e in the list at the end. */
static int
append_extent (struct nbdkit_extents *exts, const struct nbdkit_extent *e)
{
- if (exts->nr_extents >= exts->allocated) {
- size_t new_allocated;
- struct nbdkit_extent *new_extents;
-
- new_allocated = exts->allocated;
- if (new_allocated == 0)
- new_allocated = 1;
- new_allocated *= 2;
- new_extents =
- realloc (exts->extents, new_allocated * sizeof (struct nbdkit_extent));
- if (new_extents == NULL) {
- nbdkit_error ("nbdkit_add_ext...
2019 Mar 19
0
[PATCH nbdkit 1/9] server: Implement extents/can_extents calls for plugins and filters.
...p *map,
+ size_t i, size_t count)
+{
+ assert (i+count <= map->nr_extents);
+
+ memmove (&map->extents[i],
+ &map->extents[i+count],
+ (map->nr_extents - (i+count)) * sizeof (struct extent));
+ map->nr_extents -= count;
+}
+
+/* Insert new_extent in the map at index i. Existing extents at index
+ * [i...] are moved up by one.
+ */
+static int
+insert_extent (struct nbdkit_extents_map *map,
+ struct extent new_extent, size_t i)
+{
+ assert (i <= map->nr_extents);
+
+ if (map->nr_extents >= map->allocated) {
+...
2011 Mar 23
0
[PATCH] Btrfs: cleanup some BUG_ON()
...alloc_path();
- BUG_ON(!path);
+ if (!path) {
+ if (exts != *extents)
+ kfree(exts);
+ return -ENOMEM;
+ }
cur_pos = extent_key->objectid - offset;
last_byte = extent_key->objectid + extent_key->offset;
@@ -7423,7 +7432,8 @@ static noinline int replace_extents_in_l
int ret;
new_extent = kmalloc(sizeof(*new_extent), GFP_NOFS);
- BUG_ON(!new_extent);
+ if (!new_extent)
+ return -ENOMEM;
ref = btrfs_lookup_leaf_ref(root, leaf->start);
BUG_ON(!ref);
@@ -7627,7 +7637,8 @@ static noinline int init_reloc_tree(stru
return 0;
root_item = kmalloc(sizeof(*root_item), GFP_N...
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
2019 Mar 20
2
Re: [PATCH nbdkit 1/9] server: Implement extents/can_extents calls for plugins and filters.
...xtent (rather than the
gap) to make the coalescing nicer.
> +int
> +nbdkit_extent_add (struct nbdkit_extents_map *map,
> + uint64_t offset, uint64_t length, uint32_t type)
> +{
> + ssize_t lo, hi;
> + bool coalesce_below, coalesce_above;
> + struct extent new_extent;
> +
> + /* This might be considered an error, but be flexible for badly
> + * written plugins.
> + */
> + if (length == 0)
> + return 0;
> +
> + /* Don't allow extents to exceeed the _signed_ 64 bit limit that is
exceed
> + * used in the rest of nbdkit....
2019 Mar 26
0
[PATCH nbdkit v4 01/15] server: Implement extents/can_extents calls for plugins and filters.
...exts->nr_extents);
+ return exts->extents[i];
+}
+
+/* Insert *e in the list at the end. */
+static int
+append_extent (struct nbdkit_extents *exts, const struct nbdkit_extent *e)
+{
+ if (exts->nr_extents >= exts->allocated) {
+ size_t new_allocated;
+ struct nbdkit_extent *new_extents;
+
+ new_allocated = exts->allocated;
+ if (new_allocated == 0)
+ new_allocated = 1;
+ new_allocated *= 2;
+ new_extents =
+ realloc (exts->extents, new_allocated * sizeof (struct nbdkit_extent));
+ if (new_extents == NULL) {
+ nbdkit_error ("nbdkit_add_ext...
2019 Mar 20
0
[PATCH nbdkit 1/8] server: Implement extents/can_extents calls for plugins and filters.
...exts->nr_extents);
+ return exts->extents[i];
+}
+
+/* Insert *e in the list at the end. */
+static int
+append_extent (struct nbdkit_extents *exts, const struct nbdkit_extent *e)
+{
+ if (exts->nr_extents >= exts->allocated) {
+ size_t new_allocated;
+ struct nbdkit_extent *new_extents;
+
+ new_allocated = exts->allocated;
+ if (new_allocated == 0)
+ new_allocated = 1;
+ new_allocated *= 2;
+ new_extents =
+ realloc (exts->extents, new_allocated * sizeof (struct nbdkit_extent));
+ if (new_extents == NULL) {
+ nbdkit_error ("nbdkit_add_ext...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 01/19] server: Implement extents/can_extents calls for plugins and filters.
...exts->nr_extents);
+ return exts->extents[i];
+}
+
+/* Insert *e in the list at the end. */
+static int
+append_extent (struct nbdkit_extents *exts, const struct nbdkit_extent *e)
+{
+ if (exts->nr_extents >= exts->allocated) {
+ size_t new_allocated;
+ struct nbdkit_extent *new_extents;
+
+ new_allocated = exts->allocated;
+ if (new_allocated == 0)
+ new_allocated = 1;
+ new_allocated *= 2;
+ new_extents =
+ realloc (exts->extents, new_allocated * sizeof (struct nbdkit_extent));
+ if (new_extents == NULL) {
+ nbdkit_error ("nbdkit_add_ext...
2020 Apr 19
0
[PATCH nbdkit 2/2] Add insert function and use the new vector library in several places.
...EXTENT_ZERO)
@@ -56,31 +57,13 @@ struct extent {
uint64_t offset, length;
uint32_t type;
};
-static struct extent *extents;
-static size_t nr_extents, allocated;
-
-/* Insert an extent before i. If i = nr_extents, inserts at the end. */
-static void
-insert_extent (size_t i, struct extent new_extent)
-{
- if (nr_extents >= allocated) {
- allocated = allocated == 0 ? 1 : allocated * 2;
- extents = realloc (extents, (sizeof (struct extent) * allocated));
- if (extents == NULL) {
- nbdkit_error ("realloc: %m");
- exit (EXIT_FAILURE);
- }
- }
- memmove (&e...
2020 Apr 19
2
[PATCH nbdkit 1/2] vddk: Use new vector library to allocate the argv list.
---
plugins/vddk/vddk.c | 41 +++++++++++++++++++++++++----------------
TODO | 1 -
2 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
index 87c0d146..d1a3015f 100644
--- a/plugins/vddk/vddk.c
+++ b/plugins/vddk/vddk.c
@@ -51,6 +51,7 @@
#include "isaligned.h"
#include "minmax.h"
#include
2019 Sep 15
2
[PATCH nbdkit v2] common/bitmap: Don't fail on realloc (ptr, 0)
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00100.html
In v2 I've changed the patch so it avoids calling realloc at all in
this case.
The patch is a bit longer this way. But I don't see any other
alternative if we are to avoid having a "realloc wrapper" of some kind
that we use everywhere, which I guess we should avoid because it makes
plugins
2020 Apr 15
18
[PATCH nbdkit 0/9] Generic vector, and pass $nbdkit_stdio_safe to shell scripts.
This was a rather longer trip around the houses than I anticipated!
The basic purpose of the patch series is to set $nbdkit_stdio_safe to
"0" or "1" in sh and eval plugin scripts.
To do that, I ended up adding a nicer way to manipulate environ lists,
and to do that, I ended up adding a whole generic vector
implementation which is applicable in a lot of different places.
2019 Mar 20
15
[PATCH nbdkit 0/8] Implement extents using a simpler array.
Not sure what version we're up to, but this reimplements extents using
the new simpler structure described in this thread:
https://www.redhat.com/archives/libguestfs/2019-March/msg00077.html
I also fixed most of the things that Eric pointed out in the previous
review, although I need to go back over his replies and check I've got
everything.
This needs a bit more testing. However the
2019 Mar 26
21
[PATCH nbdkit v4 00/15] Implement Block Status.
I'm not sure exactly which version we're up to, but let's say it's
version 4.
I'm a lot happier with this version:
- all filters have been reviewed and changed where I think that's necessary
- can_extents is properly defined and implemented now
- NBD protocol is followed
- I believe it addresses all previous review points where possible
The "only" thing
2019 Mar 28
32
[PATCH nbdkit v5 FINAL 00/19] Implement extents.
This has already been pushed upstream. I am simply posting these here
so we have a reference in the mailing list in case we find bugs later
(as I'm sure we will - it's a complex patch series).
Great thanks to Eric Blake for tireless review on this one. It also
seems to have identified a few minor bugs in qemu along the way.
Rich.
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...y.offset += num_bytes;
@@ -6825,7 +6825,7 @@ next:
ret = btrfs_drop_extents(trans, root, inode, key.offset,
key.offset + num_bytes,
key.offset, &alloc_hint);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
for (i = 0; i < nr_extents; i++) {
if (ext_offset >= new_extents[i].num_bytes) {
@@ -6838,7 +6838,7 @@ next:
ret = btrfs_insert_empty_item(trans, root,
path, &key,
sizeof(*fi));
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
leaf = path->nodes[0];
fi = btrfs_item_ptr(leaf, path->slots[0],
@@ -6877,7 +687...