summaryrefslogtreecommitdiff
path: root/src/messages
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2011-07-08 09:30:29 -0700
committerSage Weil <sage.weil@dreamhost.com>2011-07-08 09:48:00 -0700
commit025748a69586bbf0615b32b9a4a30effe0ade6da (patch)
tree66e682ef966f5496c2b7a62e47dc59497f2d6987 /src/messages
parent4d5b05380e1b683185dd8918942973f10bbb96ae (diff)
downloadceph-025748a69586bbf0615b32b9a4a30effe0ade6da.tar.gz
mds: implement remote_wrlock
For the rename code to behave, we need to hold a wrlock on the slave node to ensure that any racing gather (mix->lock) is not sent prior to the _rename_prepare() running; otherwise we violate the locking rules and corrupt rstats. Implement a remote_wrlock that will be used by rename. The wrlock is held on a remote node instead of the local node, and is set up similarly to remote_xlocks. Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/messages')
-rw-r--r--src/messages/MMDSSlaveRequest.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/messages/MMDSSlaveRequest.h b/src/messages/MMDSSlaveRequest.h
index bb21d9ebae2..855088755b2 100644
--- a/src/messages/MMDSSlaveRequest.h
+++ b/src/messages/MMDSSlaveRequest.h
@@ -34,6 +34,10 @@ class MMDSSlaveRequest : public Message {
static const int OP_RENAMEPREP = 7;
static const int OP_RENAMEPREPACK = -7;
+ static const int OP_WRLOCK = 8;
+ static const int OP_WRLOCKACK = -8;
+ static const int OP_UNWRLOCK = 9;
+
static const int OP_FINISH = 17;
static const int OP_COMMITTED = -18;
@@ -59,6 +63,10 @@ class MMDSSlaveRequest : public Message {
case OP_FINISH: return "finish"; // commit
case OP_COMMITTED: return "committed";
+ case OP_WRLOCK: return "wrlock";
+ case OP_WRLOCKACK: return "wrlock_ack";
+ case OP_UNWRLOCK: return "unwrlock";
+
case OP_ABORT: return "abort";
//case OP_COMMIT: return "commit";