@@ -856,10 +856,10 @@ int uds_start_restoring_delta_index(struct delta_index *delta_index,
856
856
decode_u64_le (buffer , & offset , & header .record_count );
857
857
decode_u64_le (buffer , & offset , & header .collision_count );
858
858
859
- result = ASSERT (offset == sizeof (struct delta_index_header ),
860
- "%zu bytes decoded of %zu expected" , offset ,
861
- sizeof (struct delta_index_header ));
862
- if (result != UDS_SUCCESS ) {
859
+ result = VDO_ASSERT (offset == sizeof (struct delta_index_header ),
860
+ "%zu bytes decoded of %zu expected" , offset ,
861
+ sizeof (struct delta_index_header ));
862
+ if (result != VDO_SUCCESS ) {
863
863
return uds_log_warning_strerror (result ,
864
864
"failed to read delta index header" );
865
865
}
@@ -1136,10 +1136,10 @@ int uds_start_saving_delta_index(const struct delta_index *delta_index,
1136
1136
encode_u64_le (buffer , & offset , delta_zone -> record_count );
1137
1137
encode_u64_le (buffer , & offset , delta_zone -> collision_count );
1138
1138
1139
- result = ASSERT (offset == sizeof (struct delta_index_header ),
1140
- "%zu bytes encoded of %zu expected" , offset ,
1141
- sizeof (struct delta_index_header ));
1142
- if (result != UDS_SUCCESS )
1139
+ result = VDO_ASSERT (offset == sizeof (struct delta_index_header ),
1140
+ "%zu bytes encoded of %zu expected" , offset ,
1141
+ sizeof (struct delta_index_header ));
1142
+ if (result != VDO_SUCCESS )
1143
1143
return result ;
1144
1144
1145
1145
result = uds_write_to_buffered_writer (buffered_writer , buffer , offset );
@@ -1212,9 +1212,9 @@ size_t uds_compute_delta_index_save_bytes(u32 list_count, size_t memory_size)
1212
1212
1213
1213
static int assert_not_at_end (const struct delta_index_entry * delta_entry )
1214
1214
{
1215
- int result = ASSERT (!delta_entry -> at_end ,
1216
- "operation is invalid because the list entry is at the end of the delta list" );
1217
- if (result != UDS_SUCCESS )
1215
+ int result = VDO_ASSERT (!delta_entry -> at_end ,
1216
+ "operation is invalid because the list entry is at the end of the delta list" );
1217
+ if (result != VDO_SUCCESS )
1218
1218
result = UDS_BAD_STATE ;
1219
1219
1220
1220
return result ;
@@ -1236,19 +1236,19 @@ int uds_start_delta_index_search(const struct delta_index *delta_index, u32 list
1236
1236
struct delta_zone * delta_zone ;
1237
1237
struct delta_list * delta_list ;
1238
1238
1239
- result = ASSERT ((list_number < delta_index -> list_count ),
1240
- "Delta list number (%u) is out of range (%u)" , list_number ,
1241
- delta_index -> list_count );
1242
- if (result != UDS_SUCCESS )
1239
+ result = VDO_ASSERT ((list_number < delta_index -> list_count ),
1240
+ "Delta list number (%u) is out of range (%u)" , list_number ,
1241
+ delta_index -> list_count );
1242
+ if (result != VDO_SUCCESS )
1243
1243
return UDS_CORRUPT_DATA ;
1244
1244
1245
1245
zone_number = list_number / delta_index -> lists_per_zone ;
1246
1246
delta_zone = & delta_index -> delta_zones [zone_number ];
1247
1247
list_number -= delta_zone -> first_list ;
1248
- result = ASSERT ((list_number < delta_zone -> list_count ),
1249
- "Delta list number (%u) is out of range (%u) for zone (%u)" ,
1250
- list_number , delta_zone -> list_count , zone_number );
1251
- if (result != UDS_SUCCESS )
1248
+ result = VDO_ASSERT ((list_number < delta_zone -> list_count ),
1249
+ "Delta list number (%u) is out of range (%u) for zone (%u)" ,
1250
+ list_number , delta_zone -> list_count , zone_number );
1251
+ if (result != VDO_SUCCESS )
1252
1252
return UDS_CORRUPT_DATA ;
1253
1253
1254
1254
if (delta_index -> mutable ) {
@@ -1362,9 +1362,9 @@ noinline int uds_next_delta_index_entry(struct delta_index_entry *delta_entry)
1362
1362
delta_entry -> at_end = true;
1363
1363
delta_entry -> delta = 0 ;
1364
1364
delta_entry -> is_collision = false;
1365
- result = ASSERT ((delta_entry -> offset == size ),
1366
- "next offset past end of delta list" );
1367
- if (result != UDS_SUCCESS )
1365
+ result = VDO_ASSERT ((delta_entry -> offset == size ),
1366
+ "next offset past end of delta list" );
1367
+ if (result != VDO_SUCCESS )
1368
1368
result = UDS_CORRUPT_DATA ;
1369
1369
1370
1370
return result ;
@@ -1390,8 +1390,8 @@ int uds_remember_delta_index_offset(const struct delta_index_entry *delta_entry)
1390
1390
int result ;
1391
1391
struct delta_list * delta_list = delta_entry -> delta_list ;
1392
1392
1393
- result = ASSERT (!delta_entry -> is_collision , "entry is not a collision" );
1394
- if (result != UDS_SUCCESS )
1393
+ result = VDO_ASSERT (!delta_entry -> is_collision , "entry is not a collision" );
1394
+ if (result != VDO_SUCCESS )
1395
1395
return result ;
1396
1396
1397
1397
delta_list -> save_key = delta_entry -> key - delta_entry -> delta ;
@@ -1489,9 +1489,9 @@ int uds_get_delta_entry_collision(const struct delta_index_entry *delta_entry, u
1489
1489
if (result != UDS_SUCCESS )
1490
1490
return result ;
1491
1491
1492
- result = ASSERT (delta_entry -> is_collision ,
1493
- "Cannot get full block name from a non-collision delta index entry" );
1494
- if (result != UDS_SUCCESS )
1492
+ result = VDO_ASSERT (delta_entry -> is_collision ,
1493
+ "Cannot get full block name from a non-collision delta index entry" );
1494
+ if (result != VDO_SUCCESS )
1495
1495
return UDS_BAD_STATE ;
1496
1496
1497
1497
get_collision_name (delta_entry , name );
@@ -1506,9 +1506,9 @@ u32 uds_get_delta_entry_value(const struct delta_index_entry *delta_entry)
1506
1506
1507
1507
static int assert_mutable_entry (const struct delta_index_entry * delta_entry )
1508
1508
{
1509
- int result = ASSERT ((delta_entry -> delta_list != & delta_entry -> temp_delta_list ),
1510
- "delta index is mutable" );
1511
- if (result != UDS_SUCCESS )
1509
+ int result = VDO_ASSERT ((delta_entry -> delta_list != & delta_entry -> temp_delta_list ),
1510
+ "delta index is mutable" );
1511
+ if (result != VDO_SUCCESS )
1512
1512
result = UDS_BAD_STATE ;
1513
1513
1514
1514
return result ;
@@ -1527,10 +1527,10 @@ int uds_set_delta_entry_value(const struct delta_index_entry *delta_entry, u32 v
1527
1527
if (result != UDS_SUCCESS )
1528
1528
return result ;
1529
1529
1530
- result = ASSERT ((value & value_mask ) == value ,
1531
- "Value (%u) being set in a delta index is too large (must fit in %u bits)" ,
1532
- value , delta_entry -> value_bits );
1533
- if (result != UDS_SUCCESS )
1530
+ result = VDO_ASSERT ((value & value_mask ) == value ,
1531
+ "Value (%u) being set in a delta index is too large (must fit in %u bits)" ,
1532
+ value , delta_entry -> value_bits );
1533
+ if (result != VDO_SUCCESS )
1534
1534
return UDS_INVALID_ARGUMENT ;
1535
1535
1536
1536
set_field (value , delta_entry -> delta_zone -> memory ,
@@ -1730,9 +1730,9 @@ int uds_put_delta_index_entry(struct delta_index_entry *delta_entry, u32 key, u3
1730
1730
if (result != UDS_SUCCESS )
1731
1731
return result ;
1732
1732
1733
- result = ASSERT ((key == delta_entry -> key ),
1734
- "incorrect key for collision entry" );
1735
- if (result != UDS_SUCCESS )
1733
+ result = VDO_ASSERT ((key == delta_entry -> key ),
1734
+ "incorrect key for collision entry" );
1735
+ if (result != VDO_SUCCESS )
1736
1736
return result ;
1737
1737
1738
1738
delta_entry -> offset += delta_entry -> entry_bits ;
@@ -1742,8 +1742,8 @@ int uds_put_delta_index_entry(struct delta_index_entry *delta_entry, u32 key, u3
1742
1742
result = insert_bits (delta_entry , delta_entry -> entry_bits );
1743
1743
} else if (delta_entry -> at_end ) {
1744
1744
/* Insert a new entry at the end of the delta list. */
1745
- result = ASSERT ((key >= delta_entry -> key ), "key past end of list" );
1746
- if (result != UDS_SUCCESS )
1745
+ result = VDO_ASSERT ((key >= delta_entry -> key ), "key past end of list" );
1746
+ if (result != VDO_SUCCESS )
1747
1747
return result ;
1748
1748
1749
1749
set_delta (delta_entry , key - delta_entry -> key );
@@ -1760,14 +1760,14 @@ int uds_put_delta_index_entry(struct delta_index_entry *delta_entry, u32 key, u3
1760
1760
* Insert a new entry which requires the delta in the following entry to be
1761
1761
* updated.
1762
1762
*/
1763
- result = ASSERT ((key < delta_entry -> key ),
1764
- "key precedes following entry" );
1765
- if (result != UDS_SUCCESS )
1763
+ result = VDO_ASSERT ((key < delta_entry -> key ),
1764
+ "key precedes following entry" );
1765
+ if (result != VDO_SUCCESS )
1766
1766
return result ;
1767
1767
1768
- result = ASSERT ((key >= delta_entry -> key - delta_entry -> delta ),
1769
- "key effects following entry's delta" );
1770
- if (result != UDS_SUCCESS )
1768
+ result = VDO_ASSERT ((key >= delta_entry -> key - delta_entry -> delta ),
1769
+ "key effects following entry's delta" );
1770
+ if (result != VDO_SUCCESS )
1771
1771
return result ;
1772
1772
1773
1773
old_entry_size = delta_entry -> entry_bits ;
0 commit comments