|
From: Steve D. <ste...@us...> - 2009-01-16 16:01:55
|
Update of /cvsroot/evms/evms2/engine/plugins/lvm2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20086 Modified Files: containers.c lvm2.c metadata.c options.c regions.c Log Message: Cleanup warning messages. Added bonus: My editor cleans up trailing whitespace. Index: metadata.c =================================================================== RCS file: /cvsroot/evms/evms2/engine/plugins/lvm2/metadata.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- metadata.c 20 Aug 2008 23:56:39 -0000 1.19 +++ metadata.c 16 Jan 2009 16:01:52 -0000 1.20 @@ -579,7 +579,8 @@ { label_header_t *label; u_int32_t crc; - int sector, rc; + lsn_t sector; + int rc; LOG_ENTRY(); @@ -600,7 +601,7 @@ rc = memcmp(label->id, LVM2_LABEL_ID, sizeof(label->id)); if (rc) { LOG_DEBUG("No LVM2 label found on object %s, " - "sector %u\n", object->name, sector); + "sector %"PRIu64"\n", object->name, sector); rc = EINVAL; continue; } @@ -612,7 +613,7 @@ EVMS_VSECTOR_SIZE - ((void*)&label->offset - (void*)label)); if (DISK_TO_CPU32(label->crc) != crc) { - LOG_WARNING("Found LVM2 label on object %s, sector %u " + LOG_WARNING("Found LVM2 label on object %s, sector %"PRIu64" " "with wrong CRC.\n", object->name, sector); LOG_WARNING("Found CRC %u, expecting %u\n", crc, DISK_TO_CPU32(label->crc)); @@ -626,7 +627,7 @@ if (label->sector != sector) { LOG_WARNING("Found LVM2 label on object %s at wrong " "sector.\n", object->name); - LOG_WARNING("Found at sector %u, expected at " + LOG_WARNING("Found at sector %"PRIu64", expected at " "%"PRIu64"\n", sector, label->sector); rc = EINVAL; continue; @@ -635,14 +636,14 @@ /* Verify the label type. */ rc = memcmp(label->type, LVM2_LABEL_TYPE, sizeof(label->type)); if (rc) { - LOG_WARNING("Found LVM2 label on object %s, sector %u " + LOG_WARNING("Found LVM2 label on object %s, sector %"PRIu64" " "with wrong type.\n", object->name, sector); rc = EINVAL; continue; } /* Found a valid label. */ - LOG_DETAILS("Found LVM2 label on object %s, sector %u.\n", + LOG_DETAILS("Found LVM2 label on object %s, sector %"PRIu64".\n", object->name, sector); *pv_label = label; break; Index: lvm2.c =================================================================== RCS file: /cvsroot/evms/evms2/engine/plugins/lvm2/lvm2.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- lvm2.c 16 Jun 2005 16:53:49 -0000 1.34 +++ lvm2.c 16 Jan 2009 16:01:52 -0000 1.35 @@ -388,7 +388,7 @@ * its producing container and remove the region from any PV's parent-objects * list. **/ -static int lvm2_delete(storage_object_t *region, list_anchor_t child_objects) +static int lvm2_delete(storage_object_t *region, list_anchor_t UNUSED(child_objects)) { storage_container_t *container = region->producing_container; int rc; @@ -426,7 +426,7 @@ **/ static int lvm2_expand(storage_object_t *region, storage_object_t *expand_object, - list_anchor_t input_objects, + list_anchor_t UNUSED(input_objects), option_array_t *options) { storage_container_t *container = region->producing_container; @@ -522,7 +522,7 @@ **/ static int lvm2_shrink(storage_object_t *region, storage_object_t *shrink_object, - list_anchor_t input_objects, + list_anchor_t UNUSED(input_objects), option_array_t *options) { storage_container_t *container = region->producing_container; @@ -598,7 +598,7 @@ * * All LVM2 metadata commits are done in lvm2_commit_container_changes. **/ -static int lvm2_commit_changes(storage_object_t *region, commit_phase_t phase) +static int lvm2_commit_changes(storage_object_t *region, commit_phase_t UNUSED(phase)) { LOG_ENTRY(); region->flags &= ~(SOFLAG_DIRTY | SOFLAG_NEW); @@ -846,7 +846,7 @@ * option-descriptor based on these selected-objects. **/ static int lvm2_set_objects(task_context_t *context, - list_anchor_t declined_objects, /* of type declined_handle_t */ + list_anchor_t UNUSED(declined_objects), /* of type declined_handle_t */ task_effect_t *effect) { int rc; @@ -1068,7 +1068,7 @@ extended_info_array_t *info = NULL; char buffer[50] = {0}; int i = 0, rc = 0; - + LOG_ENTRY(); if (info_name) { @@ -1327,7 +1327,7 @@ **/ static int lvm2_function(storage_object_t *region, task_action_t action, - list_anchor_t objects, + list_anchor_t UNUSED(objects), option_array_t *options) { int rc; @@ -1420,7 +1420,7 @@ "deleted.\n", container->name, count-1); rc = EBUSY; } - + LOG_EXIT_INT(rc); return rc; } @@ -1544,9 +1544,9 @@ * * When expanding a PV, LVM2 doesn't care how much the PV expands by. **/ -static int lvm2_can_expand_container_by(storage_container_t *container, - storage_object_t *consumed_object, - sector_count_t *delta_size) +static int lvm2_can_expand_container_by(storage_container_t * UNUSED(container), + storage_object_t * UNUSED(consumed_object), + sector_count_t * UNUSED(delta_size)) { LOG_ENTRY(); LOG_EXIT_INT(0); @@ -1984,8 +1984,8 @@ * * Return an array of plugin functions that you support for this container. **/ -static int lvm2_get_container_functions(storage_container_t *container, - function_info_array_t **actions) +static int lvm2_get_container_functions(storage_container_t * UNUSED(container), + function_info_array_t ** UNUSED(actions)) { LOG_ENTRY(); LOG_EXIT_INT(ENOSYS); @@ -1997,10 +1997,10 @@ * * Execute the plug-in function on the container. **/ -static int lvm2_container_function(storage_container_t *container, - task_action_t action, - list_anchor_t objects, - option_array_t *options) +static int lvm2_container_function(storage_container_t * UNUSED(container), + task_action_t UNUSED(action), + list_anchor_t UNUSED(objects), + option_array_t * UNUSED(options)) { LOG_ENTRY(); LOG_EXIT_INT(ENOSYS); Index: options.c =================================================================== RCS file: /cvsroot/evms/evms2/engine/plugins/lvm2/options.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- options.c 19 May 2005 16:59:09 -0000 1.24 +++ options.c 16 Jan 2009 16:01:52 -0000 1.25 @@ -415,7 +415,7 @@ * selected container. **/ int expand_container_set_objects(task_context_t *context, - task_effect_t *effect) + task_effect_t * UNUSED(effect)) { container_data_t *c_data = context->container->private_data; storage_object_t *object; @@ -500,7 +500,7 @@ * from the selected container. **/ int shrink_container_set_objects(task_context_t *context, - task_effect_t *effect) + task_effect_t * UNUSED(effect)) { storage_container_t *container = context->container; storage_object_t *object; @@ -1778,7 +1778,7 @@ int shrink_region_set_option(task_context_t *context, u_int32_t index, value_t *value, - task_effect_t *effect) + task_effect_t * UNUSED(effect)) { option_desc_array_t *od = context->option_descriptors; int rc = 0; @@ -1950,7 +1950,7 @@ int set_region_info_set_option(task_context_t *context, u_int32_t index, value_t *value, - task_effect_t *effect) + task_effect_t * UNUSED(effect)) { storage_container_t *container = context->object->producing_container; option_desc_array_t *od = context->option_descriptors; @@ -1984,7 +1984,7 @@ * * Parse the option-values from the option-array. **/ -void set_region_info_parse_options(storage_object_t *region, +void set_region_info_parse_options(storage_object_t * UNUSED(region), option_array_t *options, char **lv_name) { @@ -2090,7 +2090,7 @@ int set_container_info_set_option(task_context_t *context, u_int32_t index, value_t *value, - task_effect_t *effect) + task_effect_t * UNUSED(effect)) { option_desc_array_t *od = context->option_descriptors; int rc; @@ -2123,7 +2123,7 @@ * * Parse the option-values from the option-array. **/ -void set_container_info_parse_options(storage_container_t *container, +void set_container_info_parse_options(storage_container_t * UNUSED(container), option_array_t *options, char **vg_name) { @@ -2819,7 +2819,8 @@ option_desc_array_t *od = context->option_descriptors; storage_object_t *object, *region = context->object; region_mapping_t *r_map; - int i, rc; + uint i; + int rc; LOG_ENTRY(); @@ -3031,7 +3032,7 @@ /* Default values. */ *r_map_index = 0; *stripe_index = 0; - *object_name = NULL; + *object_name = NULL; *extent_index = 0; LOG_ENTRY(); Index: regions.c =================================================================== RCS file: /cvsroot/evms/evms2/engine/plugins/lvm2/regions.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- regions.c 22 Feb 2006 20:21:25 -0000 1.22 +++ regions.c 16 Jan 2009 16:01:52 -0000 1.23 @@ -50,7 +50,7 @@ dm_target_stripe_t *stripe = NULL; dm_device_t *linear; list_element_t iter; - int i; + u_int64_t i; LOG_ENTRY(); LOG_DEBUG("Building target list for region %s.\n", region->name); @@ -499,7 +499,7 @@ r_map->r_data = r_data; EngFncs->insert_thing(r_data->mappings, r_map, flag, iter); increment_region_size(r_data->region, r_map); - + LOG_EXIT_VOID(); } @@ -1809,7 +1809,8 @@ u_int64_t *object_extents, i = 0; storage_object_t *object; list_element_t iter; - int j, rc = 0; + u_int32_t j; + int rc = 0; LOG_ENTRY(); @@ -2387,7 +2388,7 @@ rc = ENOMEM; goto out; } - + /* Set up the LE-maps for the new mappings. */ for (i = 0; i < r_map->stripe_count; i++) { pv_indexes[i] = r_map->le_maps[i].map[0].pe->pv_data->pv_index; Index: containers.c =================================================================== RCS file: /cvsroot/evms/evms2/engine/plugins/lvm2/containers.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- containers.c 7 Dec 2004 04:25:19 -0000 1.18 +++ containers.c 16 Jan 2009 16:01:52 -0000 1.19 @@ -443,7 +443,8 @@ { container_data_t *c_data = container->private_data; key_value_t *node; - int seqno, rc = 0; + u_int32_t seqno; + int rc = 0; LOG_ENTRY(); @@ -967,7 +968,7 @@ **/ int add_object(storage_object_t *object, storage_container_t *container, - option_array_t *options) + option_array_t * UNUSED(options)) { storage_object_t *this_object; list_element_t iter; @@ -1234,7 +1235,7 @@ /* Calculate the number of extents to remove after the object shrunk. */ new_size = consumed_object->size; delta_size = old_size - new_size; - removed_extents = (delta_size / c_data->pe_size) + + removed_extents = (delta_size / c_data->pe_size) + ((delta_size % c_data->pe_size) ? 1 : 0); /* Save the old PE map and allocate a new PE map. */ |