From 3c72850e8d00f0cf35ae054136be076a394e08e9 Mon Sep 17 00:00:00 2001 From: "M. Mohan Kumar" Date: Thu, 29 Nov 2012 21:46:07 +0530 Subject: BD Backend: CLI commands to create/delete image Cli commands added to create/delete a LV device. The following command creates lv in a given vg. $ gluster bd create :/ The following command deletes lv in a given vg. $ gluster bd delete :/ BUG: 805138 Change-Id: Ie4e100eca14e2ee32cf2bb4dd064b17230d673bf Signed-off-by: M. Mohan Kumar Reviewed-on: http://review.gluster.org/3718 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/xlator.c | 22 ++++++++++++++++++++++ libglusterfs/src/xlator.h | 1 + 2 files changed, 23 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 6db27e9a4..b42bc3bcc 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -344,6 +344,28 @@ out: return search; } +xlator_t * +xlator_search_by_xl_type (xlator_t *any, const char *type) +{ + xlator_t *search = NULL; + + GF_VALIDATE_OR_GOTO ("xlator", any, out); + GF_VALIDATE_OR_GOTO ("xlator", type, out); + + search = any; + + while (search->prev) + search = search->prev; + + while (search) { + if (!strcmp (search->type, type)) + break; + search = search->next; + } + +out: + return search; +} static int __xlator_init(xlator_t *xl) diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index ec58dc170..1e21b63c5 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -865,6 +865,7 @@ void xlator_foreach (xlator_t *this, void *data); xlator_t *xlator_search_by_name (xlator_t *any, const char *name); +xlator_t *xlator_search_by_xl_type (xlator_t *any, const char *type); void inode_destroy_notify (inode_t *inode, const char *xlname); -- cgit