Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VDO-5698] Rename logger and string-utils functions to use vdo_ namespace #54

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions drivers/md/dm-vdo/admin-state.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ static int __must_check begin_operation(struct admin_state *state,
const struct admin_state_code *next_state = get_next_state(state, operation);

if (next_state == NULL) {
result = uds_log_error_strerror(VDO_INVALID_ADMIN_STATE,
result = vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE,
"Can't start %s from %s",
operation->name,
vdo_get_admin_state_code(state)->name);
} else if (state->waiter != NULL) {
result = uds_log_error_strerror(VDO_COMPONENT_BUSY,
result = vdo_log_error_strerror(VDO_COMPONENT_BUSY,
"Can't start %s with extant waiter",
operation->name);
} else {
Expand Down Expand Up @@ -291,7 +291,7 @@ static bool check_code(bool valid, const struct admin_state_code *code, const ch
if (valid)
return true;

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

if (!code->normal) {
uds_log_error_strerror(VDO_INVALID_ADMIN_STATE, "can't start %s from %s",
vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE, "can't start %s from %s",
operation->name, code->name);
vdo_continue_completion(waiter, VDO_INVALID_ADMIN_STATE);
return false;
Expand Down
20 changes: 10 additions & 10 deletions drivers/md/dm-vdo/block-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static void report_cache_pressure(struct vdo_page_cache *cache)
ADD_ONCE(cache->stats.cache_pressure, 1);
if (cache->waiter_count > cache->page_count) {
if ((cache->pressure_report % LOG_INTERVAL) == 0)
uds_log_info("page cache pressure %u", cache->stats.cache_pressure);
vdo_log_info("page cache pressure %u", cache->stats.cache_pressure);

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

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

if ((result != VDO_READ_ONLY) && !vdo_is_read_only(vdo)) {
uds_log_error_strerror(result, "VDO Page Cache persistent error: %s",
vdo_log_error_strerror(result, "VDO Page Cache persistent error: %s",
context);
vdo_enter_read_only_mode(vdo, result);
}
Expand Down Expand Up @@ -704,7 +704,7 @@ static void page_is_loaded(struct vdo_completion *completion)
validity = vdo_validate_block_map_page(page, nonce, info->pbn);
if (validity == VDO_BLOCK_MAP_PAGE_BAD) {
physical_block_number_t pbn = vdo_get_block_map_page_pbn(page);
int result = uds_log_error_strerror(VDO_BAD_PAGE,
int result = vdo_log_error_strerror(VDO_BAD_PAGE,
"Expected page %llu but got page %llu instead",
(unsigned long long) info->pbn,
(unsigned long long) pbn);
Expand Down Expand Up @@ -894,7 +894,7 @@ static void allocate_free_page(struct page_info *info)

if (!vdo_waitq_has_waiters(&cache->free_waiters)) {
if (cache->stats.cache_pressure > 0) {
uds_log_info("page cache pressure relieved");
vdo_log_info("page cache pressure relieved");
WRITE_ONCE(cache->stats.cache_pressure, 0);
}

Expand Down Expand Up @@ -1012,7 +1012,7 @@ static void handle_page_write_error(struct vdo_completion *completion)

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

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

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

Expand Down
18 changes: 9 additions & 9 deletions drivers/md/dm-vdo/data-vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,25 +792,25 @@ static int initialize_data_vio(struct data_vio *data_vio, struct vdo *vdo)
result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "data_vio data",
&data_vio->vio.data);
if (result != VDO_SUCCESS)
return uds_log_error_strerror(result,
return vdo_log_error_strerror(result,
"data_vio data allocation failure");

result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "compressed block",
&data_vio->compression.block);
if (result != VDO_SUCCESS) {
return uds_log_error_strerror(result,
return vdo_log_error_strerror(result,
"data_vio compressed block allocation failure");
}

result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "vio scratch",
&data_vio->scratch_block);
if (result != VDO_SUCCESS)
return uds_log_error_strerror(result,
return vdo_log_error_strerror(result,
"data_vio scratch allocation failure");

result = vdo_create_bio(&bio);
if (result != VDO_SUCCESS)
return uds_log_error_strerror(result,
return vdo_log_error_strerror(result,
"data_vio data bio allocation failure");

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

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

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

uds_log_error_strerror(completion->result,
vdo_log_error_strerror(completion->result,
"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",
(unsigned long long) data_vio->logical.lbn,
(unsigned long long) data_vio->new_mapped.pbn,
Expand Down Expand Up @@ -1449,14 +1449,14 @@ int uncompress_data_vio(struct data_vio *data_vio,
&fragment_offset, &fragment_size);

if (result != VDO_SUCCESS) {
uds_log_debug("%s: compressed fragment error %d", __func__, result);
vdo_log_debug("%s: compressed fragment error %d", __func__, result);
return result;
}

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

Expand Down
36 changes: 18 additions & 18 deletions drivers/md/dm-vdo/dedupe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ static bool acquire_provisional_reference(struct data_vio *agent, struct pbn_loc
if (result == VDO_SUCCESS)
return true;

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

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

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

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

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

if (result != UDS_SUCCESS)
uds_log_error_strerror(result, "Error closing index");
vdo_log_error_strerror(result, "Error closing index");
spin_lock(&zones->lock);
zones->index_state = IS_CLOSED;
zones->error_flag |= result != UDS_SUCCESS;
Expand All @@ -2080,7 +2080,7 @@ static void open_index(struct hash_zones *zones)
result = uds_open_index(create_flag ? UDS_CREATE : UDS_LOAD,
&zones->parameters, zones->index_session);
if (result != UDS_SUCCESS)
uds_log_error_strerror(result, "Error opening index");
vdo_log_error_strerror(result, "Error opening index");

spin_lock(&zones->lock);
if (!create_flag) {
Expand All @@ -2104,7 +2104,7 @@ static void open_index(struct hash_zones *zones)
zones->index_target = IS_CLOSED;
zones->error_flag = true;
spin_unlock(&zones->lock);
uds_log_info("Setting UDS index target state to error");
vdo_log_info("Setting UDS index target state to error");
spin_lock(&zones->lock);
}
/*
Expand Down Expand Up @@ -2160,7 +2160,7 @@ static void report_dedupe_timeouts(struct hash_zones *zones, unsigned int timeou
u64 unreported = atomic64_read(&zones->timeouts);

unreported -= zones->reported_timeouts;
uds_log_debug("UDS index timeout on %llu requests",
vdo_log_debug("UDS index timeout on %llu requests",
(unsigned long long) unreported);
zones->reported_timeouts += unreported;
}
Expand Down Expand Up @@ -2207,7 +2207,7 @@ static int initialize_index(struct vdo *vdo, struct hash_zones *zones)
1, NULL);
if (result != VDO_SUCCESS) {
uds_destroy_index_session(vdo_forget(zones->index_session));
uds_log_error("UDS index queue initialization failed (%d)", result);
vdo_log_error("UDS index queue initialization failed (%d)", result);
return result;
}

Expand Down Expand Up @@ -2502,7 +2502,7 @@ static void initiate_suspend_index(struct admin_state *state)

result = uds_suspend_index_session(zones->index_session, save);
if (result != UDS_SUCCESS)
uds_log_error_strerror(result, "Error suspending dedupe index");
vdo_log_error_strerror(result, "Error suspending dedupe index");
}

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

spin_lock(&zones->lock);
vdo_resume_if_quiescent(&zones->state);
Expand Down Expand Up @@ -2665,7 +2665,7 @@ static void get_index_statistics(struct hash_zones *zones,

result = uds_get_index_session_stats(zones->index_session, &index_stats);
if (result != UDS_SUCCESS) {
uds_log_error_strerror(result, "Error reading index stats");
vdo_log_error_strerror(result, "Error reading index stats");
return;
}

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

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

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

uds_log_info("UDS index: state: %s", state);
vdo_log_info("UDS index: state: %s", state);
if (target != NULL)
uds_log_info("UDS index: changing to state: %s", target);
vdo_log_info("UDS index: changing to state: %s", target);

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

if (old_state != new_state)
uds_log_info("Setting UDS index target state to %s", new_state);
vdo_log_info("Setting UDS index target state to %s", new_state);
}

const char *vdo_get_dedupe_index_state_name(struct hash_zones *zones)
Expand Down
Loading
Loading