]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: set timestamp in MDS requests
authorSage Weil <sage@inktank.com>
Mon, 19 May 2014 22:36:14 +0000 (15:36 -0700)
committerSage Weil <sage@inktank.com>
Mon, 19 May 2014 23:23:18 +0000 (16:23 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc
src/client/MetaRequest.h

index 95b23b90d778af5c822647ba6493d06a8d87ee6c..1254dcf6e898b1e574a1a476c9e1c5b2e0470293 100644 (file)
@@ -1356,6 +1356,10 @@ int Client::make_request(MetaRequest *request,
   // assign a unique tid
   ceph_tid_t tid = ++last_tid;
   request->set_tid(tid);
+
+  // and timestamp
+  request->op_stamp = ceph_clock_now(NULL);
+
   // make note
   mds_requests[tid] = request->get();
   if (uid < 0) {
@@ -1740,6 +1744,7 @@ MClientRequest* Client::build_client_request(MetaRequest *request)
 {
   MClientRequest *req = new MClientRequest(request->get_op());
   req->set_tid(request->tid);
+  req->set_stamp(request->op_stamp);
   memcpy(&req->head, &request->head, sizeof(ceph_mds_request_head));
 
   // if the filepath's haven't been set, set them!
index 45a90dc02083c96fb289f57e22408a0b8bb6ad59..b7a8a394df30d6968313a19fdd22e153ff073d02 100644 (file)
@@ -27,6 +27,7 @@ private:
   Dentry *_old_dentry; //associated with path2
 public:
   uint64_t tid;
+  utime_t  op_stamp;
   ceph_mds_request_head head;
   filepath path, path2;
   bufferlist data;
@@ -75,7 +76,7 @@ public:
 
   Inode *target;
 
-  MetaRequest(int op) : 
+  MetaRequest(int op) :
     _inode(NULL), _old_inode(NULL), _other_inode(NULL),
     _dentry(NULL), _old_dentry(NULL),
     tid(0),