mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
bcache: add the missing comments for smp_mb()/smp_wmb()
Checkpatch.pl warns there are 2 locations of smp_mb() and smp_wmb() without code comment. This patch adds the missing code comments for these memory barrier calls. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: Shenghui Wang <shhuiw@foxmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d0c1b89a40
commit
eb2b3d0345
2 changed files with 4 additions and 2 deletions
|
@ -289,10 +289,12 @@ static inline void closure_init_stack(struct closure *cl)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* closure_wake_up - wake up all closures on a wait list.
|
* closure_wake_up - wake up all closures on a wait list,
|
||||||
|
* with memory barrier
|
||||||
*/
|
*/
|
||||||
static inline void closure_wake_up(struct closure_waitlist *list)
|
static inline void closure_wake_up(struct closure_waitlist *list)
|
||||||
{
|
{
|
||||||
|
/* Memory barrier for the wait list */
|
||||||
smp_mb();
|
smp_mb();
|
||||||
__closure_wake_up(list);
|
__closure_wake_up(list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1136,11 +1136,11 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
|
||||||
list_move(&dc->list, &c->cached_devs);
|
list_move(&dc->list, &c->cached_devs);
|
||||||
calc_cached_dev_sectors(c);
|
calc_cached_dev_sectors(c);
|
||||||
|
|
||||||
smp_wmb();
|
|
||||||
/*
|
/*
|
||||||
* dc->c must be set before dc->count != 0 - paired with the mb in
|
* dc->c must be set before dc->count != 0 - paired with the mb in
|
||||||
* cached_dev_get()
|
* cached_dev_get()
|
||||||
*/
|
*/
|
||||||
|
smp_wmb();
|
||||||
refcount_set(&dc->count, 1);
|
refcount_set(&dc->count, 1);
|
||||||
|
|
||||||
/* Block writeback thread, but spawn it */
|
/* Block writeback thread, but spawn it */
|
||||||
|
|
Loading…
Add table
Reference in a new issue