diff options
Diffstat (limited to 'api/src/glfs-master.c')
| -rw-r--r-- | api/src/glfs-master.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/api/src/glfs-master.c b/api/src/glfs-master.c index 969095a8224..100dcc16cc0 100644 --- a/api/src/glfs-master.c +++ b/api/src/glfs-master.c @@ -8,15 +8,9 @@ cases as published by the Free Software Foundation. */ -#include <unistd.h> -#include <string.h> -#include <stdlib.h> #include <stdio.h> -#include <inttypes.h> -#include <limits.h> -#include "xlator.h" -#include "glusterfs.h" +#include <glusterfs/glusterfs.h> #include "glfs-internal.h" #include "glfs-mem-types.h" @@ -81,9 +75,10 @@ notify(xlator_t *this, int event, void *data, ...) switch (event) { case GF_EVENT_GRAPH_NEW: - gf_msg(this->name, GF_LOG_INFO, 0, API_MSG_NEW_GRAPH, - "New graph %s (%d) coming up", - uuid_utoa((unsigned char *)graph->graph_uuid), graph->id); + gf_smsg(this->name, GF_LOG_INFO, 0, API_MSG_NEW_GRAPH, + "graph-uuid=%s", + uuid_utoa((unsigned char *)graph->graph_uuid), "id=%d", + graph->id, NULL); break; case GF_EVENT_CHILD_UP: pthread_mutex_lock(&fs->mutex); @@ -126,9 +121,8 @@ mem_acct_init(xlator_t *this) ret = xlator_mem_acct_init(this, glfs_mt_end + 1); if (ret) { - gf_msg(this->name, GF_LOG_ERROR, ENOMEM, API_MSG_MEM_ACCT_INIT_FAILED, - "Failed to initialise " - "memory accounting"); + gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, API_MSG_MEM_ACCT_INIT_FAILED, + NULL); return ret; } @@ -169,6 +163,21 @@ struct xlator_dumpops dumpops; struct xlator_fops fops; -struct xlator_cbks cbks = {.forget = glfs_forget, - .release = glfs_release, - .releasedir = glfs_releasedir}; +struct xlator_cbks cbks = { + .forget = glfs_forget, + .release = glfs_release, + .releasedir = glfs_releasedir, +}; + +xlator_api_t xlator_api = { + .init = init, + .fini = fini, + .notify = notify, + .mem_acct_init = mem_acct_init, + .op_version = {1}, + .dumpops = &dumpops, + .fops = &fops, + .cbks = &cbks, + .identifier = "glfs-api", + .category = GF_MAINTAINED, +}; |
