Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3430)

Unified Diff: drivers/md/dm-bht.c

Issue 6677048: CHROMIUM: verity: use atomic_set instead of atomic_cmpxchg in read_completed (Closed) Base URL: http://git.chromium.org/git/kernel.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: drivers/md/dm-bht.c
diff --git a/drivers/md/dm-bht.c b/drivers/md/dm-bht.c
index 38849d6eb5d35f47825eb60189bacc0e387c17cd..71e3b04b2acf3161495a8ce8b16d2901cbc71202 100644
--- a/drivers/md/dm-bht.c
+++ b/drivers/md/dm-bht.c
@@ -441,7 +441,6 @@ static int dm_bht_write_callback_stub(void *ctx, sector_t start,
*/
void dm_bht_read_completed(struct dm_bht_entry *entry, int status)
{
- int state;
if (status) {
/* TODO(wad) add retry support */
DMCRIT("an I/O error occurred while reading entry");
@@ -449,13 +448,8 @@ void dm_bht_read_completed(struct dm_bht_entry *entry, int status)
/* entry->nodes will be freed later */
return;
}
- state = atomic_cmpxchg(&entry->state,
- DM_BHT_ENTRY_PENDING,
- DM_BHT_ENTRY_READY);
- if (state != DM_BHT_ENTRY_PENDING) {
- DMCRIT("state changed on entry out from under io");
- BUG();
- }
+ BUG_ON(atomic_read(&entry->state) != DM_BHT_ENTRY_PENDING);
+ atomic_set(&entry->state, DM_BHT_ENTRY_READY);
}
EXPORT_SYMBOL(dm_bht_read_completed);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698