Commit 44a4a66b authored by Matthew Wilcox's avatar Matthew Wilcox

XArray: Correct xa_store_range

The explicit '64' should have been BITS_PER_LONG, but while looking at
this code I realised I meant to use __ffs(), not ilog2().
Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
parent 804dfaf0
...@@ -1565,8 +1565,9 @@ void *xa_store_range(struct xarray *xa, unsigned long first, ...@@ -1565,8 +1565,9 @@ void *xa_store_range(struct xarray *xa, unsigned long first,
do { do {
xas_lock(&xas); xas_lock(&xas);
if (entry) { if (entry) {
unsigned int order = (last == ~0UL) ? 64 : unsigned int order = BITS_PER_LONG;
ilog2(last + 1); if (last + 1)
order = __ffs(last + 1);
xas_set_order(&xas, last, order); xas_set_order(&xas, last, order);
xas_create(&xas); xas_create(&xas);
if (xas_error(&xas)) if (xas_error(&xas))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment