Index: dm-bht.c |
diff --git a/dm-bht.c b/dm-bht.c |
index 38849d6eb5d35f47825eb60189bacc0e387c17cd..71e3b04b2acf3161495a8ce8b16d2901cbc71202 100644 |
--- a/dm-bht.c |
+++ b/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); |