search for: bitmap_free

Displaying 20 results from an estimated 23 matches for "bitmap_free".

2020 Jul 21
0
[PATCH v9 45/84] KVM: introspection: add KVMI_VM_CONTROL_EVENTS
...ent_enabled(struct kvm_introspection *kvmi, int event) +{ + return test_bit(event, kvmi->vm_event_enable_mask); +} + static void setup_always_allowed_commands(void) { bitmap_zero(Kvmi_always_allowed_commands, KVMI_NUM_COMMANDS); @@ -100,6 +110,7 @@ static void free_kvmi(struct kvm *kvm) { bitmap_free(kvm->kvmi->cmd_allow_mask); bitmap_free(kvm->kvmi->event_allow_mask); + bitmap_free(kvm->kvmi->vm_event_enable_mask); kfree(kvm->kvmi); kvm->kvmi = NULL; @@ -116,9 +127,12 @@ alloc_kvmi(struct kvm *kvm, const struct kvm_introspection_hook *hook) kvmi->cmd_allo...
2019 Jan 01
0
[PATCH nbdkit v2 3/4] cache: Implement LRU structure.
...ru.h" /* The cache. */ static int fd = -1; @@ -80,6 +81,8 @@ blk_init (void) size_t len; char *template; + lru_init (); + bitmap_init (&bm, BLKSIZE, 2 /* bits per block */); tmpdir = getenv ("TMPDIR"); @@ -115,6 +118,8 @@ blk_free (void) close (fd); bitmap_free (&bm); + + lru_free (); } int @@ -128,6 +133,9 @@ blk_set_size (uint64_t new_size) return -1; } + if (lru_set_size (new_size) == -1) + return -1; + return 0; } @@ -163,6 +171,7 @@ blk_read (struct nbdkit_next_ops *next_ops, void *nxdata, return -1; }...
2019 Jan 03
0
[PATCH nbdkit v4 1/2] cache: Implement LRU structure.
...ru.h" /* The cache. */ static int fd = -1; @@ -80,6 +81,8 @@ blk_init (void) size_t len; char *template; + lru_init (); + bitmap_init (&bm, BLKSIZE, 2 /* bits per block */); tmpdir = getenv ("TMPDIR"); @@ -115,6 +118,8 @@ blk_free (void) close (fd); bitmap_free (&bm); + + lru_free (); } int @@ -128,6 +133,9 @@ blk_set_size (uint64_t new_size) return -1; } + if (lru_set_size (new_size) == -1) + return -1; + return 0; } @@ -163,6 +171,7 @@ blk_read (struct nbdkit_next_ops *next_ops, void *nxdata, return -1; }...
2018 Dec 02
2
[PATCH nbdkit v2] common: Move shared bitmap code to a common library.
This is exactly the same as v1: https://www.redhat.com/archives/libguestfs/2018-December/msg00004.html except that it now frees the bitmap on unload (which the old code did not - there was always a memory leak). Rich.
2018 Dec 02
0
[PATCH nbdkit v2] common: Move shared bitmap code to a common library.
...+ assert (is_power_of_2 (bpb)); /* Only 1, 2, 4, 8 allowed. */ + + bm->blksize = blksize; + bm->bpb = bpb; + + bm->bitmap = NULL; + bm->size = 0; +} + +/* Only frees the bitmap itself, since it is assumed that the struct + * bitmap is statically allocated. + */ +static inline void +bitmap_free (struct bitmap *bm) +{ + if (bm) + free (bm->bitmap); +} + +/* Resize the bitmap to the virtual disk size in bytes. + * Returns -1 on error, setting nbdkit_error. + */ +extern int bitmap_resize (struct bitmap *bm, uint64_t new_size); + +/* Return the bit(s) associated with the given block. +...
2018 Dec 03
0
[PATCH nbdkit v3] common: Move shared bitmap code to a common library.
...1; break; + case 4: bm->bitshift = 2; break; + case 8: bm->bitshift = 3; break; + default: abort (); + } + + bm->bitmap = NULL; + bm->size = 0; +} + +/* Only frees the bitmap itself, since it is assumed that the struct + * bitmap is statically allocated. + */ +static inline void +bitmap_free (struct bitmap *bm) +{ + if (bm) + free (bm->bitmap); +} + +/* Resize the bitmap to the virtual disk size in bytes. + * Returns -1 on error, setting nbdkit_error. + */ +extern int bitmap_resize (struct bitmap *bm, uint64_t new_size); + +/* This macro calculates the byte offset in the bitmap...
2018 Dec 03
3
[PATCH nbdkit v3] common: Move shared bitmap code to a common library.
v2: https://www.redhat.com/archives/libguestfs/2018-December/msg00039.html v2 -> v3: - Fix all the issues raised in Eric's review. - Precompute some numbers to make the calculations easier. - Calculations now use bitshifts and masks in preference to division and modulo. - Clear existing bits before setting (which fixes a bug in the cache filter). Rich.
2019 Jan 03
3
[PATCH nbdkit v3 0/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
Patch 1 is the same as last time, except for a minor comment fix. Patch 2 should address everything that Eric mentioned in his review, and has been retested. Rich.
2019 Jan 01
7
[PATCH nbdkit v2 0/4] cache: Implement cache-max-size etc.
These are essentially identical to what was previously posted as patches 6/9 through 9/9 here: https://www.redhat.com/archives/libguestfs/2018-December/msg00145.html except that it has been rebased onto the current git master and retested thoroughly. Rich.
2018 Dec 03
1
Re: [PATCH nbdkit v2] common: Move shared bitmap code to a common library.
...for multiplying by 8 (for bpb of 1). > + bm->bpb = bpb; > + > + bm->bitmap = NULL; > + bm->size = 0; > +} > + > +/* Only frees the bitmap itself, since it is assumed that the struct > + * bitmap is statically allocated. > + */ > +static inline void > +bitmap_free (struct bitmap *bm) > +{ > + if (bm) > + free (bm->bitmap); > +} > + > +/* Resize the bitmap to the virtual disk size in bytes. > + * Returns -1 on error, setting nbdkit_error. > + */ > +extern int bitmap_resize (struct bitmap *bm, uint64_t new_size); > + > +...
2018 Dec 28
12
[PATCH nbdkit 0/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
This patch series enhances the cache filter in a few ways, primarily adding a "cache-on-read" feature (similar to qemu's copyonread); and adding the ability to limit the cache size and the antecedent of that which is having a method to reclaim cache blocks. As the cache is stored as a sparse temporary file, reclaiming cache blocks simply means punching holes in the temporary file.
2019 Jan 03
4
[PATCH nbdkit v4 0/2] cache: Implement cache-max-size and method of
v3 was broken by a bad rebase, so let's forget about that one. Compared to v2: - Patch 1 is the same except for a minor comment change. - Patch 2 splits the reclaim code into a separate file (filters/cache/reclaim.c) - Addressed Eric's comments from his review of v2. - Retested on Linux and FreeBSD.
2019 Jan 01
0
[PATCH nbdkit v2 1/4] common/bitmap: Add bitmap_next function and tests.
...ero entries in the bitmap. */ + i = bitmap_next (&bm, 0); + j = 0; + while (i != -1) { + assert (i == blks[j]); + vexp = (j & 1) == 0 ? 1 : (1<<bpb) - 1; + v = bitmap_get_blk (&bm, i, 0); + assert (v == vexp); + i = bitmap_next (&bm, i+1); + ++j; + } + + bitmap_free (&bm); +} + +int +main (void) +{ + int bpb; + size_t i; + int blksizes[] = { 1, 2, 4, 1024, 2048, 4096, 16384 }; + + /* Try the tests at each bpb setting and at a range of block sizes. */ + for (bpb = 1; bpb <= 8; bpb <<= 1) + for (i = 0; i < sizeof blksizes / sizeof blksize...
2019 Jan 04
5
[PATCH nbdkit v5 3/3] cache: Implement cache-max-size and cache space reclaim.
v4: https://www.redhat.com/archives/libguestfs/2019-January/msg00032.html v5: - Now we set the block size at run time. I'd like to say that I was able to test this change, but unfortunately I couldn't find any easy way to create a filesystem on x86-64 with a block size > 4K. Ext4 doesn't support it at all, and XFS doesn't support block size > page size (and I
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.
2004 Oct 21
0
compile errors samba 3.0.7 vfs
...#39; modules/vfs_full_audit.po(.text+0x26e): undefined reference to `dbghdr' modules/vfs_full_audit.po(.text+0x287): undefined reference to `dbgtext' modules/vfs_full_audit.po(.text+0x2ac): undefined reference to `strequal' modules/vfs_full_audit.po(.text+0x2d2): undefined reference to `bitmap_free' modules/vfs_full_audit.po: In function `do_log': modules/vfs_full_audit.po(.text+0x385): undefined reference to `safe_strcpy_fn' modules/vfs_full_audit.po(.text+0x3c7): undefined reference to `fstr_sprintf' modules/vfs_full_audit.po: In function `smb_full_audit_connect': modu...
2015 Jun 23
2
Call for testing: OpenSSH 6.9
...itmap/tests.c b/regress/unittests/bitmap/tests.c index 23025f9..2271e94 100644 --- a/regress/unittests/bitmap/tests.c +++ b/regress/unittests/bitmap/tests.c @@ -27,6 +27,7 @@ void tests(void) { +#ifdef WITH_OPENSSL struct bitmap *b; BIGNUM *bn; size_t len; @@ -131,5 +132,6 @@ tests(void) bitmap_free(b); BN_free(bn); TEST_DONE(); +#endif /* WITH_OPENSSL */ } diff --git a/regress/unittests/hostkeys/test_iterate.c b/regress/unittests/hostkeys/test_iterate.c index 2eaaf06..da0e353 100644 --- a/regress/unittests/hostkeys/test_iterate.c +++ b/regress/unittests/hostkeys/test_iterate.c @@ -92,1...
2023 Mar 28
12
[PATCH v6 00/11] vhost: multiple worker support
The following patches were built over linux-next which contains various vhost patches in mst's tree and the vhost_task patchset in Christian Brauner's tree: git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git kernel.user_worker branch: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/log/?h=kernel.user_worker The latter patchset handles the review comment
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...-65,7 +65,7 @@ struct bitmap { size_t size; /* Size of bitmap in bytes. */ }; -static inline void +static inline void __attribute__((__nonnull__ (1))) bitmap_init (struct bitmap *bm, unsigned blksize, unsigned bpb) { assert (is_power_of_2 (blksize)); @@ -99,10 +99,11 @@ bitmap_free (struct bitmap *bm) /* Resize the bitmap to the virtual disk size in bytes. * Returns -1 on error, setting nbdkit_error. */ -extern int bitmap_resize (struct bitmap *bm, uint64_t new_size); +extern int bitmap_resize (struct bitmap *bm, uint64_t new_size) + __attribute__((__nonnull__ (1)));...
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