diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 17:27:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 17:27:02 -0400 |
commit | 3526dd0c7832f1011a0477cc6d903662bae05ea8 (patch) | |
tree | 22fbac64eb40a0b29bfa4c029695f39b2f591e62 /lib | |
parent | dd972f924df6bdbc0ab185a38d5d2361dbc26311 (diff) | |
parent | bc6d65e6dc89c3b7ff78e4ad797117c122ffde8e (diff) |
Merge tag 'for-4.17/block-20180402' of git://git.kernel.dk/linux-block
Pull block layer updates from Jens Axboe:
"It's a pretty quiet round this time, which is nice. This contains:
- series from Bart, cleaning up the way we set/test/clear atomic
queue flags.
- series from Bart, fixing races between gendisk and queue
registration and removal.
- set of bcache fixes and improvements from various folks, by way of
Michael Lyle.
- set of lightnvm updates from Matias, most of it being the 1.2 to
2.0 transition.
- removal of unused DIO flags from Nikolay.
- blk-mq/sbitmap memory ordering fixes from Omar.
- divide-by-zero fix for BFQ from Paolo.
- minor documentation patches from Randy.
- timeout fix from Tejun.
- Alpha "can't write a char atomically" fix from Mikulas.
- set of NVMe fixes by way of Keith.
- bsg and bsg-lib improvements from Christoph.
- a few sed-opal fixes from Jonas.
- cdrom check-disk-change deadlock fix from Maurizio.
- various little fixes, comment fixes, etc from various folks"
* tag 'for-4.17/block-20180402' of git://git.kernel.dk/linux-block: (139 commits)
blk-mq: Directly schedule q->timeout_work when aborting a request
blktrace: fix comment in blktrace_api.h
lightnvm: remove function name in strings
lightnvm: pblk: remove some unnecessary NULL checks
lightnvm: pblk: don't recover unwritten lines
lightnvm: pblk: implement 2.0 support
lightnvm: pblk: implement get log report chunk
lightnvm: pblk: rename ppaf* to addrf*
lightnvm: pblk: check for supported version
lightnvm: implement get log report chunk helpers
lightnvm: make address conversions depend on generic device
lightnvm: add support for 2.0 address format
lightnvm: normalize geometry nomenclature
lightnvm: complete geo structure with maxoc*
lightnvm: add shorten OCSSD version in geo
lightnvm: add minor version to generic geometry
lightnvm: simplify geometry structure
lightnvm: pblk: refactor init/exit sequences
lightnvm: Avoid validation of default op value
lightnvm: centralize permission check for lightnvm ioctl
...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbitmap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index 42b5ca0acf93..e6a9c06ec70c 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c | |||
@@ -100,7 +100,7 @@ static int __sbitmap_get_word(unsigned long *word, unsigned long depth, | |||
100 | return -1; | 100 | return -1; |
101 | } | 101 | } |
102 | 102 | ||
103 | if (!test_and_set_bit(nr, word)) | 103 | if (!test_and_set_bit_lock(nr, word)) |
104 | break; | 104 | break; |
105 | 105 | ||
106 | hint = nr + 1; | 106 | hint = nr + 1; |
@@ -434,9 +434,9 @@ static void sbq_wake_up(struct sbitmap_queue *sbq) | |||
434 | /* | 434 | /* |
435 | * Pairs with the memory barrier in set_current_state() to ensure the | 435 | * Pairs with the memory barrier in set_current_state() to ensure the |
436 | * proper ordering of clear_bit()/waitqueue_active() in the waker and | 436 | * proper ordering of clear_bit()/waitqueue_active() in the waker and |
437 | * test_and_set_bit()/prepare_to_wait()/finish_wait() in the waiter. See | 437 | * test_and_set_bit_lock()/prepare_to_wait()/finish_wait() in the |
438 | * the comment on waitqueue_active(). This is __after_atomic because we | 438 | * waiter. See the comment on waitqueue_active(). This is __after_atomic |
439 | * just did clear_bit() in the caller. | 439 | * because we just did clear_bit_unlock() in the caller. |
440 | */ | 440 | */ |
441 | smp_mb__after_atomic(); | 441 | smp_mb__after_atomic(); |
442 | 442 | ||
@@ -469,7 +469,7 @@ static void sbq_wake_up(struct sbitmap_queue *sbq) | |||
469 | void sbitmap_queue_clear(struct sbitmap_queue *sbq, unsigned int nr, | 469 | void sbitmap_queue_clear(struct sbitmap_queue *sbq, unsigned int nr, |
470 | unsigned int cpu) | 470 | unsigned int cpu) |
471 | { | 471 | { |
472 | sbitmap_clear_bit(&sbq->sb, nr); | 472 | sbitmap_clear_bit_unlock(&sbq->sb, nr); |
473 | sbq_wake_up(sbq); | 473 | sbq_wake_up(sbq); |
474 | if (likely(!sbq->round_robin && nr < sbq->sb.depth)) | 474 | if (likely(!sbq->round_robin && nr < sbq->sb.depth)) |
475 | *per_cpu_ptr(sbq->alloc_hint, cpu) = nr; | 475 | *per_cpu_ptr(sbq->alloc_hint, cpu) = nr; |