summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mds/Locker.cc11
-rw-r--r--src/messages/MInodeFileCaps.h8
2 files changed, 7 insertions, 12 deletions
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index bfe2fe34244..a39c3c19425 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -1771,8 +1771,7 @@ void Locker::request_inode_file_caps(CInode *in)
in->replica_caps_wanted = wanted;
if (mds->mdsmap->get_state(auth) >= MDSMap::STATE_REJOIN)
- mds->send_message_mds(new MInodeFileCaps(in->ino(), mds->get_nodeid(),
- in->replica_caps_wanted),
+ mds->send_message_mds(new MInodeFileCaps(in->ino(), in->replica_caps_wanted),
auth);
} else {
in->replica_caps_wanted_keep_until.sec_ref() = 0;
@@ -1787,6 +1786,8 @@ void Locker::handle_inode_file_caps(MInodeFileCaps *m)
// ok
CInode *in = mdcache->get_inode(m->get_ino());
+ int from = m->get_source().num();
+
assert(in);
assert(in->is_auth());
@@ -1798,12 +1799,12 @@ void Locker::handle_inode_file_caps(MInodeFileCaps *m)
}
- dout(7) << "handle_inode_file_caps replica mds" << m->get_from() << " wants caps " << ccap_string(m->get_caps()) << " on " << *in << dendl;
+ dout(7) << "handle_inode_file_caps replica mds" << from << " wants caps " << ccap_string(m->get_caps()) << " on " << *in << dendl;
if (m->get_caps())
- in->mds_caps_wanted[m->get_from()] = m->get_caps();
+ in->mds_caps_wanted[from] = m->get_caps();
else
- in->mds_caps_wanted.erase(m->get_from());
+ in->mds_caps_wanted.erase(from);
try_eval(in, CEPH_CAP_LOCKS);
m->put();
diff --git a/src/messages/MInodeFileCaps.h b/src/messages/MInodeFileCaps.h
index bbe3707736e..0568303b215 100644
--- a/src/messages/MInodeFileCaps.h
+++ b/src/messages/MInodeFileCaps.h
@@ -18,20 +18,16 @@
class MInodeFileCaps : public Message {
inodeno_t ino;
- __s32 from;
__u32 caps;
public:
inodeno_t get_ino() { return ino; }
- int get_from() { return from; }
int get_caps() { return caps; }
MInodeFileCaps() {}
- // from auth
- MInodeFileCaps(inodeno_t ino, int from, int caps) :
+ MInodeFileCaps(inodeno_t ino, int caps) :
Message(MSG_MDS_INODEFILECAPS) {
this->ino = ino;
- this->from = from;
this->caps = caps;
}
private:
@@ -44,13 +40,11 @@ public:
}
void encode_payload(CephContext *cct) {
- ::encode(from, payload);
::encode(ino, payload);
::encode(caps, payload);
}
void decode_payload(CephContext *cct) {
bufferlist::iterator p = payload.begin();
- ::decode(from, p);
::decode(ino, p);
::decode(caps, p);
}