From e4c9c34136d057276b928f50099055a831eda8db Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 20 May 2014 14:50:46 -0700 Subject: [PATCH] mds: add {mds,op}_stamp to Mutation With getters, setters. Signed-off-by: Sage Weil --- src/mds/Mutation.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index 2f192668104b0..9dadfc98f5ca6 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -41,6 +41,11 @@ struct MutationImpl { LogSegment *ls; // the log segment i'm committing to utime_t now; +private: + utime_t mds_stamp; ///< mds-local timestamp (real time) + utime_t op_stamp; ///< op timestamp (client provided) + +public: // flag mutation as slave int slave_to_mds; // this is a slave request if >= 0. @@ -114,6 +119,21 @@ struct MutationImpl { return -1; } + void set_mds_stamp(utime_t t) { + mds_stamp = t; + } + utime_t get_mds_stamp() const { + return mds_stamp; + } + void set_op_stamp(utime_t t) { + op_stamp = t; + } + utime_t get_op_stamp() const { + if (op_stamp != utime_t()) + return op_stamp; + return get_mds_stamp(); + } + // pin items in cache void pin(MDSCacheObject *o); void unpin(MDSCacheObject *o); -- 2.39.5