diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2014-03-04 16:53:33 +0000 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-03-05 21:29:42 -0800 |
commit | 1fbffa0aa45560889e29a74c4c6ff16d526de700 (patch) | |
tree | e723a7d539ba40812bdb98149ef2435d2ead175e /api/src/glfs-mgmt.c | |
parent | d6c1468b2779b6247e44b75276436021a3469a59 (diff) |
api: add glfs_get_volfile
From the API-header description:
> Sometimes it's useful e.g. for scripts to see the volfile, so that
> they can parse it and find subvolumes to do things like split-brain
> resolution or custom layouts. The API here was specifically intended
> to make access e.g. from Python as simple as possible.
>
> Note that the volume must be started (not necessarily mounted) for
> this to work.
Change-Id: If3f55ee9611cdf4b77aa53659f0af0d21957817d
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/7183
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'api/src/glfs-mgmt.c')
-rw-r--r-- | api/src/glfs-mgmt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c index afb351da03a..7f62fa259af 100644 --- a/api/src/glfs-mgmt.c +++ b/api/src/glfs-mgmt.c @@ -207,6 +207,8 @@ glusterfs_oldvolfile_update (struct glfs *fs, char *volfile, ssize_t size) { int ret = -1; + pthread_mutex_lock (&fs->mutex); + fs->oldvollen = size; if (!fs->oldvolfile) { fs->oldvolfile = GF_CALLOC (1, size+1, glfs_mt_volfile_t); @@ -222,6 +224,8 @@ glusterfs_oldvolfile_update (struct glfs *fs, char *volfile, ssize_t size) ret = 0; } + pthread_mutex_unlock (&fs->mutex); + return ret; } |