summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/graph-print.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2019-04-12 07:55:04 +0530
committerAmar Tumballi <amarts@redhat.com>2019-05-06 13:57:44 +0000
commitdb9c31fcf57024abfdc7b35825409166f17d5aac (patch)
tree85a51adf6ec9289599475fb8d01a7badd46c8d91 /libglusterfs/src/graph-print.c
parente0dadeb3242a10827c6142f609c87d860b3ce546 (diff)
tests: validate volfile grammar - strings in volfile
* libglusterfs/graph-print: remove unused code updates: bz#1693692 Change-Id: Iae81bb6a3af5911c3da07ab8f1d8f58f27e06905 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs/src/graph-print.c')
-rw-r--r--libglusterfs/src/graph-print.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/libglusterfs/src/graph-print.c b/libglusterfs/src/graph-print.c
index 6531308c659..595d74330a1 100644
--- a/libglusterfs/src/graph-print.c
+++ b/libglusterfs/src/graph-print.c
@@ -36,25 +36,6 @@ gp_write_file(struct gf_printer *gp, char *buf, size_t len)
return len;
}
-static ssize_t
-gp_write_buf(struct gf_printer *gp, char *buf, size_t len)
-{
- struct iovec *iov = gp->priv;
-
- if (iov->iov_len < len) {
- gf_msg("graph-print", GF_LOG_ERROR, 0, LG_MSG_BUFFER_FULL,
- "buffer full");
-
- return -1;
- }
-
- memcpy(iov->iov_base, buf, len);
- iov->iov_base += len;
- iov->iov_len -= len;
-
- return len;
-}
-
static int
gpprintf(struct gf_printer *gp, const char *format, ...)
{
@@ -152,43 +133,3 @@ glusterfs_graph_print_file(FILE *file, glusterfs_graph_t *graph)
return glusterfs_graph_print(&gp, graph);
}
-
-char *
-glusterfs_graph_print_buf(glusterfs_graph_t *graph)
-{
- FILE *f = NULL;
- struct iovec iov = {
- 0,
- };
- int len = 0;
- char *buf = NULL;
- struct gf_printer gp = {.write = gp_write_buf, .priv = &iov};
-
- f = fopen("/dev/null", "a");
- if (!f) {
- gf_msg("graph-print", GF_LOG_ERROR, errno, LG_MSG_DIR_OP_FAILED,
- "cannot open /dev/null");
-
- return NULL;
- }
- len = glusterfs_graph_print_file(f, graph);
- fclose(f);
- if (len == -1)
- return NULL;
-
- buf = GF_CALLOC(1, len + 1, gf_common_mt_graph_buf);
- if (!buf) {
- return NULL;
- }
- iov.iov_base = buf;
- iov.iov_len = len;
-
- len = glusterfs_graph_print(&gp, graph);
- if (len == -1) {
- GF_FREE(buf);
-
- return NULL;
- }
-
- return buf;
-}