lkml.org 
[lkml]   [2020]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectlinux-next: manual merge of the akpm tree with the btrfs tree
Hi all,

Today's linux-next merge of the akpm tree got a conflict in:

include/linux/bitmap.h

between commit:

7a5ce045d17c ("bitmap: genericize percpu bitmap region iterators")

from the btrfs tree and patch:

"lib: rework bitmap_parse()"

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc include/linux/bitmap.h
index cb63feb3cfbe,65994b9f68f3..000000000000
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@@ -450,47 -450,6 +450,41 @@@ static inline void bitmap_replace(unsig
__bitmap_replace(dst, old, new, mask, nbits);
}

- static inline int bitmap_parse(const char *buf, unsigned int buflen,
- unsigned long *maskp, int nmaskbits)
- {
- return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
- }
+static inline void bitmap_next_clear_region(unsigned long *bitmap,
+ unsigned int *rs, unsigned int *re,
+ unsigned int end)
+{
+ *rs = find_next_zero_bit(bitmap, end, *rs);
+ *re = find_next_bit(bitmap, end, *rs + 1);
+}
+
+static inline void bitmap_next_set_region(unsigned long *bitmap,
+ unsigned int *rs, unsigned int *re,
+ unsigned int end)
+{
+ *rs = find_next_bit(bitmap, end, *rs);
+ *re = find_next_zero_bit(bitmap, end, *rs + 1);
+}
+
+/*
+ * Bitmap region iterators. Iterates over the bitmap between [@start, @end).
+ * @rs and @re should be integer variables and will be set to start and end
+ * index of the current clear or set region.
+ */
+#define bitmap_for_each_clear_region(bitmap, rs, re, start, end) \
+ for ((rs) = (start), \
+ bitmap_next_clear_region((bitmap), &(rs), &(re), (end)); \
+ (rs) < (re); \
+ (rs) = (re) + 1, \
+ bitmap_next_clear_region((bitmap), &(rs), &(re), (end)))
+
+#define bitmap_for_each_set_region(bitmap, rs, re, start, end) \
+ for ((rs) = (start), \
+ bitmap_next_set_region((bitmap), &(rs), &(re), (end)); \
+ (rs) < (re); \
+ (rs) = (re) + 1, \
+ bitmap_next_set_region((bitmap), &(rs), &(re), (end)))
+
/**
* BITMAP_FROM_U64() - Represent u64 value in the format suitable for bitmap.
* @n: u64 value
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-01-07 06:26    [W:0.192 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site