]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
blockdev-util: rename BlockDeviceLookupFlag to plural
authorLennart Poettering <lennart@poettering.net>
Mon, 20 Oct 2025 15:58:37 +0000 (17:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Oct 2025 20:56:01 +0000 (22:56 +0200)
This is a flags type and a flag function argument, let's name it in
plural, because it allows many flags combinations. Internally, the
implementation already used plural, but let's fix the prototypes too.

src/shared/blockdev-util.c
src/shared/blockdev-util.h

index 42a5c08b7293b9521a2f9c7f1e5564dd1bfb2ee7..7641f17aec97a82c6d93524315b4a1a6aa46cd42 100644 (file)
@@ -24,7 +24,7 @@
 #include "path-util.h"
 #include "string-util.h"
 
-static int fd_get_devnum(int fd, BlockDeviceLookupFlag flags, dev_t *ret) {
+static int fd_get_devnum(int fd, BlockDeviceLookupFlags flags, dev_t *ret) {
         struct stat st;
         dev_t devnum;
         int r;
@@ -148,7 +148,7 @@ int block_device_get_originating(sd_device *dev, sd_device **ret) {
         return 0;
 }
 
-int block_device_new_from_fd(int fd, BlockDeviceLookupFlag flags, sd_device **ret) {
+int block_device_new_from_fd(int fd, BlockDeviceLookupFlags flags, sd_device **ret) {
         _cleanup_(sd_device_unrefp) sd_device *dev = NULL;
         dev_t devnum;
         int r;
@@ -194,7 +194,7 @@ int block_device_new_from_fd(int fd, BlockDeviceLookupFlag flags, sd_device **re
         return 0;
 }
 
-int block_device_new_from_path(const char *path, BlockDeviceLookupFlag flags, sd_device **ret) {
+int block_device_new_from_path(const char *path, BlockDeviceLookupFlags flags, sd_device **ret) {
         _cleanup_close_ int fd = -EBADF;
 
         assert(path);
index 87b40054da94523d8de7f72b327a097b5aea5f3a..3c3153bacce5d9ff4ff2c64f35ce81b36c84370d 100644 (file)
 #define xsprintf_sys_block_path(buf, suffix, devno)                     \
         xsprintf(buf, "/sys/dev/block/%u:%u%s", major(devno), minor(devno), suffix ?: "")
 
-typedef enum BlockDeviceLookupFlag {
+typedef enum BlockDeviceLookupFlags {
         BLOCK_DEVICE_LOOKUP_WHOLE_DISK  = 1 << 0, /* whole block device, e.g. sda, nvme0n1, or loop0. */
         BLOCK_DEVICE_LOOKUP_BACKING     = 1 << 1, /* fd may be regular file or directory on file system, in
                                                    * which case backing block device is determined. */
         BLOCK_DEVICE_LOOKUP_ORIGINATING = 1 << 2, /* Try to find the underlying layer device for stacked
                                                    * block device, e.g. LUKS-style DM. */
-} BlockDeviceLookupFlag;
+} BlockDeviceLookupFlags;
 
-int block_device_new_from_fd(int fd, BlockDeviceLookupFlag flag, sd_device **ret);
-int block_device_new_from_path(const char *path, BlockDeviceLookupFlag flag, sd_device **ret);
+int block_device_new_from_fd(int fd, BlockDeviceLookupFlags flags, sd_device **ret);
+int block_device_new_from_path(const char *path, BlockDeviceLookupFlags flags, sd_device **ret);
 
 int block_device_is_whole_disk(sd_device *dev);
 int block_device_get_whole_disk(sd_device *dev, sd_device **ret);