diff options
author | Simon Rettberg | 2013-08-13 17:04:18 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-08-13 17:04:18 +0200 |
commit | c25838a76eacef9a08ae4bca3762d1d328f2b882 (patch) | |
tree | c16c17babd40c0c5b96b87c57ff6bd735e9a952a /src/server/uplink.c | |
parent | [SERVER] Fix race condition in uplink request aggregation, other small improv... (diff) | |
download | dnbd3-c25838a76eacef9a08ae4bca3762d1d328f2b882.tar.gz dnbd3-c25838a76eacef9a08ae4bca3762d1d328f2b882.tar.xz dnbd3-c25838a76eacef9a08ae4bca3762d1d328f2b882.zip |
Test your coke, dork!
Diffstat (limited to 'src/server/uplink.c')
-rw-r--r-- | src/server/uplink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/uplink.c b/src/server/uplink.c index 13ae7ad..a4fccf9 100644 --- a/src/server/uplink.c +++ b/src/server/uplink.c @@ -138,13 +138,13 @@ int uplink_request(dnbd3_client_t *client, uint64_t handle, uint64_t start, uint uplink->queue[freeSlot].to = end; uplink->queue[freeSlot].handle = handle; uplink->queue[freeSlot].client = client; - uplink->queue[freeSlot].status = (foundExisting ? ULR_PENDING : ULR_NEW); + uplink->queue[freeSlot].status = (foundExisting == -1 ? ULR_NEW : ULR_PENDING); #ifdef _DEBUG uplink->queue[freeSlot].entered = time( NULL ); #endif spin_unlock( &uplink->queueLock ); - if ( !foundExisting ) { + if ( foundExisting == -1 ) { static uint64_t counter = 1; write( uplink->signal, &counter, sizeof(uint64_t) ); } |