Commit 215366bd authored by Yoni Fogel's avatar Yoni Fogel

break up if clause into extra lines

git-svn-id: file:///svn/tokudb@2923 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7cb30a60
...@@ -1263,7 +1263,10 @@ int toku_lt_acquire_range_read_lock(toku_lock_tree* tree, DB_TXN* txn, ...@@ -1263,7 +1263,10 @@ int toku_lt_acquire_range_read_lock(toku_lock_tree* tree, DB_TXN* txn,
r = toku__do_escalation(tree, &locks_available); r = toku__do_escalation(tree, &locks_available);
if (r != 0) { goto cleanup; } if (r != 0) { goto cleanup; }
if (!locks_available) { r = ENOMEM; goto cleanup; } if (!locks_available) {
r = ENOMEM;
goto cleanup;
}
r = toku__lt_try_acquire_range_read_lock(tree, txn, r = toku__lt_try_acquire_range_read_lock(tree, txn,
key_left, data_left, key_left, data_left,
...@@ -1271,7 +1274,10 @@ int toku_lt_acquire_range_read_lock(toku_lock_tree* tree, DB_TXN* txn, ...@@ -1271,7 +1274,10 @@ int toku_lt_acquire_range_read_lock(toku_lock_tree* tree, DB_TXN* txn,
&out_of_locks); &out_of_locks);
if (r != 0) { goto cleanup; } if (r != 0) { goto cleanup; }
} }
if (out_of_locks) { r = ENOMEM; goto cleanup; } if (out_of_locks) {
r = ENOMEM;
goto cleanup;
}
r = 0; r = 0;
cleanup: cleanup:
...@@ -1373,14 +1379,20 @@ int toku_lt_acquire_write_lock(toku_lock_tree* tree, DB_TXN* txn, ...@@ -1373,14 +1379,20 @@ int toku_lt_acquire_write_lock(toku_lock_tree* tree, DB_TXN* txn,
r = toku__do_escalation(tree, &locks_available); r = toku__do_escalation(tree, &locks_available);
if (r != 0) { goto cleanup; } if (r != 0) { goto cleanup; }
if (!locks_available) { r = ENOMEM; goto cleanup; } if (!locks_available) {
r = ENOMEM;
goto cleanup;
}
r = toku__lt_try_acquire_write_lock (tree, txn, r = toku__lt_try_acquire_write_lock (tree, txn,
key, data, key, data,
&out_of_locks); &out_of_locks);
if (r != 0) { goto cleanup; } if (r != 0) { goto cleanup; }
} }
if (out_of_locks) { r = ENOMEM; goto cleanup; } if (out_of_locks) {
r = ENOMEM;
goto cleanup;
}
r = 0; r = 0;
cleanup: cleanup:
...@@ -1433,7 +1445,10 @@ int toku_lt_acquire_range_write_lock(toku_lock_tree* tree, DB_TXN* txn, ...@@ -1433,7 +1445,10 @@ int toku_lt_acquire_range_write_lock(toku_lock_tree* tree, DB_TXN* txn,
r = toku__do_escalation(tree, &locks_available); r = toku__do_escalation(tree, &locks_available);
if (r != 0) { goto cleanup; } if (r != 0) { goto cleanup; }
if (!locks_available) { r = ENOMEM; goto cleanup; } if (!locks_available) {
r = ENOMEM;
goto cleanup;
}
r = toku__lt_try_acquire_range_write_lock (tree, txn, r = toku__lt_try_acquire_range_write_lock (tree, txn,
key_left, data_left, key_left, data_left,
...@@ -1441,7 +1456,10 @@ int toku_lt_acquire_range_write_lock(toku_lock_tree* tree, DB_TXN* txn, ...@@ -1441,7 +1456,10 @@ int toku_lt_acquire_range_write_lock(toku_lock_tree* tree, DB_TXN* txn,
&out_of_locks); &out_of_locks);
if (r != 0) { goto cleanup; } if (r != 0) { goto cleanup; }
} }
if (out_of_locks) { r = ENOMEM; goto cleanup; } if (out_of_locks) {
r = ENOMEM;
goto cleanup;
}
r = 0; r = 0;
cleanup: cleanup:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment