From 7db4540f9a8d6c8fb9ffafb87e6bd30712a0c5b1 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 19 May 2023 10:01:02 -0700 Subject: [PATCH] libsysprof-analyze: rename mount-path to mount-point We want to be consistent with SysprofMount in naming. --- src/libsysprof-analyze/sysprof-document.c | 2 +- .../sysprof-mount-device-private.h | 20 ++++++------- src/libsysprof-analyze/sysprof-mount-device.c | 28 +++++++++---------- .../sysprof-mount-private.h | 2 ++ 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/libsysprof-analyze/sysprof-document.c b/src/libsysprof-analyze/sysprof-document.c index 40713399..fd3b28a5 100644 --- a/src/libsysprof-analyze/sysprof-document.c +++ b/src/libsysprof-analyze/sysprof-document.c @@ -324,7 +324,7 @@ sysprof_document_load_mounts (SysprofDocument *self) mount_device = sysprof_mount_device_new (); sysprof_mount_device_set_id (mount_device, device); - sysprof_mount_device_set_mount_path (mount_device, mountpoint); + sysprof_mount_device_set_mount_point (mount_device, mountpoint); sysprof_mount_device_set_subvolume (mount_device, subvol); sysprof_mount_namespace_add_device (self->mount_namespace, g_steal_pointer (&mount_device)); } diff --git a/src/libsysprof-analyze/sysprof-mount-device-private.h b/src/libsysprof-analyze/sysprof-mount-device-private.h index cfebc3bd..db9e4f5a 100644 --- a/src/libsysprof-analyze/sysprof-mount-device-private.h +++ b/src/libsysprof-analyze/sysprof-mount-device-private.h @@ -28,15 +28,15 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (SysprofMountDevice, sysprof_mount_device, SYSPROF, MOUNT_DEVICE, GObject) -SysprofMountDevice *sysprof_mount_device_new (void); -const char *sysprof_mount_device_get_id (SysprofMountDevice *self); -void sysprof_mount_device_set_id (SysprofMountDevice *self, - const char *id); -const char *sysprof_mount_device_get_mount_path (SysprofMountDevice *self); -void sysprof_mount_device_set_mount_path (SysprofMountDevice *self, - const char *mount_path); -const char *sysprof_mount_device_get_subvolume (SysprofMountDevice *self); -void sysprof_mount_device_set_subvolume (SysprofMountDevice *self, - const char *subvolume); +SysprofMountDevice *sysprof_mount_device_new (void); +const char *sysprof_mount_device_get_id (SysprofMountDevice *self); +void sysprof_mount_device_set_id (SysprofMountDevice *self, + const char *id); +const char *sysprof_mount_device_get_mount_point (SysprofMountDevice *self); +void sysprof_mount_device_set_mount_point (SysprofMountDevice *self, + const char *mount_point); +const char *sysprof_mount_device_get_subvolume (SysprofMountDevice *self); +void sysprof_mount_device_set_subvolume (SysprofMountDevice *self, + const char *subvolume); G_END_DECLS diff --git a/src/libsysprof-analyze/sysprof-mount-device.c b/src/libsysprof-analyze/sysprof-mount-device.c index 3b61fc3b..983e8907 100644 --- a/src/libsysprof-analyze/sysprof-mount-device.c +++ b/src/libsysprof-analyze/sysprof-mount-device.c @@ -26,14 +26,14 @@ struct _SysprofMountDevice { GObject parent_instance; char *id; - char *mount_path; + char *mount_point; char *subvolume; }; enum { PROP_0, PROP_ID, - PROP_MOUNT_PATH, + PROP_MOUNT_POINT, PROP_SUBVOLUME, N_PROPS }; @@ -48,7 +48,7 @@ sysprof_mount_device_finalize (GObject *object) SysprofMountDevice *self = (SysprofMountDevice *)object; g_clear_pointer (&self->id, g_free); - g_clear_pointer (&self->mount_path, g_free); + g_clear_pointer (&self->mount_point, g_free); g_clear_pointer (&self->subvolume, g_free); G_OBJECT_CLASS (sysprof_mount_device_parent_class)->finalize (object); @@ -68,8 +68,8 @@ sysprof_mount_device_get_property (GObject *object, g_value_set_string (value, sysprof_mount_device_get_id (self)); break; - case PROP_MOUNT_PATH: - g_value_set_string (value, sysprof_mount_device_get_mount_path (self)); + case PROP_MOUNT_POINT: + g_value_set_string (value, sysprof_mount_device_get_mount_point (self)); break; case PROP_SUBVOLUME: @@ -95,8 +95,8 @@ sysprof_mount_device_set_property (GObject *object, sysprof_mount_device_set_id (self, g_value_get_string (value)); break; - case PROP_MOUNT_PATH: - sysprof_mount_device_set_mount_path (self, g_value_get_string (value)); + case PROP_MOUNT_POINT: + sysprof_mount_device_set_mount_point (self, g_value_get_string (value)); break; case PROP_SUBVOLUME: @@ -122,7 +122,7 @@ sysprof_mount_device_class_init (SysprofMountDeviceClass *klass) NULL, (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS)); - properties [PROP_MOUNT_PATH] = + properties [PROP_MOUNT_POINT] = g_param_spec_string ("mount-path", NULL, NULL, NULL, (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS)); @@ -165,21 +165,21 @@ sysprof_mount_device_set_id (SysprofMountDevice *self, } const char * -sysprof_mount_device_get_mount_path (SysprofMountDevice *self) +sysprof_mount_device_get_mount_point (SysprofMountDevice *self) { g_return_val_if_fail (SYSPROF_IS_MOUNT_DEVICE (self), NULL); - return self->mount_path; + return self->mount_point; } void -sysprof_mount_device_set_mount_path (SysprofMountDevice *self, - const char *mount_path) +sysprof_mount_device_set_mount_point (SysprofMountDevice *self, + const char *mount_point) { g_return_if_fail (SYSPROF_IS_MOUNT_DEVICE (self)); - if (g_set_str (&self->mount_path, mount_path)) - g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_MOUNT_PATH]); + if (g_set_str (&self->mount_point, mount_point)) + g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_MOUNT_POINT]); } const char * diff --git a/src/libsysprof-analyze/sysprof-mount-private.h b/src/libsysprof-analyze/sysprof-mount-private.h index 9662bccc..11488d05 100644 --- a/src/libsysprof-analyze/sysprof-mount-private.h +++ b/src/libsysprof-analyze/sysprof-mount-private.h @@ -27,5 +27,7 @@ G_BEGIN_DECLS SysprofMount *_sysprof_mount_new_for_mountinfo (SysprofStrings *strings, const char *mountinfo); +gboolean _sysprof_mount_contains_path (SysprofMount *self, + const char *path); G_END_DECLS