Skip to content

Commit 3584240

Browse files
author
Mike Snitzer
committed
dm vdo logger: change from uds_ to vdo_ namespace
Rename all uds_log_* to vdo_log_*. Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Chung Chung <[email protected]> Signed-off-by: Matthew Sakai <[email protected]>
1 parent 66214ed commit 3584240

39 files changed

+506
-506
lines changed

drivers/md/dm-vdo/admin-state.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@ static int __must_check begin_operation(struct admin_state *state,
228228
const struct admin_state_code *next_state = get_next_state(state, operation);
229229

230230
if (next_state == NULL) {
231-
result = uds_log_error_strerror(VDO_INVALID_ADMIN_STATE,
231+
result = vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE,
232232
"Can't start %s from %s",
233233
operation->name,
234234
vdo_get_admin_state_code(state)->name);
235235
} else if (state->waiter != NULL) {
236-
result = uds_log_error_strerror(VDO_COMPONENT_BUSY,
236+
result = vdo_log_error_strerror(VDO_COMPONENT_BUSY,
237237
"Can't start %s with extant waiter",
238238
operation->name);
239239
} else {
@@ -291,7 +291,7 @@ static bool check_code(bool valid, const struct admin_state_code *code, const ch
291291
if (valid)
292292
return true;
293293

294-
result = uds_log_error_strerror(VDO_INVALID_ADMIN_STATE,
294+
result = vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE,
295295
"%s is not a %s", code->name, what);
296296
if (waiter != NULL)
297297
vdo_continue_completion(waiter, result);
@@ -334,7 +334,7 @@ bool vdo_start_draining(struct admin_state *state,
334334
}
335335

336336
if (!code->normal) {
337-
uds_log_error_strerror(VDO_INVALID_ADMIN_STATE, "can't start %s from %s",
337+
vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE, "can't start %s from %s",
338338
operation->name, code->name);
339339
vdo_continue_completion(waiter, VDO_INVALID_ADMIN_STATE);
340340
return false;

drivers/md/dm-vdo/block-map.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static void report_cache_pressure(struct vdo_page_cache *cache)
264264
ADD_ONCE(cache->stats.cache_pressure, 1);
265265
if (cache->waiter_count > cache->page_count) {
266266
if ((cache->pressure_report % LOG_INTERVAL) == 0)
267-
uds_log_info("page cache pressure %u", cache->stats.cache_pressure);
267+
vdo_log_info("page cache pressure %u", cache->stats.cache_pressure);
268268

269269
if (++cache->pressure_report >= DISPLAY_INTERVAL)
270270
cache->pressure_report = 0;
@@ -483,7 +483,7 @@ static void complete_with_page(struct page_info *info,
483483
bool available = vdo_page_comp->writable ? is_present(info) : is_valid(info);
484484

485485
if (!available) {
486-
uds_log_error_strerror(VDO_BAD_PAGE,
486+
vdo_log_error_strerror(VDO_BAD_PAGE,
487487
"Requested cache page %llu in state %s is not %s",
488488
(unsigned long long) info->pbn,
489489
get_page_state_name(info->state),
@@ -563,7 +563,7 @@ static void set_persistent_error(struct vdo_page_cache *cache, const char *conte
563563
struct vdo *vdo = cache->vdo;
564564

565565
if ((result != VDO_READ_ONLY) && !vdo_is_read_only(vdo)) {
566-
uds_log_error_strerror(result, "VDO Page Cache persistent error: %s",
566+
vdo_log_error_strerror(result, "VDO Page Cache persistent error: %s",
567567
context);
568568
vdo_enter_read_only_mode(vdo, result);
569569
}
@@ -704,7 +704,7 @@ static void page_is_loaded(struct vdo_completion *completion)
704704
validity = vdo_validate_block_map_page(page, nonce, info->pbn);
705705
if (validity == VDO_BLOCK_MAP_PAGE_BAD) {
706706
physical_block_number_t pbn = vdo_get_block_map_page_pbn(page);
707-
int result = uds_log_error_strerror(VDO_BAD_PAGE,
707+
int result = vdo_log_error_strerror(VDO_BAD_PAGE,
708708
"Expected page %llu but got page %llu instead",
709709
(unsigned long long) info->pbn,
710710
(unsigned long long) pbn);
@@ -894,7 +894,7 @@ static void allocate_free_page(struct page_info *info)
894894

895895
if (!vdo_waitq_has_waiters(&cache->free_waiters)) {
896896
if (cache->stats.cache_pressure > 0) {
897-
uds_log_info("page cache pressure relieved");
897+
vdo_log_info("page cache pressure relieved");
898898
WRITE_ONCE(cache->stats.cache_pressure, 0);
899899
}
900900

@@ -1012,7 +1012,7 @@ static void handle_page_write_error(struct vdo_completion *completion)
10121012

10131013
/* If we're already read-only, write failures are to be expected. */
10141014
if (result != VDO_READ_ONLY) {
1015-
uds_log_ratelimit(uds_log_error,
1015+
vdo_log_ratelimit(vdo_log_error,
10161016
"failed to write block map page %llu",
10171017
(unsigned long long) info->pbn);
10181018
}
@@ -1397,7 +1397,7 @@ bool vdo_copy_valid_page(char *buffer, nonce_t nonce,
13971397
}
13981398

13991399
if (validity == VDO_BLOCK_MAP_PAGE_BAD) {
1400-
uds_log_error_strerror(VDO_BAD_PAGE,
1400+
vdo_log_error_strerror(VDO_BAD_PAGE,
14011401
"Expected page %llu but got page %llu instead",
14021402
(unsigned long long) pbn,
14031403
(unsigned long long) vdo_get_block_map_page_pbn(loaded));
@@ -1785,7 +1785,7 @@ static void continue_with_loaded_page(struct data_vio *data_vio,
17851785
vdo_unpack_block_map_entry(&page->entries[slot.block_map_slot.slot]);
17861786

17871787
if (is_invalid_tree_entry(vdo_from_data_vio(data_vio), &mapping, lock->height)) {
1788-
uds_log_error_strerror(VDO_BAD_MAPPING,
1788+
vdo_log_error_strerror(VDO_BAD_MAPPING,
17891789
"Invalid block map tree PBN: %llu with state %u for page index %u at height %u",
17901790
(unsigned long long) mapping.pbn, mapping.state,
17911791
lock->tree_slots[lock->height - 1].page_index,
@@ -2263,7 +2263,7 @@ void vdo_find_block_map_slot(struct data_vio *data_vio)
22632263
/* The page at this height has been allocated and loaded. */
22642264
mapping = vdo_unpack_block_map_entry(&page->entries[tree_slot.block_map_slot.slot]);
22652265
if (is_invalid_tree_entry(vdo_from_data_vio(data_vio), &mapping, lock->height)) {
2266-
uds_log_error_strerror(VDO_BAD_MAPPING,
2266+
vdo_log_error_strerror(VDO_BAD_MAPPING,
22672267
"Invalid block map tree PBN: %llu with state %u for page index %u at height %u",
22682268
(unsigned long long) mapping.pbn, mapping.state,
22692269
lock->tree_slots[lock->height - 1].page_index,
@@ -3140,7 +3140,7 @@ static int __must_check set_mapped_location(struct data_vio *data_vio,
31403140
* Log the corruption even if we wind up ignoring it for write VIOs, converting all cases
31413141
* to VDO_BAD_MAPPING.
31423142
*/
3143-
uds_log_error_strerror(VDO_BAD_MAPPING,
3143+
vdo_log_error_strerror(VDO_BAD_MAPPING,
31443144
"PBN %llu with state %u read from the block map was invalid",
31453145
(unsigned long long) mapped.pbn, mapped.state);
31463146

drivers/md/dm-vdo/data-vio.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -792,25 +792,25 @@ static int initialize_data_vio(struct data_vio *data_vio, struct vdo *vdo)
792792
result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "data_vio data",
793793
&data_vio->vio.data);
794794
if (result != VDO_SUCCESS)
795-
return uds_log_error_strerror(result,
795+
return vdo_log_error_strerror(result,
796796
"data_vio data allocation failure");
797797

798798
result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "compressed block",
799799
&data_vio->compression.block);
800800
if (result != VDO_SUCCESS) {
801-
return uds_log_error_strerror(result,
801+
return vdo_log_error_strerror(result,
802802
"data_vio compressed block allocation failure");
803803
}
804804

805805
result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "vio scratch",
806806
&data_vio->scratch_block);
807807
if (result != VDO_SUCCESS)
808-
return uds_log_error_strerror(result,
808+
return vdo_log_error_strerror(result,
809809
"data_vio scratch allocation failure");
810810

811811
result = vdo_create_bio(&bio);
812812
if (result != VDO_SUCCESS)
813-
return uds_log_error_strerror(result,
813+
return vdo_log_error_strerror(result,
814814
"data_vio data bio allocation failure");
815815

816816
vdo_initialize_completion(&data_vio->decrement_completion, vdo,
@@ -1025,7 +1025,7 @@ void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *com
10251025

10261026
static void dump_limiter(const char *name, struct limiter *limiter)
10271027
{
1028-
uds_log_info("%s: %u of %u busy (max %u), %s", name, limiter->busy,
1028+
vdo_log_info("%s: %u of %u busy (max %u), %s", name, limiter->busy,
10291029
limiter->limit, limiter->max_busy,
10301030
((bio_list_empty(&limiter->waiters) &&
10311031
bio_list_empty(&limiter->new_waiters)) ?
@@ -1323,7 +1323,7 @@ static void perform_cleanup_stage(struct data_vio *data_vio,
13231323
if ((data_vio->recovery_sequence_number > 0) &&
13241324
(READ_ONCE(vdo->read_only_notifier.read_only_error) == VDO_SUCCESS) &&
13251325
(data_vio->vio.completion.result != VDO_READ_ONLY))
1326-
uds_log_warning("VDO not read-only when cleaning data_vio with RJ lock");
1326+
vdo_log_warning("VDO not read-only when cleaning data_vio with RJ lock");
13271327
fallthrough;
13281328

13291329
case VIO_RELEASE_LOGICAL:
@@ -1353,7 +1353,7 @@ static void enter_read_only_mode(struct vdo_completion *completion)
13531353
if (completion->result != VDO_READ_ONLY) {
13541354
struct data_vio *data_vio = as_data_vio(completion);
13551355

1356-
uds_log_error_strerror(completion->result,
1356+
vdo_log_error_strerror(completion->result,
13571357
"Preparing to enter read-only mode: data_vio for LBN %llu (becoming mapped to %llu, previously mapped to %llu, allocated %llu) is completing with a fatal error after operation %s",
13581358
(unsigned long long) data_vio->logical.lbn,
13591359
(unsigned long long) data_vio->new_mapped.pbn,
@@ -1449,14 +1449,14 @@ int uncompress_data_vio(struct data_vio *data_vio,
14491449
&fragment_offset, &fragment_size);
14501450

14511451
if (result != VDO_SUCCESS) {
1452-
uds_log_debug("%s: compressed fragment error %d", __func__, result);
1452+
vdo_log_debug("%s: compressed fragment error %d", __func__, result);
14531453
return result;
14541454
}
14551455

14561456
size = LZ4_decompress_safe((block->data + fragment_offset), buffer,
14571457
fragment_size, VDO_BLOCK_SIZE);
14581458
if (size != VDO_BLOCK_SIZE) {
1459-
uds_log_debug("%s: lz4 error", __func__);
1459+
vdo_log_debug("%s: lz4 error", __func__);
14601460
return VDO_INVALID_FRAGMENT;
14611461
}
14621462

drivers/md/dm-vdo/dedupe.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ static bool acquire_provisional_reference(struct data_vio *agent, struct pbn_loc
12871287
if (result == VDO_SUCCESS)
12881288
return true;
12891289

1290-
uds_log_warning_strerror(result,
1290+
vdo_log_warning_strerror(result,
12911291
"Error acquiring provisional reference for dedupe candidate; aborting dedupe");
12921292
agent->is_duplicate = false;
12931293
vdo_release_physical_zone_pbn_lock(agent->duplicate.zone,
@@ -1614,7 +1614,7 @@ static bool decode_uds_advice(struct dedupe_context *context)
16141614

16151615
version = encoding->data[offset++];
16161616
if (version != UDS_ADVICE_VERSION) {
1617-
uds_log_error("invalid UDS advice version code %u", version);
1617+
vdo_log_error("invalid UDS advice version code %u", version);
16181618
return false;
16191619
}
16201620

@@ -1625,7 +1625,7 @@ static bool decode_uds_advice(struct dedupe_context *context)
16251625

16261626
/* Don't use advice that's clearly meaningless. */
16271627
if ((advice->state == VDO_MAPPING_STATE_UNMAPPED) || (advice->pbn == VDO_ZERO_BLOCK)) {
1628-
uds_log_debug("Invalid advice from deduplication server: pbn %llu, state %u. Giving up on deduplication of logical block %llu",
1628+
vdo_log_debug("Invalid advice from deduplication server: pbn %llu, state %u. Giving up on deduplication of logical block %llu",
16291629
(unsigned long long) advice->pbn, advice->state,
16301630
(unsigned long long) data_vio->logical.lbn);
16311631
atomic64_inc(&vdo->stats.invalid_advice_pbn_count);
@@ -1634,7 +1634,7 @@ static bool decode_uds_advice(struct dedupe_context *context)
16341634

16351635
result = vdo_get_physical_zone(vdo, advice->pbn, &advice->zone);
16361636
if ((result != VDO_SUCCESS) || (advice->zone == NULL)) {
1637-
uds_log_debug("Invalid physical block number from deduplication server: %llu, giving up on deduplication of logical block %llu",
1637+
vdo_log_debug("Invalid physical block number from deduplication server: %llu, giving up on deduplication of logical block %llu",
16381638
(unsigned long long) advice->pbn,
16391639
(unsigned long long) data_vio->logical.lbn);
16401640
atomic64_inc(&vdo->stats.invalid_advice_pbn_count);
@@ -2053,7 +2053,7 @@ static void close_index(struct hash_zones *zones)
20532053
result = uds_close_index(zones->index_session);
20542054

20552055
if (result != UDS_SUCCESS)
2056-
uds_log_error_strerror(result, "Error closing index");
2056+
vdo_log_error_strerror(result, "Error closing index");
20572057
spin_lock(&zones->lock);
20582058
zones->index_state = IS_CLOSED;
20592059
zones->error_flag |= result != UDS_SUCCESS;
@@ -2080,7 +2080,7 @@ static void open_index(struct hash_zones *zones)
20802080
result = uds_open_index(create_flag ? UDS_CREATE : UDS_LOAD,
20812081
&zones->parameters, zones->index_session);
20822082
if (result != UDS_SUCCESS)
2083-
uds_log_error_strerror(result, "Error opening index");
2083+
vdo_log_error_strerror(result, "Error opening index");
20842084

20852085
spin_lock(&zones->lock);
20862086
if (!create_flag) {
@@ -2104,7 +2104,7 @@ static void open_index(struct hash_zones *zones)
21042104
zones->index_target = IS_CLOSED;
21052105
zones->error_flag = true;
21062106
spin_unlock(&zones->lock);
2107-
uds_log_info("Setting UDS index target state to error");
2107+
vdo_log_info("Setting UDS index target state to error");
21082108
spin_lock(&zones->lock);
21092109
}
21102110
/*
@@ -2160,7 +2160,7 @@ static void report_dedupe_timeouts(struct hash_zones *zones, unsigned int timeou
21602160
u64 unreported = atomic64_read(&zones->timeouts);
21612161

21622162
unreported -= zones->reported_timeouts;
2163-
uds_log_debug("UDS index timeout on %llu requests",
2163+
vdo_log_debug("UDS index timeout on %llu requests",
21642164
(unsigned long long) unreported);
21652165
zones->reported_timeouts += unreported;
21662166
}
@@ -2207,7 +2207,7 @@ static int initialize_index(struct vdo *vdo, struct hash_zones *zones)
22072207
1, NULL);
22082208
if (result != VDO_SUCCESS) {
22092209
uds_destroy_index_session(vdo_forget(zones->index_session));
2210-
uds_log_error("UDS index queue initialization failed (%d)", result);
2210+
vdo_log_error("UDS index queue initialization failed (%d)", result);
22112211
return result;
22122212
}
22132213

@@ -2502,7 +2502,7 @@ static void initiate_suspend_index(struct admin_state *state)
25022502

25032503
result = uds_suspend_index_session(zones->index_session, save);
25042504
if (result != UDS_SUCCESS)
2505-
uds_log_error_strerror(result, "Error suspending dedupe index");
2505+
vdo_log_error_strerror(result, "Error suspending dedupe index");
25062506
}
25072507

25082508
vdo_finish_draining(state);
@@ -2585,7 +2585,7 @@ static void resume_index(void *context, struct vdo_completion *parent)
25852585
zones->parameters.bdev = config->owned_device->bdev;
25862586
result = uds_resume_index_session(zones->index_session, zones->parameters.bdev);
25872587
if (result != UDS_SUCCESS)
2588-
uds_log_error_strerror(result, "Error resuming dedupe index");
2588+
vdo_log_error_strerror(result, "Error resuming dedupe index");
25892589

25902590
spin_lock(&zones->lock);
25912591
vdo_resume_if_quiescent(&zones->state);
@@ -2665,7 +2665,7 @@ static void get_index_statistics(struct hash_zones *zones,
26652665

26662666
result = uds_get_index_session_stats(zones->index_session, &index_stats);
26672667
if (result != UDS_SUCCESS) {
2668-
uds_log_error_strerror(result, "Error reading index stats");
2668+
vdo_log_error_strerror(result, "Error reading index stats");
26692669
return;
26702670
}
26712671

@@ -2750,7 +2750,7 @@ static void dump_hash_lock(const struct hash_lock *lock)
27502750
* unambiguous. 'U' indicates a lock not registered in the map.
27512751
*/
27522752
state = get_hash_lock_state_name(lock->state);
2753-
uds_log_info(" hl %px: %3.3s %c%llu/%u rc=%u wc=%zu agt=%px",
2753+
vdo_log_info(" hl %px: %3.3s %c%llu/%u rc=%u wc=%zu agt=%px",
27542754
lock, state, (lock->registered ? 'D' : 'U'),
27552755
(unsigned long long) lock->duplicate.pbn,
27562756
lock->duplicate.state, lock->reference_count,
@@ -2784,11 +2784,11 @@ static void dump_hash_zone(const struct hash_zone *zone)
27842784
data_vio_count_t i;
27852785

27862786
if (zone->hash_lock_map == NULL) {
2787-
uds_log_info("struct hash_zone %u: NULL map", zone->zone_number);
2787+
vdo_log_info("struct hash_zone %u: NULL map", zone->zone_number);
27882788
return;
27892789
}
27902790

2791-
uds_log_info("struct hash_zone %u: mapSize=%zu",
2791+
vdo_log_info("struct hash_zone %u: mapSize=%zu",
27922792
zone->zone_number, vdo_int_map_size(zone->hash_lock_map));
27932793
for (i = 0; i < LOCK_POOL_CAPACITY; i++)
27942794
dump_hash_lock(&zone->lock_array[i]);
@@ -2808,9 +2808,9 @@ void vdo_dump_hash_zones(struct hash_zones *zones)
28082808
target = (zones->changing ? index_state_to_string(zones, zones->index_target) : NULL);
28092809
spin_unlock(&zones->lock);
28102810

2811-
uds_log_info("UDS index: state: %s", state);
2811+
vdo_log_info("UDS index: state: %s", state);
28122812
if (target != NULL)
2813-
uds_log_info("UDS index: changing to state: %s", target);
2813+
vdo_log_info("UDS index: changing to state: %s", target);
28142814

28152815
for (zone = 0; zone < zones->zone_count; zone++)
28162816
dump_hash_zone(&zones->zones[zone]);
@@ -2957,7 +2957,7 @@ static void set_target_state(struct hash_zones *zones, enum index_state target,
29572957
spin_unlock(&zones->lock);
29582958

29592959
if (old_state != new_state)
2960-
uds_log_info("Setting UDS index target state to %s", new_state);
2960+
vdo_log_info("Setting UDS index target state to %s", new_state);
29612961
}
29622962

29632963
const char *vdo_get_dedupe_index_state_name(struct hash_zones *zones)

0 commit comments

Comments
 (0)