Displaying 6 results from an estimated 6 matches for "sparse_array_write".
2019 Apr 23
0
[nbdkit PATCH 4/4] plugins: Utilize ACQUIRE_LOCK_FOR_CURRENT_SCOPE
...fset);
- 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 (&lock);
- r = sparse_array_write (sa, buf, count, offset);
- pthread_mutex_unlock (&lock);
- return r;
+ ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock);
+ return sparse_array_write (sa, buf, count, offset);
}
/* Zero. */
static int
data_zero (void *handle, uint32_t count, uint64_t offset, int may_trim)
{
- pthread_mutex...
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)).
...ount, 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 allocate and can return an error.
*/
-extern int sparse_array_write (struct sparse_array *sa, const void *buf, uint32_t count, uint64_t offset);
+extern int sparse_array_write (struct sparse_array *sa, const void *buf,
+ uint32_t count, uint64_t offset)
+ __attribute__((__nonnull__ (1, 2)));
/* Zero byte range in the sparse array....
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]
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