summaryrefslogtreecommitdiffstats
path: root/xlators/meta/src/cmdline-file.c
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-05-03 13:25:41 -0700
committerAnand Avati <avati@redhat.com>2014-05-05 17:29:59 -0700
commita05c579f1c3695c4ddead0a5cfc2c92422bd4f8f (patch)
tree769ad843f263d354bcf6ed544093ac562cc8b2f4 /xlators/meta/src/cmdline-file.c
parentf01626d5bad8eb0298897e90a124301008cdd0da (diff)
meta: print in json for stack/frames, cmdline and version
- Follow formatting rules based on RFC4627 - http://www.ietf.org/rfc/rfc4627.txt - Add checks for json in regression test meta.t Change-Id: I480d32ce042b202d3ed8939623c629a03b458551 BUG: 1089216 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7653 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/meta/src/cmdline-file.c')
-rw-r--r--xlators/meta/src/cmdline-file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/xlators/meta/src/cmdline-file.c b/xlators/meta/src/cmdline-file.c
index 1eded6d19b8..88411f2629b 100644
--- a/xlators/meta/src/cmdline-file.c
+++ b/xlators/meta/src/cmdline-file.c
@@ -26,22 +26,23 @@
static int
cmdline_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd)
{
- if (this->ctx->cmdlinestr)
- strprintf (strfd, "%s\n", this->ctx->cmdlinestr);
- return strfd->size;
+ if (this->ctx->cmdlinestr)
+ strprintf (strfd, "{ \n \"Cmdlinestr\": \"%s\"\n}",
+ this->ctx->cmdlinestr);
+ return strfd->size;
}
static struct meta_ops cmdline_file_ops = {
- .file_fill = cmdline_file_fill,
+ .file_fill = cmdline_file_fill,
};
int
meta_cmdline_file_hook (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *xdata)
+ dict_t *xdata)
{
- meta_ops_set (loc->inode, this, &cmdline_file_ops);
+ meta_ops_set (loc->inode, this, &cmdline_file_ops);
- return 0;
+ return 0;
}