summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/common-utils.c1
-rw-r--r--libglusterfs/src/defaults.c26
-rw-r--r--libglusterfs/src/defaults.h5
-rw-r--r--libglusterfs/src/glusterfs.h1
-rw-r--r--libglusterfs/src/protocol.h8
-rw-r--r--libglusterfs/src/xlator.c1
-rw-r--r--libglusterfs/src/xlator.h10
7 files changed, 52 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index fb6948d2d86..2650e8fb55a 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -218,6 +218,7 @@ gf_global_variable_init()
gf_mop_list[GF_MOP_STATS] = "STATS";
gf_mop_list[GF_MOP_SETSPEC] = "SETSPEC";
gf_mop_list[GF_MOP_GETSPEC] = "GETSPEC";
+ gf_mop_list[GF_MOP_LOG] = "LOG";
gf_mop_list[GF_MOP_PING] = "PING";
gf_cbk_list[GF_CBK_FORGET] = "FORGET";
diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c
index 77451d11c96..ba47ecc8801 100644
--- a/libglusterfs/src/defaults.c
+++ b/libglusterfs/src/defaults.c
@@ -1344,6 +1344,32 @@ default_getspec (call_frame_t *frame,
static int32_t
+default_log_cbk (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno)
+{
+ STACK_UNWIND (frame, op_ret, op_errno);
+ return 0;
+}
+
+
+int32_t
+default_log (call_frame_t *frame,
+ xlator_t *this,
+ const char *msg)
+{
+ STACK_WIND (frame,
+ default_log_cbk,
+ FIRST_CHILD(this),
+ FIRST_CHILD(this)->mops->log,
+ msg);
+ return 0;
+}
+
+
+static int32_t
default_checksum_cbk (call_frame_t *frame,
void *cookie,
xlator_t *this,
diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h
index a61bdff755d..33d9745204d 100644
--- a/libglusterfs/src/defaults.h
+++ b/libglusterfs/src/defaults.h
@@ -42,6 +42,11 @@ int32_t default_getspec (call_frame_t *frame,
const char *key,
int32_t flag);
+int32_t
+default_log (call_frame_t *frame,
+ xlator_t *this,
+ const char *msg);
+
int32_t default_checksum (call_frame_t *frame,
xlator_t *this,
loc_t *loc,
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index a4b8a516f17..bf269df4b32 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -139,6 +139,7 @@ typedef enum {
GF_MOP_SETSPEC,
GF_MOP_GETSPEC,
GF_MOP_PING,
+ GF_MOP_LOG,
GF_MOP_MAXVALUE /* 5 */
} glusterfs_mop_t;
diff --git a/libglusterfs/src/protocol.h b/libglusterfs/src/protocol.h
index 4bb379b2f9b..b17f83bcd8f 100644
--- a/libglusterfs/src/protocol.h
+++ b/libglusterfs/src/protocol.h
@@ -724,6 +724,14 @@ typedef struct {
typedef struct {
+ uint32_t msglen;
+ char msg[0];
+} __attribute__((packed)) gf_mop_log_req_t;
+typedef struct {
+} __attribute__((packed)) gf_mop_log_rsp_t;
+
+
+typedef struct {
uint32_t dict_len;
char buf[0];
} __attribute__((packed)) gf_mop_setvolume_req_t;
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index c20499de27e..1bcf2e73834 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -102,6 +102,7 @@ fill_defaults (xlator_t *xl)
SET_DEFAULT_FOP (lock_notify);
SET_DEFAULT_FOP (lock_fnotify);
+ SET_DEFAULT_MOP (log);
SET_DEFAULT_MOP (stats);
SET_DEFAULT_CBK (release);
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index 2bacc04577c..8e067617578 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -98,6 +98,10 @@ typedef int32_t (*mop_getspec_cbk_t) (call_frame_t *frame,
int32_t op_errno,
char *spec_data);
+typedef int32_t (*mop_log_cbk_t) (call_frame_t *frame,
+ void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno);
+
typedef int32_t (*fop_checksum_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
@@ -119,6 +123,10 @@ typedef int32_t (*mop_getspec_t) (call_frame_t *frame,
const char *key,
int32_t flag);
+typedef int32_t (*mop_log_t) (call_frame_t *frame,
+ xlator_t *this,
+ const char *msg);
+
typedef int32_t (*fop_checksum_t) (call_frame_t *frame,
xlator_t *this,
loc_t *loc,
@@ -127,7 +135,9 @@ typedef int32_t (*fop_checksum_t) (call_frame_t *frame,
struct xlator_mops {
mop_stats_t stats;
mop_getspec_t getspec;
+ mop_log_t log;
+ mop_log_cbk_t log_cbk;
mop_stats_cbk_t stats_cbk;
mop_getspec_cbk_t getspec_cbk;
};