Lines Matching refs:result
268 int result; in split_string() local
276 result = vdo_allocate(substring_count + 1, char *, "string-splitting array", in split_string()
278 if (result != VDO_SUCCESS) in split_string()
279 return result; in split_string()
285 result = vdo_allocate(length + 1, char, "split string", in split_string()
287 if (result != VDO_SUCCESS) { in split_string()
289 return result; in split_string()
306 result = vdo_allocate(length + 1, char, "split string", in split_string()
308 if (result != VDO_SUCCESS) { in split_string()
310 return result; in split_string()
329 int result; in join_strings() local
335 result = vdo_allocate(string_length, char, __func__, &output); in join_strings()
336 if (result != VDO_SUCCESS) in join_strings()
337 return result; in join_strings()
479 int result; in parse_one_thread_config_spec() local
481 result = split_string(spec, '=', &fields); in parse_one_thread_config_spec()
482 if (result != VDO_SUCCESS) in parse_one_thread_config_spec()
483 return result; in parse_one_thread_config_spec()
492 result = kstrtouint(fields[1], 10, &count); in parse_one_thread_config_spec()
493 if (result) { in parse_one_thread_config_spec()
497 return result; in parse_one_thread_config_spec()
500 result = process_one_thread_config_spec(fields[0], count, config); in parse_one_thread_config_spec()
502 return result; in parse_one_thread_config_spec()
528 int result = VDO_SUCCESS; in parse_thread_config_string() local
534 result = split_string(string, ',', &specs); in parse_thread_config_string()
535 if (result != VDO_SUCCESS) in parse_thread_config_string()
536 return result; in parse_thread_config_string()
539 result = parse_one_thread_config_spec(specs[i], config); in parse_thread_config_string()
540 if (result != VDO_SUCCESS) in parse_thread_config_string()
545 return result; in parse_thread_config_string()
595 int result; in parse_one_key_value_pair() local
604 result = kstrtouint(value, 10, &count); in parse_one_key_value_pair()
605 if (result) { in parse_one_key_value_pair()
608 return result; in parse_one_key_value_pair()
630 int result = VDO_SUCCESS; in parse_key_value_pairs() local
633 result = parse_one_key_value_pair(argv[0], argv[1], config); in parse_key_value_pairs()
634 if (result != VDO_SUCCESS) in parse_key_value_pairs()
641 return result; in parse_key_value_pairs()
663 int result = VDO_SUCCESS; in parse_optional_arguments() local
666 result = parse_thread_config_string(arg_set->argv[0], in parse_optional_arguments()
668 if (result != VDO_SUCCESS) { in parse_optional_arguments()
677 result = parse_key_value_pairs(arg_set->argc, arg_set->argv, config); in parse_optional_arguments()
678 if (result != VDO_SUCCESS) { in parse_optional_arguments()
683 return result; in parse_optional_arguments()
716 int result; in parse_device_config() local
729 result = vdo_allocate(1, struct device_config, "device_config", &config); in parse_device_config()
730 if (result != VDO_SUCCESS) { in parse_device_config()
741 result = join_strings(argv, argc, ' ', &config->original_string); in parse_device_config()
742 if (result != VDO_SUCCESS) { in parse_device_config()
765 result = get_version_number(argc, argv, error_ptr, &config->version); in parse_device_config()
766 if (result != VDO_SUCCESS) { in parse_device_config()
769 return result; in parse_device_config()
775 result = vdo_duplicate_string(dm_shift_arg(&arg_set), "parent device name", in parse_device_config()
777 if (result != VDO_SUCCESS) { in parse_device_config()
785 result = kstrtoull(dm_shift_arg(&arg_set), 10, &config->physical_blocks); in parse_device_config()
786 if (result != VDO_SUCCESS) { in parse_device_config()
794 result = parse_bool(dm_shift_arg(&arg_set), "512", "4096", &enable_512e); in parse_device_config()
795 if (result != VDO_SUCCESS) { in parse_device_config()
806 result = kstrtouint(dm_shift_arg(&arg_set), 10, &config->cache_size); in parse_device_config()
807 if (result != VDO_SUCCESS) { in parse_device_config()
814 result = kstrtouint(dm_shift_arg(&arg_set), 10, &config->block_map_maximum_age); in parse_device_config()
815 if (result != VDO_SUCCESS) { in parse_device_config()
843 result = parse_optional_arguments(&arg_set, error_ptr, config); in parse_device_config()
844 if (result != VDO_SUCCESS) { in parse_device_config()
847 return result; in parse_device_config()
871 result = dm_get_device(ti, config->parent_device_name, in parse_device_config()
873 if (result != 0) { in parse_device_config()
875 config->parent_device_name, result); in parse_device_config()
887 return result; in parse_device_config()
974 unsigned int status_flags, char *result, unsigned int maxlen) in vdo_status() argument
1007 *result = '\0'; in vdo_status()
1048 int result; in process_vdo_message() local
1077 result = process_vdo_message_locked(vdo, argc, argv); in process_vdo_message()
1082 return result; in process_vdo_message()
1090 int result; in vdo_message() local
1107 result = 1; in vdo_message()
1110 result = 1; in vdo_message()
1112 result = vdo_status_to_errno(process_vdo_message(vdo, argc, argv)); in vdo_message()
1117 return result; in vdo_message()
1212 int result; in perform_admin_operation() local
1235 result = admin->completion.result; in perform_admin_operation()
1239 return result; in perform_admin_operation()
1258 vdo_finish_operation(&admin->state, completion->result); in finish_operation_callback()
1275 int result; in decode_from_super_block() local
1277 result = vdo_decode_component_states(vdo->super_block.buffer, &vdo->geometry, in decode_from_super_block()
1279 if (result != VDO_SUCCESS) in decode_from_super_block()
1280 return result; in decode_from_super_block()
1296 result = vdo_validate_component_states(&vdo->states, vdo->geometry.nonce, in decode_from_super_block()
1299 if (result != VDO_SUCCESS) in decode_from_super_block()
1300 return result; in decode_from_super_block()
1321 int result; in decode_vdo() local
1323 result = decode_from_super_block(vdo); in decode_vdo()
1324 if (result != VDO_SUCCESS) { in decode_vdo()
1326 return result; in decode_vdo()
1344 result = vdo_enable_read_only_entry(vdo); in decode_vdo()
1345 if (result != VDO_SUCCESS) in decode_vdo()
1346 return result; in decode_vdo()
1350 result = vdo_decode_recovery_journal(vdo->states.recovery_journal, in decode_vdo()
1355 if (result != VDO_SUCCESS) in decode_vdo()
1356 return result; in decode_vdo()
1359 result = vdo_decode_slab_depot(vdo->states.slab_depot, vdo, partition, in decode_vdo()
1361 if (result != VDO_SUCCESS) in decode_vdo()
1362 return result; in decode_vdo()
1364 result = vdo_decode_block_map(vdo->states.block_map, in decode_vdo()
1369 if (result != VDO_SUCCESS) in decode_vdo()
1370 return result; in decode_vdo()
1372 result = vdo_make_physical_zones(vdo, &vdo->physical_zones); in decode_vdo()
1373 if (result != VDO_SUCCESS) in decode_vdo()
1374 return result; in decode_vdo()
1377 result = vdo_make_logical_zones(vdo, &vdo->logical_zones); in decode_vdo()
1378 if (result != VDO_SUCCESS) in decode_vdo()
1379 return result; in decode_vdo()
1391 int result; in pre_load_callback() local
1397 result = vdo_start_operation(&vdo->admin.state, in pre_load_callback()
1399 if (result != VDO_SUCCESS) { in pre_load_callback()
1400 vdo_continue_completion(completion, result); in pre_load_callback()
1451 int result; in vdo_initialize() local
1474 result = vdo_make(instance, config, &ti->error, &vdo); in vdo_initialize()
1475 if (result != VDO_SUCCESS) { in vdo_initialize()
1477 result, ti->error); in vdo_initialize()
1479 return result; in vdo_initialize()
1482 result = perform_admin_operation(vdo, PRE_LOAD_PHASE_START, pre_load_callback, in vdo_initialize()
1484 if (result != VDO_SUCCESS) { in vdo_initialize()
1485 ti->error = ((result == VDO_INVALID_ADMIN_STATE) ? in vdo_initialize()
1489 result, ti->error); in vdo_initialize()
1491 return result; in vdo_initialize()
1535 int result; in grow_bit_array() local
1537 result = vdo_reallocate_memory(instances.words, in grow_bit_array()
1541 if (result != VDO_SUCCESS) in grow_bit_array()
1542 return result; in grow_bit_array()
1560 int result; in allocate_instance() local
1564 result = grow_bit_array(); in allocate_instance()
1565 if (result != VDO_SUCCESS) in allocate_instance()
1566 return result; in allocate_instance()
1578 result = VDO_ASSERT(instance < instances.bit_count, in allocate_instance()
1580 if (result != VDO_SUCCESS) in allocate_instance()
1581 return result; in allocate_instance()
1594 int result; in construct_new_vdo_registered() local
1597 result = parse_device_config(argc, argv, ti, &config); in construct_new_vdo_registered()
1598 if (result != VDO_SUCCESS) { in construct_new_vdo_registered()
1599 vdo_log_error_strerror(result, "parsing failed: %s", ti->error); in construct_new_vdo_registered()
1605 result = vdo_initialize(ti, instance, config); in construct_new_vdo_registered()
1606 if (result != VDO_SUCCESS) { in construct_new_vdo_registered()
1609 return vdo_status_to_errno(result); in construct_new_vdo_registered()
1617 int result; in construct_new_vdo() local
1622 result = allocate_instance(&instance); in construct_new_vdo()
1624 if (result != VDO_SUCCESS) in construct_new_vdo()
1628 result = construct_new_vdo_registered(ti, argc, argv, instance); in construct_new_vdo()
1630 return result; in construct_new_vdo()
1669 int result; in grow_layout() local
1681 result = PTR_ERR(vdo->partition_copier); in grow_layout()
1683 return result; in grow_layout()
1694 result = vdo_initialize_layout(new_size, vdo->layout.start, in grow_layout()
1702 if (result != VDO_SUCCESS) { in grow_layout()
1704 return result; in grow_layout()
1725 int result; in prepare_to_grow_physical() local
1732 result = perform_admin_operation(vdo, PREPARE_GROW_PHYSICAL_PHASE_START, in prepare_to_grow_physical()
1736 if (result != VDO_SUCCESS) in prepare_to_grow_physical()
1737 return result; in prepare_to_grow_physical()
1739 result = grow_layout(vdo, current_physical_blocks, new_physical_blocks); in prepare_to_grow_physical()
1740 if (result != VDO_SUCCESS) in prepare_to_grow_physical()
1741 return result; in prepare_to_grow_physical()
1743 result = vdo_prepare_to_grow_slab_depot(vdo->depot, in prepare_to_grow_physical()
1746 if (result != VDO_SUCCESS) { in prepare_to_grow_physical()
1748 return result; in prepare_to_grow_physical()
1817 int result; in prepare_to_modify() local
1820 result = validate_new_device_config(config, vdo->device_config, may_grow, in prepare_to_modify()
1822 if (result != VDO_SUCCESS) in prepare_to_modify()
1833 result = vdo_prepare_to_grow_block_map(vdo->block_map, in prepare_to_modify()
1835 if (result != VDO_SUCCESS) { in prepare_to_modify()
1837 return result; in prepare_to_modify()
1844 result = prepare_to_grow_physical(vdo, config->physical_blocks); in prepare_to_modify()
1845 if (result != VDO_SUCCESS) { in prepare_to_modify()
1846 if (result == VDO_PARAMETER_MISMATCH) { in prepare_to_modify()
1851 result = -EINVAL; in prepare_to_modify()
1854 if (result == VDO_TOO_MANY_SLABS) in prepare_to_modify()
1859 return result; in prepare_to_modify()
1877 int result; in update_existing_vdo() local
1880 result = parse_device_config(argc, argv, ti, &config); in update_existing_vdo()
1881 if (result != VDO_SUCCESS) in update_existing_vdo()
1885 result = prepare_to_modify(ti, config, vdo); in update_existing_vdo()
1886 if (result != VDO_SUCCESS) { in update_existing_vdo()
1888 return vdo_status_to_errno(result); in update_existing_vdo()
1897 int result; in vdo_ctr() local
1906 result = construct_new_vdo(ti, argc, argv); in vdo_ctr()
1909 result = update_existing_vdo(device_name, ti, argc, argv, vdo); in vdo_ctr()
1914 return result; in vdo_ctr()
2000 int result; in suspend_callback() local
2046 result = vdo_synchronous_flush(vdo); in suspend_callback()
2047 if (result != VDO_SUCCESS) in suspend_callback()
2048 vdo_enter_read_only_mode(vdo, result); in suspend_callback()
2074 if (vdo_is_state_suspending(state) || (completion->result != VDO_SUCCESS)) { in suspend_callback()
2097 int result; in vdo_postsuspend() local
2107 result = perform_admin_operation(vdo, SUSPEND_PHASE_START, suspend_callback, in vdo_postsuspend()
2110 if ((result == VDO_SUCCESS) || (result == VDO_READ_ONLY)) { in vdo_postsuspend()
2116 } else if (result == VDO_INVALID_ADMIN_STATE) { in vdo_postsuspend()
2120 vdo_log_error_strerror(result, "Suspend of device '%s' failed", in vdo_postsuspend()
2182 int result; in load_callback() local
2188 result = vdo_start_operation(&vdo->admin.state, VDO_ADMIN_STATE_LOADING); in load_callback()
2189 if (result != VDO_SUCCESS) { in load_callback()
2190 vdo_continue_completion(completion, result); in load_callback()
2293 vdo_log_error_strerror(completion->result, "aborting load"); in handle_load_error()
2299 if ((completion->result == VDO_UNSUPPORTED_VERSION) && in handle_load_error()
2307 vdo_log_error_strerror(completion->result, in handle_load_error()
2310 vdo_enter_read_only_mode(vdo, completion->result); in handle_load_error()
2311 completion->result = VDO_READ_ONLY; in handle_load_error()
2352 int result; in resume_callback() local
2358 result = vdo_start_operation(&vdo->admin.state, in resume_callback()
2360 if (result != VDO_SUCCESS) { in resume_callback()
2361 vdo_continue_completion(completion, result); in resume_callback()
2432 int result; in grow_logical_callback() local
2445 result = vdo_start_operation(&vdo->admin.state, in grow_logical_callback()
2447 if (result != VDO_SUCCESS) { in grow_logical_callback()
2448 vdo_continue_completion(completion, result); in grow_logical_callback()
2464 vdo_enter_read_only_mode(vdo, completion->result); in grow_logical_callback()
2507 int result; in perform_grow_logical() local
2523 result = perform_admin_operation(vdo, GROW_LOGICAL_PHASE_START, in perform_grow_logical()
2526 if (result != VDO_SUCCESS) in perform_grow_logical()
2527 return result; in perform_grow_logical()
2536 int result = (((read_err == 0) && (write_err == 0)) ? VDO_SUCCESS : -EIO); in copy_callback() local
2538 vdo_continue_completion(completion, result); in copy_callback()
2582 int result; in grow_physical_callback() local
2595 result = vdo_start_operation(&vdo->admin.state, in grow_physical_callback()
2597 if (result != VDO_SUCCESS) { in grow_physical_callback()
2598 vdo_continue_completion(completion, result); in grow_physical_callback()
2633 vdo_enter_read_only_mode(vdo, completion->result); in grow_physical_callback()
2666 int result; in perform_grow_physical() local
2692 result = perform_admin_operation(vdo, GROW_PHYSICAL_PHASE_START, in perform_grow_physical()
2695 if (result != VDO_SUCCESS) in perform_grow_physical()
2696 return result; in perform_grow_physical()
2716 int result; in apply_new_vdo_configuration() local
2718 result = perform_grow_logical(vdo, config->logical_blocks); in apply_new_vdo_configuration()
2719 if (result != VDO_SUCCESS) { in apply_new_vdo_configuration()
2720 vdo_log_error("grow logical operation failed, result = %d", result); in apply_new_vdo_configuration()
2721 return result; in apply_new_vdo_configuration()
2724 result = perform_grow_physical(vdo, config->physical_blocks); in apply_new_vdo_configuration()
2725 if (result != VDO_SUCCESS) in apply_new_vdo_configuration()
2726 vdo_log_error("resize operation failed, result = %d", result); in apply_new_vdo_configuration()
2728 return result; in apply_new_vdo_configuration()
2736 int result; in vdo_preresume_registered() local
2749 result = perform_admin_operation(vdo, LOAD_PHASE_START, load_callback, in vdo_preresume_registered()
2751 if (result == VDO_UNSUPPORTED_VERSION) { in vdo_preresume_registered()
2761 return result; in vdo_preresume_registered()
2764 if ((result != VDO_SUCCESS) && (result != VDO_READ_ONLY)) { in vdo_preresume_registered()
2769 vdo_log_error_strerror(result, in vdo_preresume_registered()
2775 return result; in vdo_preresume_registered()
2785 result = apply_new_vdo_configuration(vdo, config); in vdo_preresume_registered()
2786 BUG_ON(result == VDO_INVALID_ADMIN_STATE); in vdo_preresume_registered()
2799 if (result != VDO_SUCCESS) { in vdo_preresume_registered()
2800 vdo_log_error_strerror(result, in vdo_preresume_registered()
2803 vdo_enter_read_only_mode(vdo, result); in vdo_preresume_registered()
2804 return result; in vdo_preresume_registered()
2812 result = perform_admin_operation(vdo, RESUME_PHASE_START, resume_callback, in vdo_preresume_registered()
2814 BUG_ON(result == VDO_INVALID_ADMIN_STATE); in vdo_preresume_registered()
2815 if (result == VDO_READ_ONLY) { in vdo_preresume_registered()
2817 result = VDO_SUCCESS; in vdo_preresume_registered()
2820 if (result != VDO_SUCCESS) in vdo_preresume_registered()
2822 result); in vdo_preresume_registered()
2824 return result; in vdo_preresume_registered()
2831 int result; in vdo_preresume() local
2834 result = vdo_preresume_registered(ti, vdo); in vdo_preresume()
2835 if ((result == VDO_PARAMETER_MISMATCH) || (result == VDO_INVALID_ADMIN_STATE) || in vdo_preresume()
2836 (result == VDO_UNSUPPORTED_VERSION)) in vdo_preresume()
2837 result = -EINVAL; in vdo_preresume()
2839 return vdo_status_to_errno(result); in vdo_preresume()
2893 int result = 0; in vdo_init() local
2902 result = vdo_register_status_codes(); in vdo_init()
2903 if (result != VDO_SUCCESS) { in vdo_init()
2904 vdo_log_error("vdo_register_status_codes failed %d", result); in vdo_init()
2906 return result; in vdo_init()
2909 result = dm_register_target(&vdo_target_bio); in vdo_init()
2910 if (result < 0) { in vdo_init()
2911 vdo_log_error("dm_register_target failed %d", result); in vdo_init()
2913 return result; in vdo_init()
2917 return result; in vdo_init()