diff options
author | Avra Sengupta <asengupt@redhat.com> | 2014-03-03 23:07:23 +0000 |
---|---|---|
committer | Rajesh Joseph <rjoseph@redhat.com> | 2014-03-07 04:30:44 -0800 |
commit | b121434902d5839938045294cfdfe2a86e01a951 (patch) | |
tree | fed315406ccacf20bf13454a4d3601760c88fcad /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 44428343529bec83fab0e3519396471fc8f651b4 (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-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 05e4b71a0..1666f5e4d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -2749,7 +2749,8 @@ glusterd_op_ac_lock (glusterd_op_sm_event_t *event, void *ctx) gf_log (this->name, GF_LOG_ERROR, "Unable to acquire volname"); else { - ret = glusterd_mgmt_v3_lock (volname, lock_ctx->uuid); + ret = glusterd_mgmt_v3_lock (volname, lock_ctx->uuid, + "vol"); if (ret) gf_log (this->name, GF_LOG_ERROR, "Unable to acquire lock for %s", @@ -2796,7 +2797,8 @@ glusterd_op_ac_unlock (glusterd_op_sm_event_t *event, void *ctx) gf_log (this->name, GF_LOG_ERROR, "Unable to acquire volname"); else { - ret = glusterd_mgmt_v3_unlock (volname, lock_ctx->uuid); + ret = glusterd_mgmt_v3_unlock (volname, lock_ctx->uuid, + "vol"); if (ret) gf_log (this->name, GF_LOG_ERROR, "Unable to release lock for %s", volname); @@ -4082,7 +4084,8 @@ glusterd_op_txn_complete (uuid_t *txn_id) "Unable to acquire volname"); if (volname) { - 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", |