Displaying 6 results from an estimated 6 matches for "sparse_array_read".
2019 Apr 23
0
[nbdkit PATCH 4/4] plugins: Utilize ACQUIRE_LOCK_FOR_CURRENT_SCOPE
...#include "sparse.h"
/* If raw|base64|data parameter seen. */
@@ -339,9 +340,8 @@ data_can_multi_conn (void *handle)
static int
data_pread (void *handle, void *buf, uint32_t count, uint64_t offset)
{
- pthread_mutex_lock (&lock);
+ ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock);
sparse_array_read (sa, buf, count, offset);
- pthread_mutex_unlock (&lock);
return 0;
}
@@ -349,21 +349,16 @@ data_pread (void *handle, void *buf, uint32_t count, uint64_t offset)
static int
data_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset)
{
- int r;
-
- pthread_mutex_lock...
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)).
...n/sparse/sparse.h
index 3acb0af..818d804 100644
--- a/common/sparse/sparse.h
+++ b/common/sparse/sparse.h
@@ -64,12 +64,16 @@ extern void free_sparse_array (struct sparse_array *sa);
/* Read bytes from the sparse array.
* Note this can never return an error and never allocates.
*/
-extern void sparse_array_read (struct sparse_array *sa, void *buf, uint32_t count, uint64_t offset);
+extern void sparse_array_read (struct sparse_array *sa, void *buf,
+ uint32_t count, uint64_t offset)
+ __attribute__((__nonnull__ (1, 2)));
/* Write bytes to the sparse array.
* This can all...
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
2019 Apr 23
8
[nbdkit PATCH 0/4] Start using cleanup macros in filters/plugins
There's more that can be done (in particular, use of CLEANUP_FREE),
but this is enough to at least see if I'm on the right track.
I couldn't figure out an obvious difference between common/include and
common/utils, but it looks like the former is for things that are
inlineable via .h only, while the latter is when you need to link in
a convenience library, so this landed in the
2019 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I
updated some commit messages and reordered the commits in a somewhat
more logical sequence.
The main changes are the extra commits:
[06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.
- Readonly plugins that can set the flag unconditionally.
[09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN.
[10/11]