From: Sage Weil Date: Thu, 9 Jul 2009 22:35:22 +0000 (-0700) Subject: mds: add tid to cap flush/flushsnap ops X-Git-Tag: v0.10~46 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6d95e290aadfa39aa14a359d5fe795a9b185ce74;p=ceph.git mds: add tid to cap flush/flushsnap ops And include in the ACK. --- diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h index a01e1660adc..5469eaf6f2c 100644 --- a/src/include/ceph_fs.h +++ b/src/include/ceph_fs.h @@ -27,7 +27,7 @@ #define CEPH_MDS_PROTOCOL 9 /* cluster internal */ #define CEPH_MON_PROTOCOL 4 /* cluster internal */ #define CEPH_OSDC_PROTOCOL 19 /* public/client */ -#define CEPH_MDSC_PROTOCOL 24 /* public/client */ +#define CEPH_MDSC_PROTOCOL 25 /* public/client */ #define CEPH_MONC_PROTOCOL 14 /* public/client */ @@ -802,6 +802,7 @@ struct ceph_mds_caps { __le64 snap_follows; __le32 snap_trace_len; __le32 ttl_ms; /* for IMPORT op only */ + __le64 client_tid; /* for FLUSH(SNAP) -> FLUSH(SNAP)_ACK */ /* authlock */ __le32 uid, gid, mode; diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index a8c4882d683..3183a7e76ac 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1649,6 +1649,7 @@ void Locker::handle_client_caps(MClientCaps *m) if (m->get_dirty()) { ack = new MClientCaps(CEPH_CAP_OP_FLUSHSNAP_ACK, in->ino(), 0, 0, 0, 0, 0, m->get_dirty(), 0); ack->set_snap_follows(follows); + ack->set_client_tid(m->get_client_tid()); } if (!_do_cap_update(in, cap, m->get_dirty(), 0, follows, m, ack)) { if (ack) @@ -1680,6 +1681,7 @@ void Locker::handle_client_caps(MClientCaps *m) << " seq " << m->get_seq() << " on " << *in << dendl; ack = new MClientCaps(CEPH_CAP_OP_FLUSH_ACK, in->ino(), 0, cap->get_cap_id(), m->get_seq(), m->get_caps(), 0, m->get_dirty(), 0); + ack->set_client_tid(m->get_client_tid()); } int new_wanted = m->get_wanted() & head_in->get_caps_allowed_ever(); if (new_wanted != cap->wanted()) { diff --git a/src/messages/MClientCaps.h b/src/messages/MClientCaps.h index 64e30855af7..a39b098ad46 100644 --- a/src/messages/MClientCaps.h +++ b/src/messages/MClientCaps.h @@ -49,6 +49,9 @@ class MClientCaps : public Message { int get_migrate_seq() { return head.migrate_seq; } int get_op() { return head.op; } + __u64 get_client_tid() { return head.client_tid; } + void set_client_tid(__u64 s) { head.client_tid = s; } + snapid_t get_snap_follows() { return snapid_t(head.snap_follows); } void set_snap_follows(snapid_t s) { head.snap_follows = s; }