Displaying 20 results from an estimated 49 matches for "bitmap_clear".
2012 Jan 20
2
[PATCH] xen-blkfront: use bitmap_set() and bitmap_clear()
Use bitmap_set and bitmap_clear rather than modifying individual bits
in a memory region.
Signed-off-by: Akinobu Mita <akinobu.mita at gmail.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk at oracle.com>
Cc: xen-devel at lists.xensource.com
Cc: virtualizat...
2012 Jan 20
2
[PATCH] xen-blkfront: use bitmap_set() and bitmap_clear()
Use bitmap_set and bitmap_clear rather than modifying individual bits
in a memory region.
Signed-off-by: Akinobu Mita <akinobu.mita at gmail.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk at oracle.com>
Cc: xen-devel at lists.xensource.com
Cc: virtualizat...
2017 Sep 11
1
[PATCH v15 2/5] lib/xbitmap: add xb_find_next_bit() and xb_zero()
...rcu_assign_pointer(*slot, (void *)tmp);
} else if (bitmap) {
unsigned int nbits = end - start + 1;
if (nbits + bit > IDA_BITMAP_BITS)
nbits = IDA_BITMAP_BITS - bit;
bitmap_clear(bitmap->bitmap, bit, nbits);
if (bitmap_empty(bitmap->bitmap, IDA_BITMAP_BITS)) {
kfree(bitmap);
__radix_tree_delete(root, node, slot);
}
}
}
}
Also note th...
2017 Sep 11
1
[PATCH v15 2/5] lib/xbitmap: add xb_find_next_bit() and xb_zero()
...rcu_assign_pointer(*slot, (void *)tmp);
} else if (bitmap) {
unsigned int nbits = end - start + 1;
if (nbits + bit > IDA_BITMAP_BITS)
nbits = IDA_BITMAP_BITS - bit;
bitmap_clear(bitmap->bitmap, bit, nbits);
if (bitmap_empty(bitmap->bitmap, IDA_BITMAP_BITS)) {
kfree(bitmap);
__radix_tree_delete(root, node, slot);
}
}
}
}
Also note th...
2017 Dec 12
0
[PATCH v19 3/7] xbitmap: add more operations
...bitmap = __radix_tree_lookup(root, index, &node, &slot);
+ if (radix_tree_exception(bitmap)) {
+ unsigned long ebit = bit + 2;
+ unsigned long tmp = (unsigned long)bitmap;
+
+ nbits = min(end - start + 1, BITS_PER_LONG - ebit);
+
+ if (ebit >= BITS_PER_LONG)
+ continue;
+ bitmap_clear(&tmp, ebit, nbits);
+ if (tmp == RADIX_TREE_EXCEPTIONAL_ENTRY)
+ __radix_tree_delete(root, node, slot);
+ else
+ rcu_assign_pointer(*slot, (void *)tmp);
+ } else if (bitmap) {
+ nbits = min(end - start + 1, IDA_BITMAP_BITS - bit);
+
+ if (nbits != IDA_BITMAP_BITS)
+ bitmap_cle...
2017 Nov 03
0
[PATCH v17 2/6] radix tree test suite: add tests for xbitmap
...ree/xbitmap.c
diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h
index e8b9f51..890dab2 100644
--- a/tools/include/linux/bitmap.h
+++ b/tools/include/linux/bitmap.h
@@ -36,6 +36,40 @@ static inline void bitmap_zero(unsigned long *dst, int nbits)
}
}
+static inline void __bitmap_clear(unsigned long *map, unsigned int start,
+ int len)
+{
+ unsigned long *p = map + BIT_WORD(start);
+ const unsigned int size = start + len;
+ int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG);
+ unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start);
+
+ while (len - bits_to_clea...
2017 Nov 03
1
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
...amp;node, &slot);
> + if (radix_tree_exception(bitmap)) {
> + unsigned long ebit = bit + 2;
> + unsigned long tmp = (unsigned long)bitmap;
> +
> + nbits = min(end - start + 1, BITS_PER_LONG - ebit);
> +
> + if (ebit >= BITS_PER_LONG)
> + continue;
> + bitmap_clear(&tmp, ebit, nbits);
> + if (tmp == RADIX_TREE_EXCEPTIONAL_ENTRY)
> + __radix_tree_delete(root, node, slot);
> + else
> + rcu_assign_pointer(*slot, (void *)tmp);
> + } else if (bitmap) {
> + nbits = min(end - start + 1, IDA_BITMAP_BITS - bit);
> +
> + if (n...
2017 Nov 03
1
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
...amp;node, &slot);
> + if (radix_tree_exception(bitmap)) {
> + unsigned long ebit = bit + 2;
> + unsigned long tmp = (unsigned long)bitmap;
> +
> + nbits = min(end - start + 1, BITS_PER_LONG - ebit);
> +
> + if (ebit >= BITS_PER_LONG)
> + continue;
> + bitmap_clear(&tmp, ebit, nbits);
> + if (tmp == RADIX_TREE_EXCEPTIONAL_ENTRY)
> + __radix_tree_delete(root, node, slot);
> + else
> + rcu_assign_pointer(*slot, (void *)tmp);
> + } else if (bitmap) {
> + nbits = min(end - start + 1, IDA_BITMAP_BITS - bit);
> +
> + if (n...
2017 Dec 22
2
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...dix_tree_deref_slot(slot);
> + if (!bitmap)
> + continue;
> + radix_tree_iter_tag_set(root, &iter, IDR_FREE);
> +
> + if (!first && iter.index < maxindex)
> + goto delete;
> + if (iter.index == maxindex)
> + nbits = max % IDA_BITMAP_BITS + 1;
> + bitmap_clear(bitmap->bitmap, first, nbits);
It should be: bitmap_clear(.., first, nbits - first);
> diff --git a/tools/testing/radix-tree/Makefile b/tools/testing/radix-tree/Makefile
> index fa7ee369b3c9..adf36e34dd77 100644
> --- a/tools/testing/radix-tree/Makefile
> +++ b/tools/testing/radix...
2017 Dec 22
2
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...dix_tree_deref_slot(slot);
> + if (!bitmap)
> + continue;
> + radix_tree_iter_tag_set(root, &iter, IDR_FREE);
> +
> + if (!first && iter.index < maxindex)
> + goto delete;
> + if (iter.index == maxindex)
> + nbits = max % IDA_BITMAP_BITS + 1;
> + bitmap_clear(bitmap->bitmap, first, nbits);
It should be: bitmap_clear(.., first, nbits - first);
> diff --git a/tools/testing/radix-tree/Makefile b/tools/testing/radix-tree/Makefile
> index fa7ee369b3c9..adf36e34dd77 100644
> --- a/tools/testing/radix-tree/Makefile
> +++ b/tools/testing/radix...
2017 Dec 01
0
[PATCH v18 05/10] xbitmap: add more operations
...clarify what "inclusive" intended.
If xb_clear_bit_range(xb,10,10), then it is effectively the same as
xb_clear_bit(10). Why would it be illegal?
"@start inclusive" means that the @start will also be included to be
cleared.
>
>> +static inline __always_inline void bitmap_clear(unsigned long *map,
>> + unsigned int start,
>> + unsigned int nbits)
>> +{
>> + if (__builtin_constant_p(nbits) && nbits == 1)
>> + __clear_bit(start, map);
>> + else if (__builtin_constant_p(start & 7) && IS_ALIGNED(start, 8) &...
2017 Dec 19
0
[PATCH v20 0/7] Virtio-balloon Enhancement
...y large ranges (e.g.
> > [0, ULONG_MAX)) will take too long time. This can be optimized in
> > the future.
> > - remove the exceptional path;
> > - remove xb_preload_and_set();
> > - reimplement xb_clear_bit_range to make its usage close to
> > bitmap_clear;
> > - rename xb_find_next_set_bit to xb_find_set, and re-implement it
> > in a style close to find_next_bit;
> > - rename xb_find_next_zero_bit to xb_find_clear, and re-implement
> > it in a stytle close to find_next_zero_bit;
> > - separate the implementatio...
2017 Dec 19
0
[PATCH v20 0/7] Virtio-balloon Enhancement
...y large ranges (e.g.
> > [0, ULONG_MAX)) will take too long time. This can be optimized in
> > the future.
> > - remove the exceptional path;
> > - remove xb_preload_and_set();
> > - reimplement xb_clear_bit_range to make its usage close to
> > bitmap_clear;
> > - rename xb_find_next_set_bit to xb_find_set, and re-implement it
> > in a style close to find_next_bit;
> > - rename xb_find_next_zero_bit to xb_find_clear, and re-implement
> > it in a stytle close to find_next_zero_bit;
> > - separate the implementatio...
2012 Feb 02
0
Samba 3.5: dumping core
...[2012/02/02 11:08:34.974139, 0] lib/fault.c:326(dump_core)
dumping core in /var/log/samba/cores/smbd
[2012/02/02 11:37:33.245678, 0] smbd/sesssetup.c:1401(shutdown_other_smbds)
shutdown_other_smbds: shutting down pid 18379 (IP 192.168.0.175)
[2012/02/02 11:37:33.245983, 0] lib/bitmap.c:120(bitmap_clear)
clearing invalid bitmap entry 38480 (of 128)
[2012/02/02 11:37:33.246152, 0] lib/popt_common.c:64(popt_s3_talloc_log_fn)
talloc: double free error - first free may be at smbd/conn.c:293
[2012/02/02 11:37:33.246188, 0] lib/popt_common.c:64(popt_s3_talloc_log_fn)
Bad talloc magic value - dou...
2017 Dec 21
7
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...;
+
+ if (nbits > ULONG_MAX - start)
+ nbits = ULONG_MAX - start;
+
+ while (nbits) {
+ unsigned int __nbits = min(nbits,
+ (unsigned long)IDA_BITMAP_BITS - bit);
+
+ bitmap = __radix_tree_lookup(root, index, &node, &slot);
+ if (bitmap) {
+ if (__nbits != IDA_BITMAP_BITS)
+ bitmap_clear(bitmap->bitmap, bit, __nbits);
+
+ if (__nbits == IDA_BITMAP_BITS ||
+ bitmap_empty(bitmap->bitmap, IDA_BITMAP_BITS)) {
+ kfree(bitmap);
+ __radix_tree_delete(root, node, slot);
+ }
+ }
+ bit = 0;
+ index++;
+ nbits -= __nbits;
+ }
+}
+EXPORT_SYMBOL(xb_clear_bit_range);
+...
2017 Dec 21
7
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...;
+
+ if (nbits > ULONG_MAX - start)
+ nbits = ULONG_MAX - start;
+
+ while (nbits) {
+ unsigned int __nbits = min(nbits,
+ (unsigned long)IDA_BITMAP_BITS - bit);
+
+ bitmap = __radix_tree_lookup(root, index, &node, &slot);
+ if (bitmap) {
+ if (__nbits != IDA_BITMAP_BITS)
+ bitmap_clear(bitmap->bitmap, bit, __nbits);
+
+ if (__nbits == IDA_BITMAP_BITS ||
+ bitmap_empty(bitmap->bitmap, IDA_BITMAP_BITS)) {
+ kfree(bitmap);
+ __radix_tree_delete(root, node, slot);
+ }
+ }
+ bit = 0;
+ index++;
+ nbits -= __nbits;
+ }
+}
+EXPORT_SYMBOL(xb_clear_bit_range);
+...
2017 Dec 20
2
[PATCH v20 0/7] Virtio-balloon Enhancement
...remely large ranges (e.g.
>> [0, ULONG_MAX)) will take too long time. This can be optimized in
>> the future.
>> - remove the exceptional path;
>> - remove xb_preload_and_set();
>> - reimplement xb_clear_bit_range to make its usage close to
>> bitmap_clear;
>> - rename xb_find_next_set_bit to xb_find_set, and re-implement it
>> in a style close to find_next_bit;
>> - rename xb_find_next_zero_bit to xb_find_clear, and re-implement
>> it in a stytle close to find_next_zero_bit;
>> - separate the implementation of...
2017 Dec 20
2
[PATCH v20 0/7] Virtio-balloon Enhancement
...remely large ranges (e.g.
>> [0, ULONG_MAX)) will take too long time. This can be optimized in
>> the future.
>> - remove the exceptional path;
>> - remove xb_preload_and_set();
>> - reimplement xb_clear_bit_range to make its usage close to
>> bitmap_clear;
>> - rename xb_find_next_set_bit to xb_find_set, and re-implement it
>> in a style close to find_next_bit;
>> - rename xb_find_next_zero_bit to xb_find_clear, and re-implement
>> it in a stytle close to find_next_zero_bit;
>> - separate the implementation of...
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.
2017 Nov 03
0
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
...bitmap = __radix_tree_lookup(root, index, &node, &slot);
+ if (radix_tree_exception(bitmap)) {
+ unsigned long ebit = bit + 2;
+ unsigned long tmp = (unsigned long)bitmap;
+
+ nbits = min(end - start + 1, BITS_PER_LONG - ebit);
+
+ if (ebit >= BITS_PER_LONG)
+ continue;
+ bitmap_clear(&tmp, ebit, nbits);
+ if (tmp == RADIX_TREE_EXCEPTIONAL_ENTRY)
+ __radix_tree_delete(root, node, slot);
+ else
+ rcu_assign_pointer(*slot, (void *)tmp);
+ } else if (bitmap) {
+ nbits = min(end - start + 1, IDA_BITMAP_BITS - bit);
+
+ if (nbits != IDA_BITMAP_BITS)
+ bitmap_cle...