summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handler.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-03-03 23:07:23 +0000
committerRajesh Joseph <rjoseph@redhat.com>2014-03-07 04:30:44 -0800
commitb121434902d5839938045294cfdfe2a86e01a951 (patch)
treefed315406ccacf20bf13454a4d3601760c88fcad /xlators/mgmt/glusterd/src/glusterd-handler.c
parent44428343529bec83fab0e3519396471fc8f651b4 (diff)
glusterd/mgmt_v3 locks: Handling different entities with mgmt_v3_locks.
Within the same namespace allowing mgmt_v3 lock engine to handle entities of valid types. Postfixing the element's name with the entity type allows us to perform locking operations on different elements of different entitites at the same time. For example: A volume named test, will acquire a lock on the name test_vol, while a snap named test will acquire lock on the name test_snap, and thus be allowed to co-exist in the same namespace. Change-Id: I611d1a59b707e497d35a37bdca5a66e29a1b6f06 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7188 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index c0325f0a9..f0316e732 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -671,7 +671,7 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
goto out;
}
- ret = glusterd_mgmt_v3_lock (volname, MY_UUID);
+ ret = glusterd_mgmt_v3_lock (volname, MY_UUID, "vol");
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
"Unable to acquire lock for %s", volname);
@@ -722,7 +722,8 @@ out:
if (priv->op_version < 3)
glusterd_unlock (MY_UUID);
else {
- ret = glusterd_mgmt_v3_unlock (volname, MY_UUID);
+ ret = glusterd_mgmt_v3_unlock (volname, MY_UUID,
+ "vol");
if (ret)
gf_log (this->name, GF_LOG_ERROR,
"Unable to release lock for %s",
@@ -4070,7 +4071,8 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
if (peerinfo->connected) {
list_for_each_entry (volinfo, &conf->volumes, vol_list) {
ret = glusterd_mgmt_v3_unlock (volinfo->volname,
- peerinfo->uuid);
+ peerinfo->uuid,
+ "vol");
if (ret)
gf_log (this->name, GF_LOG_TRACE,
"Lock not released for %s",