diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-06-09 05:08:58 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-11 07:51:26 -0700 |
commit | 1a6989613914cc86a64c3eb21cfddba15ce372d9 (patch) | |
tree | 187a17f84131c7909c9fda37822fec6b3c3ee0d7 | |
parent | 77d8cfeab52cd19f3b70abd9c3a2c4bbc9219bff (diff) |
Added MOP log to libglusterfs/*
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
-rw-r--r-- | libglusterfs/src/common-utils.c | 1 | ||||
-rw-r--r-- | libglusterfs/src/defaults.c | 26 | ||||
-rw-r--r-- | libglusterfs/src/defaults.h | 5 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs.h | 1 | ||||
-rw-r--r-- | libglusterfs/src/protocol.h | 8 | ||||
-rw-r--r-- | libglusterfs/src/xlator.c | 1 | ||||
-rw-r--r-- | libglusterfs/src/xlator.h | 10 |
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; }; |