Skip to content

Commit

Permalink
Merge pull request #11455 from stiopaa1/mds_mutation_simplifyConstruc…
Browse files Browse the repository at this point in the history
…tors

mds/Mutation.h: simplify constructors

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
John Spray committed Oct 20, 2016
2 parents b59e7f9 + ece4776 commit 6345036
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions src/mds/Mutation.h
Expand Up @@ -38,16 +38,16 @@ class MMDSSlaveRequest;

struct MutationImpl {
metareqid_t reqid;
__u32 attempt; // which attempt for this request
LogSegment *ls; // the log segment i'm committing to
__u32 attempt = 0; // which attempt for this request
LogSegment *ls = nullptr; // the log segment i'm committing to

private:
utime_t mds_stamp; ///< mds-local timestamp (real time)
utime_t op_stamp; ///< op timestamp (client provided)

public:
// flag mutation as slave
mds_rank_t slave_to_mds; // this is a slave request if >= 0.
mds_rank_t slave_to_mds = MDS_RANK_NONE; // this is a slave request if >= 0.

// -- my pins and locks --
// cache pins (so things don't expire)
Expand All @@ -67,15 +67,15 @@ struct MutationImpl {

// lock we are currently trying to acquire. if we give up for some reason,
// be sure to eval() this.
SimpleLock *locking;
mds_rank_t locking_target_mds;
SimpleLock *locking = nullptr;
mds_rank_t locking_target_mds = -1;

// if this flag is set, do not attempt to acquire further locks.
// (useful for wrlock, which may be a moving auth target)
bool done_locking;
bool committing;
bool aborted;
bool killed;
bool done_locking = false;
bool committing = false;
bool aborted = false;
bool killed = false;

// for applying projected inode changes
list<CInode*> projected_inodes;
Expand All @@ -86,20 +86,10 @@ struct MutationImpl {
list<pair<CDentry*,version_t> > dirty_cow_dentries;

// keep our default values synced with MDRequestParam's
MutationImpl()
: attempt(0),
ls(0),
slave_to_mds(MDS_RANK_NONE),
locking(NULL),
locking_target_mds(-1),
done_locking(false), committing(false), aborted(false), killed(false) { }
MutationImpl() = default;
MutationImpl(metareqid_t ri, __u32 att=0, mds_rank_t slave_to=MDS_RANK_NONE)
: reqid(ri), attempt(att),
ls(0),
slave_to_mds(slave_to),
locking(NULL),
locking_target_mds(-1),
done_locking(false), committing(false), aborted(false), killed(false) { }
slave_to_mds(slave_to) { }
virtual ~MutationImpl() {
assert(locking == NULL);
assert(pins.empty());
Expand Down

0 comments on commit 6345036

Please sign in to comment.