summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-31 07:51:14 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-08-31 10:49:40 -0700
commit6530488a49ed0c9395b091c42b148091075a9d86 (patch)
tree18c85cb3bfa4fc0f0dce0aef27bf6af1ade19af9 /xlators/mgmt/glusterd/src/glusterd.h
parentda5bf7cf104cd060b2f94d47132029689bfff685 (diff)
'gluster volume log' feature added
* 'gluster volume log filename <VOLNAME> [BRICK] <path>' * 'gluster volume log locate <VOLNAME> [BRICK]' * 'gluster volume log rotate <VOLUME> [BRICK]' Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 50348cf1326..d52f713054d 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <dirent.h>
#include <pthread.h>
+#include <libgen.h>
#include "uuid.h"
@@ -79,6 +80,7 @@ struct glusterd_brickinfo {
struct list_head brick_list;
uuid_t uuid;
int port;
+ char *logfile;
glusterd_store_handle_t *shandle;
};
@@ -181,14 +183,18 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
GLUSTERD_VOLUME_DIR_PREFIX, volinfo->volname, \
GLUSTERD_BRICK_INFO_DIR);
-#define GLUSTERD_GET_BRICK_PIDFILE(pidfile,volpath,hostname,brickpath) { \
+#define GLUSTERD_REMOVE_SLASH_FROM_PATH(path,string) do { \
int i = 0; \
- char exp_path[PATH_MAX] = {0,}; \
- for (i = 0; i < strlen (brickpath); i++) { \
- exp_path[i] = brickpath[i]; \
- if (exp_path[i] == '/') \
- exp_path[i] = '-'; \
+ for (i = 1; i < strlen (path); i++) { \
+ string[i-1] = path[i]; \
+ if (string[i-1] == '/') \
+ string[i-1] = '-'; \
} \
+ } while (0)
+
+#define GLUSTERD_GET_BRICK_PIDFILE(pidfile,volpath,hostname,brickpath) { \
+ char exp_path[PATH_MAX] = {0,}; \
+ GLUSTERD_REMOVE_SLASH_FROM_PATH (brickpath, exp_path); \
snprintf (pidfile, PATH_MAX, "%s/run/%s-%s.pid", \
volpath, hostname, exp_path); \
}
@@ -322,7 +328,6 @@ glusterd_add_brick (rpcsvc_request_t *req, dict_t *dict);
int
glusterd_handle_add_brick (rpcsvc_request_t *req);
-
int32_t
glusterd_replace_brick (rpcsvc_request_t *req, dict_t *dict);
@@ -332,6 +337,18 @@ glusterd_handle_replace_brick (rpcsvc_request_t *req);
int
glusterd_handle_remove_brick (rpcsvc_request_t *req);
+int
+glusterd_handle_log_filename (rpcsvc_request_t *req);
+int
+glusterd_handle_log_locate (rpcsvc_request_t *req);
+int
+glusterd_handle_log_rotate (rpcsvc_request_t *req);
+
+int32_t
+glusterd_log_filename (rpcsvc_request_t *req, dict_t *dict);
+int32_t
+glusterd_log_rotate (rpcsvc_request_t *req, dict_t *dict);
+
int32_t
glusterd_remove_brick (rpcsvc_request_t *req, dict_t *dict);