From 78615ceea81479b38af43697766bcc04421a256d Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 12 Aug 2010 01:54:38 +0000 Subject: logging enhancements * per translator loglevel introduced, if set, it will override process wide log level. * with extended attribute 'trusted.glusterfs..set-log-level' with the value being '', one can change log level of particular translator. * with extended attribute 'trusted.glusterfs.syslog' with the value '', one can enable disable syslog for gluster Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 601 (Enable changing 'log-level' of GlusterFS process at runtime) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=601 --- xlators/mount/fuse/src/fuse-bridge.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'xlators/mount/fuse/src/fuse-bridge.c') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index ea5b5ae38..ac8295b96 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -2290,6 +2290,15 @@ fuse_setxattr (xlator_t *this, fuse_in_header_t *finh, void *msg) } #endif + /* Check if the command is for changing the log + level of process or specific xlator */ + ret = is_gf_log_command (this, name, value); + if (ret >= 0) { + send_fuse_err (this, finh, ret); + GF_FREE (finh); + return; + } + GET_STATE (this, finh, state); state->size = fsi->size; ret = fuse_loc_fill (&state->loc, state, finh->nodeid, 0, NULL); @@ -2311,6 +2320,7 @@ fuse_setxattr (xlator_t *this, fuse_in_header_t *finh, void *msg) "%"PRIu64": SETXATTR dict allocation failed", finh->unique); + send_fuse_err (this, finh, ENOMEM); free_fuse_state (state); return; } @@ -2749,7 +2759,6 @@ fuse_setlk (xlator_t *this, fuse_in_header_t *finh, void *msg) return; } - static void fuse_init (xlator_t *this, fuse_in_header_t *finh, void *msg) { @@ -3001,6 +3010,9 @@ fuse_thread_proc (void *data) priv->msg0_len_p = &iov_in[0].iov_len; for (;;) { + /* THIS has to be reset here */ + THIS = this; + if (priv->init_recvd) fuse_graph_sync (this); -- cgit