Skip to content

Commit eb2b3d0

Browse files
Coly Liaxboe
authored andcommitted
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>
1 parent d0c1b89 commit eb2b3d0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/md/bcache/closure.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,12 @@ static inline void closure_init_stack(struct closure *cl)
289289
}
290290

291291
/**
292-
* closure_wake_up - wake up all closures on a wait list.
292+
* closure_wake_up - wake up all closures on a wait list,
293+
* with memory barrier
293294
*/
294295
static inline void closure_wake_up(struct closure_waitlist *list)
295296
{
297+
/* Memory barrier for the wait list */
296298
smp_mb();
297299
__closure_wake_up(list);
298300
}

drivers/md/bcache/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,11 +1136,11 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
11361136
list_move(&dc->list, &c->cached_devs);
11371137
calc_cached_dev_sectors(c);
11381138

1139-
smp_wmb();
11401139
/*
11411140
* dc->c must be set before dc->count != 0 - paired with the mb in
11421141
* cached_dev_get()
11431142
*/
1143+
smp_wmb();
11441144
refcount_set(&dc->count, 1);
11451145

11461146
/* Block writeback thread, but spawn it */

0 commit comments

Comments
 (0)