diff mbox series

[16/41] libmultipath: rename identifiers with leading underscores in devmapper.h

Message ID 20240808152620.93965-17-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: comply with C library reserved names | expand

Commit Message

Martin Wilck Aug. 8, 2024, 3:25 p.m. UTC
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/devmapper.c | 16 ++++++++--------
 libmultipath/devmapper.h | 12 ++++++------
 2 files changed, 14 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index fe604f1..0a4b586 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -86,10 +86,10 @@  const char *dmp_errstr(int rc)
 		[DMP_OK] = "success",
 		[DMP_NOT_FOUND] = "not found",
 		[DMP_NO_MATCH] = "target type mismatch",
-		[__DMP_LAST__] = "**invalid**",
+		[DMP_LAST__] = "**invalid**",
 	};
-	if (rc < 0 || rc > __DMP_LAST__)
-		rc = __DMP_LAST__;
+	if (rc < 0 || rc > DMP_LAST__)
+		rc = DMP_LAST__;
 	return str[rc];
 }
 
@@ -624,7 +624,7 @@  has_dm_info(const struct multipath *mpp)
 
 static int libmp_set_map_identifier(int flags, mapid_t id, struct dm_task *dmt)
 {
-	switch (flags & __DM_MAP_BY_MASK) {
+	switch (flags & DM_MAP_BY_MASK__) {
 	case DM_MAP_BY_UUID:
 		if (!id.str || !(*id.str))
 			return 0;
@@ -682,7 +682,7 @@  static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma
 	 */
 	if (info.target && !info.status)
 		ioctl_nr = DM_DEVICE_TABLE;
-	else if (info.status || info.size || flags & __MAPINFO_TGT_TYPE)
+	else if (info.status || info.size || flags & MAPINFO_TGT_TYPE__)
 		ioctl_nr = DM_DEVICE_STATUS;
 	else
 		ioctl_nr = DM_DEVICE_INFO;
@@ -715,7 +715,7 @@  static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma
 		return DMP_NOT_FOUND;
 	}
 
-	if (info.target || info.status || info.size || flags & __MAPINFO_TGT_TYPE) {
+	if (info.target || info.status || info.size || flags & MAPINFO_TGT_TYPE__) {
 		if (dm_get_next_target(dmt, NULL, &start, &length,
 				       &target_type, &params) != NULL) {
 			condlog(2, "%s: map %s has multiple targets", fname__, map_id);
@@ -725,7 +725,7 @@  static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma
 			condlog(2, "%s: map %s has no targets", fname__, map_id);
 			return DMP_NOT_FOUND;
 		}
-		if (flags & __MAPINFO_TGT_TYPE) {
+		if (flags & MAPINFO_TGT_TYPE__) {
 			const char *tgt_type = flags & MAPINFO_MPATH_ONLY ? TGT_MPATH : TGT_PART;
 
 			if (strcmp(target_type, tgt_type)) {
@@ -797,7 +797,7 @@  static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma
 /* Helper: format a string describing the map for log messages */
 static const char* libmp_map_identifier(int flags, mapid_t id, char buf[BLK_DEV_SIZE])
 {
-	switch (flags & __DM_MAP_BY_MASK) {
+	switch (flags & DM_MAP_BY_MASK__) {
 	case DM_MAP_BY_NAME:
 	case DM_MAP_BY_UUID:
 		return id.str;
diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h
index b5330ab..d9c08fd 100644
--- a/libmultipath/devmapper.h
+++ b/libmultipath/devmapper.h
@@ -35,15 +35,15 @@  enum {
 	DMP_OK,
 	DMP_NOT_FOUND,
 	DMP_NO_MATCH,
-	__DMP_LAST__,
+	DMP_LAST__,
 };
 
 const char* dmp_errstr(int rc);
 
 /**
- * enum mapinfo_flags: input flags for libmp_mapinfo()
+ * input flags for libmp_mapinfo()
  */
-enum __mapinfo_flags {
+enum {
 	/** DM_MAP_BY_NAME: identify map by device-mapper name from @name */
 	DM_MAP_BY_NAME      = 0,
 	/** DM_MAP_BY_UUID: identify map by device-mapper UUID from @uuid */
@@ -52,12 +52,12 @@  enum __mapinfo_flags {
 	DM_MAP_BY_DEV,
 	/** DM_MAP_BY_DEVT: identify map by a dev_t */
 	DM_MAP_BY_DEVT,
-	__DM_MAP_BY_MASK    = (1 << 8) - 1,
+	DM_MAP_BY_MASK__    = (1 << 8) - 1,
 	/* Fail if target type is not multipath */
 	MAPINFO_MPATH_ONLY  = (1 << 8),
 	/* Fail if target type is not "partition" (linear) */
 	MAPINFO_PART_ONLY   = (1 << 9),
-	__MAPINFO_TGT_TYPE  = (MAPINFO_MPATH_ONLY | MAPINFO_PART_ONLY),
+	MAPINFO_TGT_TYPE__  = (MAPINFO_MPATH_ONLY | MAPINFO_PART_ONLY),
 	/* Fail if the UUID doesn't match the multipath UUID format */
 	MAPINFO_CHECK_UUID  = (1 << 10),
 };
@@ -92,7 +92,7 @@  typedef struct libmp_map_info {
 
 /**
  * libmp_mapinfo(): obtain information about a map from the kernel
- * @param flags: see __mapinfo_flags above.
+ * @param flags: see enum values above.
  *     Exactly one of DM_MAP_BY_NAME, DM_MAP_BY_UUID, and DM_MAP_BY_DEV must be set.
  * @param id: string or major/minor to identify the map to query
  * @param info: output parameters, see above. Non-NULL elements will be filled in.