]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: rename functions to emphasize whole disk is locked 22913/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Mar 2022 19:31:46 +0000 (04:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Mar 2022 22:25:24 +0000 (07:25 +0900)
src/udev/udevd.c

index 21e3c3558fb0274ecb128e2402b18bf17fe4ba28..424ecfc2cfb7eb267443a47bb07510bf0b888311 100644 (file)
@@ -422,7 +422,7 @@ static int worker_send_result(Manager *manager, int result) {
         return loop_write(manager->worker_watch[WRITE_END], &result, sizeof(result), false);
 }
 
-static int device_get_block_device(sd_device *dev, const char **ret) {
+static int device_get_whole_disk(sd_device *dev, const char **ret) {
         const char *val;
         int r;
 
@@ -471,7 +471,7 @@ irrelevant:
         return 0;
 }
 
-static int worker_lock_block_device(sd_device *dev, int *ret_fd) {
+static int worker_lock_whole_disk(sd_device *dev, int *ret_fd) {
         _cleanup_close_ int fd = -1;
         const char *val;
         int r;
@@ -484,7 +484,7 @@ static int worker_lock_block_device(sd_device *dev, int *ret_fd) {
          * event handling; in the case udev acquired the lock, the external process can block until udev has
          * finished its event handling. */
 
-        r = device_get_block_device(dev, &val);
+        r = device_get_whole_disk(dev, &val);
         if (r < 0)
                 return r;
         if (r == 0)
@@ -581,7 +581,7 @@ static int worker_process_device(Manager *manager, sd_device *dev) {
          * Instead of processing the event, we requeue the event and will try again after a delay.
          *
          * The user-facing side of this: https://systemd.io/BLOCK_DEVICE_LOCKING */
-        r = worker_lock_block_device(dev, &fd_lock);
+        r = worker_lock_whole_disk(dev, &fd_lock);
         if (r == -EAGAIN)
                 return EVENT_RESULT_TRY_AGAIN;
         if (r < 0)
@@ -1093,7 +1093,7 @@ static int event_queue_assume_block_device_unlocked(Manager *manager, sd_device
          * device is not locked anymore. The assumption may not be true, but that should not cause any
          * issues, as in that case events will be requeued soon. */
 
-        r = device_get_block_device(dev, &devname);
+        r = device_get_whole_disk(dev, &devname);
         if (r <= 0)
                 return r;
 
@@ -1106,7 +1106,7 @@ static int event_queue_assume_block_device_unlocked(Manager *manager, sd_device
                 if (event->retry_again_next_usec == 0)
                         continue;
 
-                if (device_get_block_device(event->dev, &event_devname) <= 0)
+                if (device_get_whole_disk(event->dev, &event_devname) <= 0)
                         continue;
 
                 if (!streq(devname, event_devname))