From a67929e18a39d5c79a4a7e2b78015523626a367e Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Mon, 25 Mar 2019 19:07:16 +0200 Subject: graph.c: remove extra gettimeofday() - reuse the graph dob. It was written just before fill_void() call. Note that there was a possible overflow if the hostname was too long (unrelated to this patch), but it is now also fixed, as we use a smaller buffer for the hostname. This, in turn, forces us to check if gethostname() failed and add explicitly the terminating null to it. Change-Id: I45fbc0a8e105f1247f3cbf61befac06fabbaea06 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- libglusterfs/src/glusterfs/glusterfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/glusterfs') diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h index 209bb41307d..cdb6d97eec1 100644 --- a/libglusterfs/src/glusterfs/glusterfs.h +++ b/libglusterfs/src/glusterfs/glusterfs.h @@ -586,20 +586,20 @@ typedef struct _cmd_args cmd_args_t; struct _glusterfs_graph { struct list_head list; - char graph_uuid[128]; struct timeval dob; void *first; void *top; /* selected by -n */ - uint32_t leaf_count; int xl_count; int id; /* Used in logging */ int used; /* Should be set when fuse gets first CHILD_UP */ uint32_t volfile_checksum; + uint32_t leaf_count; void *last_xl; /* Stores the last xl of the graph, as of now only populated in client multiplexed code path */ pthread_mutex_t mutex; pthread_cond_t child_down_cond; /* for broadcasting CHILD_DOWN */ + char graph_uuid[128]; }; typedef struct _glusterfs_graph glusterfs_graph_t; -- cgit