glusterfs icon indicating copy to clipboard operation
glusterfs copied to clipboard

libglusterfs, glusterd: use host UUID in binary form

Open dmantipov opened this issue 2 years ago • 4 comments

Introduce gf_uuid_dup() and prefer host UUID in binary form, adjust nearby code. This is mostly intended to avoid redundant calls to uuid_utoa(), drop related variables and slightly reduce the memory footprint. Drop unused glusterd_uuid_str argument of glusterd_start_gsync() as well.

Signed-off-by: Dmitry Antipov [email protected] Updates: #1000

dmantipov avatar Aug 05 '22 10:08 dmantipov

CLANG-FORMAT FAILURE: Before merging the patch, this diff needs to be considered for passing clang-format

index 9f7038763..45413484a 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -4288,7 +4288,7 @@ gf_set_nofile(rlim_t high, rlim_t low)
 {
     int n, ret = -1;
     struct rlimit lim;
-    rlim_t r[2] = { high, low };
+    rlim_t r[2] = {high, low};
 
     for (n = 0; n < 2; n++)
         if (r[n] != 0) {
diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h
index de1793732..4881e8c89 100644
--- a/libglusterfs/src/glusterfs/common-utils.h
+++ b/libglusterfs/src/glusterfs/common-utils.h
@@ -209,7 +209,9 @@ gf_set_nofile(rlim_t high, rlim_t low);
 
 #else /* Darwin */
 
-#define gf_set_nofile(low, high) do { } while (0)
+#define gf_set_nofile(low, high)                                               \
+    do {                                                                       \
+    } while (0)
 
 #endif /* not GF_DARWIN_HOST_OS */
 

gluster-ant avatar Aug 05 '22 10:08 gluster-ant

/run regression

dmantipov avatar Aug 05 '22 13:08 dmantipov

CLANG-FORMAT FAILURE: Before merging the patch, this diff needs to be considered for passing clang-format

index 9f7038763..45413484a 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -4288,7 +4288,7 @@ gf_set_nofile(rlim_t high, rlim_t low)
 {
     int n, ret = -1;
     struct rlimit lim;
-    rlim_t r[2] = { high, low };
+    rlim_t r[2] = {high, low};
 
     for (n = 0; n < 2; n++)
         if (r[n] != 0) {
diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h
index de1793732..4881e8c89 100644
--- a/libglusterfs/src/glusterfs/common-utils.h
+++ b/libglusterfs/src/glusterfs/common-utils.h
@@ -209,7 +209,9 @@ gf_set_nofile(rlim_t high, rlim_t low);
 
 #else /* Darwin */
 
-#define gf_set_nofile(low, high) do { } while (0)
+#define gf_set_nofile(low, high)                                               \
+    do {                                                                       \
+    } while (0)
 
 #endif /* not GF_DARWIN_HOST_OS */
 

gluster-ant avatar Aug 10 '22 09:08 gluster-ant

/run regression

dmantipov avatar Aug 10 '22 12:08 dmantipov

Thank you for your contributions. Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity. It will be closed in 2 weeks if no one responds with a comment here.

stale[bot] avatar Mar 18 '23 17:03 stale[bot]

Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.

stale[bot] avatar Apr 02 '23 17:04 stale[bot]