Displaying 7 results from an estimated 7 matches for "l1_dir".
Did you mean:
is_dir
2020 Apr 19
0
[PATCH nbdkit 2/2] Add insert function and use the new vector library in several places.
...rse.c
@@ -45,6 +45,7 @@
#include "iszero.h"
#include "sparse.h"
+#include "vector.h"
/* Two level directory for the sparse array.
*
@@ -100,9 +101,10 @@ struct l1_entry {
void **l2_dir; /* Pointer to L2 directory. */
};
+DEFINE_VECTOR_TYPE(l1_dir, struct l1_entry);
+
struct sparse_array {
- struct l1_entry *l1_dir; /* L1 directory. */
- size_t l1_size; /* Number of entries in L1 directory. */
+ l1_dir l1_dir; /* L1 directory. */
bool debug;
};
@@ -123,9 +125,9 @@ free_sparse_array (struct sparse_a...
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 Jan 01
3
[PATCH nbdkit] include: Annotate function parameters with attribute((nonnull)).
Should we use attribute((nonnull)) at all? There's a very interesting
history of this in libvirt -- try looking at commit eefb881 plus the
commits referencing eefb881 -- but it does seem to work for me using
recent GCC and Clang.
I only did a few functions because annotating them gets old quickly...
Rich.
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...iff --git a/common/sparse/sparse.c b/common/sparse/sparse.c
index be4eb2c..a5ace48 100644
--- a/common/sparse/sparse.c
+++ b/common/sparse/sparse.c
@@ -123,10 +123,12 @@ free_sparse_array (struct sparse_array *sa)
{
size_t i;
- for (i = 0; i < sa->l1_size; ++i)
- free_l2_dir (sa->l1_dir[i].l2_dir);
- free (sa->l1_dir);
- free (sa);
+ if (sa) {
+ for (i = 0; i < sa->l1_size; ++i)
+ free_l2_dir (sa->l1_dir[i].l2_dir);
+ free (sa->l1_dir);
+ free (sa);
+ }
}
struct sparse_array *
--
2.19.2
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html
In v2 I have provided two patches:
The first patch extends attribute((nonnull)) to most internal
functions, but not to the external API.
The second patch uses a macro so that attribute((format)) is only used
in the public API on GCC or Clang. At least in theory these headers
could be used by a C compiler which
2020 Feb 10
2
[nbdkit PATCH 04/10] plugins: Wire up in-memory plugin support for NBD_INFO_INIT_STATE
...rack how much of the image is allocated.
+ *
* To achieve this we use a B-Tree-like structure. The L1 directory
* contains an ordered, non-overlapping, non-contiguous list of
* (offset, pointer to L2 directory).
@@ -103,6 +106,8 @@ struct l1_entry {
struct sparse_array {
struct l1_entry *l1_dir; /* L1 directory. */
size_t l1_size; /* Number of entries in L1 directory. */
+ size_t used_pages; /* Number of non-NULL L2 entries. */
+ uint64_t max_pages; /* Maximum L2 pages if fully allocated. */
bool debug;
};
@@ -140,6 +145,8 @@ alloc_sparse_...
2020 Feb 10
17
Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
I will be following up to this email with four separate threads each
addressed to the appropriate single list, with proposed changes to:
- the NBD protocol
- qemu: both server and client
- libnbd: client
- nbdkit: server
The feature in question adds a new optional NBD_INFO_ packet to the
NBD_OPT_GO portion of handshake, adding up to 16 bits of information
that the server can advertise to the