summaryrefslogtreecommitdiffstats
path: root/api/src/glfs.h
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2014-05-12 15:46:57 +0530
committerNiels de Vos <ndevos@redhat.com>2014-05-12 08:14:52 -0700
commit0c87b67ba9659a2d029d8136835331301b7b6ceb (patch)
treee5240e57b3dfe55ef312aa9aa315e90e023347d2 /api/src/glfs.h
parent29a5a7642d1762f2336ef8e89b81039e25810e1a (diff)
libgfapi: Added support to fetch volume info from glusterd and store in glfs object.
Defined new APIs in the libgfapi module, given a glfs object, * to send handshake RPC call to glusterd process to fetch UUID of the volume * store it in the glusterfs_context linked to the glfs object. * to parse UUID from its cannonical string format into 16-byte array before sending it to the libgfapi users. Defined a RPC call in glusterd which can be used to query volume related info by other processes using 'clnt_handshake_procs'. Note - Currently this RPC call to glusterd process is used only to fetch UUID. But it can be extended to get other volume related structures as well. In addition to the above, defined a new variable to keep track of such handshake RPCs still in progress to make sure all the corresponding RPC callbacks have been processed before libgfapi returns the glfs object initialized. Also bumping up the GFAPI current version number since there is a new API "glfs_get_volume_id" defined and exposed by libgfapi as part of these changes. Cherry picked from commit 5adb10b9ac1c634334f29732e062b12d747ae8c5: > Change-Id: I303f76d7177d32d25bdb301b1dbcf5cd73f42807 > BUG: 1095775 > Signed-off-by: Soumya Koduri <skoduri@redhat.com> > Reviewed-on: http://review.gluster.org/7218 > Reviewed-by: Anand Avati <avati@redhat.com> > Reviewed-by: Harshavardhana <harsha@harshavardhana.net> > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Vijay Bellur <vbellur@redhat.com> This change differs a little from the patch in the master branch: - libgfapi in 3.5 does not have glfs_get_volfile(), so there were some merge conflicts resolved, - libgfapi in 3.5 is not versioned, the configure.ac changes related to the versioning have been skipped, - in the master branch only the XDR .x files are available, release-3.5 requires a manual re-generation of the relates .h and .c files. Change-Id: I52c32d0e69a52a7f4285f74164bca6fd83c4f3b3 BUG: 1095775 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/7741 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api/src/glfs.h')
-rw-r--r--api/src/glfs.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/api/src/glfs.h b/api/src/glfs.h
index 2210c26d34f..964422aab72 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -257,6 +257,38 @@ int glfs_init (glfs_t *fs);
int glfs_fini (glfs_t *fs);
+
+/*
+ SYNOPSIS
+
+ glfs_get_volumeid: Copy the Volume UUID stored in the glfs object fs.
+
+ DESCRIPTION
+
+ This function when invoked for the first time sends RPC call to the
+ the management server (glusterd) to fetch volume uuid and stores it
+ in the glusterfs_context linked to the glfs object fs which can be used
+ in the subsequent calls. Later it parses that UUID to convert it from
+ cannonical string format into an opaque byte array and copy it into
+ the volid array. Incase if either of the input parameters, volid or size,
+ is NULL, number of bytes required to copy the volume UUID is returned.
+
+ PARAMETERS
+
+ @fs: The 'virtual mount' object to be used to retrieve and store
+ volume's UUID.
+ @volid: Pointer to a place for the volume UUID to be stored
+ @size: Length of @volid
+
+ RETURN VALUES
+
+ -1 : Failure. @errno will be set with the type of failure.
+ Others : length of the volume UUID stored.
+*/
+
+int glfs_get_volumeid (struct glfs *fs, char *volid, size_t size);
+
+
/*
* FILE OPERATION
*