From: Yu Watanabe Date: Wed, 30 Mar 2022 19:31:46 +0000 (+0900) Subject: udev: rename functions to emphasize whole disk is locked X-Git-Tag: v251-rc2~243^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=03a24ce76b8ccfcb634f1863a18f9d7521237d63;p=thirdparty%2Fsystemd.git udev: rename functions to emphasize whole disk is locked --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 21e3c3558fb..424ecfc2cfb 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -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))