Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm vdo thread-device: rename all methods to reflect vdo-only use

Also moved vdo_init()'s call to vdo_initialize_thread_device_registry
next to other registry initialization.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>

+27 -29
+15 -15
drivers/md/dm-vdo/dm-vdo-target.c
··· 1107 1107 1108 1108 vdo = get_vdo_for_target(ti); 1109 1109 uds_register_allocating_thread(&allocating_thread, NULL); 1110 - uds_register_thread_device_id(&instance_thread, &vdo->instance); 1110 + vdo_register_thread_device_id(&instance_thread, &vdo->instance); 1111 1111 1112 1112 /* 1113 1113 * Must be done here so we don't map return codes. The code in dm-ioctl expects a 1 for a ··· 1120 1120 result = vdo_status_to_errno(process_vdo_message(vdo, argc, argv)); 1121 1121 } 1122 1122 1123 - uds_unregister_thread_device_id(); 1123 + vdo_unregister_thread_device_id(); 1124 1124 uds_unregister_allocating_thread(); 1125 1125 return result; 1126 1126 } ··· 1632 1632 if (result != VDO_SUCCESS) 1633 1633 return -ENOMEM; 1634 1634 1635 - uds_register_thread_device_id(&instance_thread, &instance); 1635 + vdo_register_thread_device_id(&instance_thread, &instance); 1636 1636 result = construct_new_vdo_registered(ti, argc, argv, instance); 1637 - uds_unregister_thread_device_id(); 1637 + vdo_unregister_thread_device_id(); 1638 1638 return result; 1639 1639 } 1640 1640 ··· 1913 1913 if (vdo == NULL) { 1914 1914 result = construct_new_vdo(ti, argc, argv); 1915 1915 } else { 1916 - uds_register_thread_device_id(&instance_thread, &vdo->instance); 1916 + vdo_register_thread_device_id(&instance_thread, &vdo->instance); 1917 1917 result = update_existing_vdo(device_name, ti, argc, argv, vdo); 1918 - uds_unregister_thread_device_id(); 1918 + vdo_unregister_thread_device_id(); 1919 1919 } 1920 1920 1921 1921 uds_unregister_allocating_thread(); ··· 1935 1935 unsigned int instance = vdo->instance; 1936 1936 struct registered_thread allocating_thread, instance_thread; 1937 1937 1938 - uds_register_thread_device_id(&instance_thread, &instance); 1938 + vdo_register_thread_device_id(&instance_thread, &instance); 1939 1939 uds_register_allocating_thread(&allocating_thread, NULL); 1940 1940 1941 1941 device_name = vdo_get_device_name(ti); ··· 1945 1945 1946 1946 vdo_destroy(uds_forget(vdo)); 1947 1947 uds_log_info("device '%s' stopped", device_name); 1948 - uds_unregister_thread_device_id(); 1948 + vdo_unregister_thread_device_id(); 1949 1949 uds_unregister_allocating_thread(); 1950 1950 release_instance(instance); 1951 1951 } else if (config == vdo->device_config) { ··· 2104 2104 const char *device_name; 2105 2105 int result; 2106 2106 2107 - uds_register_thread_device_id(&instance_thread, &vdo->instance); 2107 + vdo_register_thread_device_id(&instance_thread, &vdo->instance); 2108 2108 device_name = vdo_get_device_name(vdo->device_config->owning_target); 2109 2109 uds_log_info("suspending device '%s'", device_name); 2110 2110 ··· 2129 2129 device_name); 2130 2130 } 2131 2131 2132 - uds_unregister_thread_device_id(); 2132 + vdo_unregister_thread_device_id(); 2133 2133 } 2134 2134 2135 2135 /** ··· 2846 2846 struct vdo *vdo = get_vdo_for_target(ti); 2847 2847 int result; 2848 2848 2849 - uds_register_thread_device_id(&instance_thread, &vdo->instance); 2849 + vdo_register_thread_device_id(&instance_thread, &vdo->instance); 2850 2850 result = vdo_preresume_registered(ti, vdo); 2851 2851 if ((result == VDO_PARAMETER_MISMATCH) || (result == VDO_INVALID_ADMIN_STATE)) 2852 2852 result = -EINVAL; 2853 - uds_unregister_thread_device_id(); 2853 + vdo_unregister_thread_device_id(); 2854 2854 return vdo_status_to_errno(result); 2855 2855 } 2856 2856 ··· 2858 2858 { 2859 2859 struct registered_thread instance_thread; 2860 2860 2861 - uds_register_thread_device_id(&instance_thread, 2861 + vdo_register_thread_device_id(&instance_thread, 2862 2862 &get_vdo_for_target(ti)->instance); 2863 2863 uds_log_info("device '%s' resumed", vdo_get_device_name(ti)); 2864 - uds_unregister_thread_device_id(); 2864 + vdo_unregister_thread_device_id(); 2865 2865 } 2866 2866 2867 2867 /* ··· 2912 2912 /* 2913 2913 * UDS module level initialization must be done first, as VDO initialization depends on it 2914 2914 */ 2915 - uds_initialize_thread_device_registry(); 2916 2915 uds_memory_init(); 2917 2916 uds_init_sysfs(); 2918 2917 2918 + vdo_initialize_thread_device_registry(); 2919 2919 vdo_initialize_device_registry_once(); 2920 2920 uds_log_info("loaded version %s", CURRENT_VERSION); 2921 2921
+1 -1
drivers/md/dm-vdo/logger.c
··· 176 176 } 177 177 178 178 /* Not at interrupt level; we have a process we can look at, and might have a device ID. */ 179 - device_instance = uds_get_thread_device_id(); 179 + device_instance = vdo_get_thread_device_id(); 180 180 if (device_instance >= 0) { 181 181 emit_log_message_to_kernel(priority, "%s%u:%s: %s%pV%pV\n", module, 182 182 device_instance, current->comm, prefix, vaf1,
+4 -6
drivers/md/dm-vdo/thread-device.c
··· 5 5 6 6 #include "thread-device.h" 7 7 8 - #include "thread-registry.h" 9 - 10 8 /* A registry of threads associated with device id numbers. */ 11 9 static struct thread_registry device_id_thread_registry; 12 10 13 11 /* Any registered thread must be unregistered. */ 14 - void uds_register_thread_device_id(struct registered_thread *new_thread, 12 + void vdo_register_thread_device_id(struct registered_thread *new_thread, 15 13 unsigned int *id_ptr) 16 14 { 17 15 vdo_register_thread(&device_id_thread_registry, new_thread, id_ptr); 18 16 } 19 17 20 - void uds_unregister_thread_device_id(void) 18 + void vdo_unregister_thread_device_id(void) 21 19 { 22 20 vdo_unregister_thread(&device_id_thread_registry); 23 21 } 24 22 25 - int uds_get_thread_device_id(void) 23 + int vdo_get_thread_device_id(void) 26 24 { 27 25 const unsigned int *pointer; 28 26 ··· 28 30 return (pointer != NULL) ? *pointer : -1; 29 31 } 30 32 31 - void uds_initialize_thread_device_registry(void) 33 + void vdo_initialize_thread_device_registry(void) 32 34 { 33 35 vdo_initialize_thread_registry(&device_id_thread_registry); 34 36 }
+7 -7
drivers/md/dm-vdo/thread-device.h
··· 3 3 * Copyright 2023 Red Hat 4 4 */ 5 5 6 - #ifndef UDS_THREAD_DEVICE_H 7 - #define UDS_THREAD_DEVICE_H 6 + #ifndef VDO_THREAD_DEVICE_H 7 + #define VDO_THREAD_DEVICE_H 8 8 9 9 #include "thread-registry.h" 10 10 11 - void uds_register_thread_device_id(struct registered_thread *new_thread, 11 + void vdo_register_thread_device_id(struct registered_thread *new_thread, 12 12 unsigned int *id_ptr); 13 13 14 - void uds_unregister_thread_device_id(void); 14 + void vdo_unregister_thread_device_id(void); 15 15 16 - int uds_get_thread_device_id(void); 16 + int vdo_get_thread_device_id(void); 17 17 18 - void uds_initialize_thread_device_registry(void); 18 + void vdo_initialize_thread_device_registry(void); 19 19 20 - #endif /* UDS_THREAD_DEVICE_H */ 20 + #endif /* VDO_THREAD_DEVICE_H */