Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mds/Mutation.h: simplify constructors #11455

Merged
merged 1 commit into from Oct 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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