Skip to content

Commit

Permalink
mds: minor refactor of SimpleLock
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit e9be29c)
  • Loading branch information
batrick committed Feb 20, 2018
1 parent 802800e commit cd12e7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/mds/SimpleLock.cc
Expand Up @@ -24,9 +24,8 @@ void SimpleLock::dump(Formatter *f) const {

f->open_array_section("gather_set");
if (have_more()) {
for(std::set<int32_t>::iterator i = more()->gather_set.begin();
i != more()->gather_set.end(); ++i) {
f->dump_int("rank", *i);
for(const auto &i : more()->gather_set) {
f->dump_int("rank", i);
}
}
f->close_section();
Expand Down
12 changes: 4 additions & 8 deletions src/mds/SimpleLock.h
Expand Up @@ -182,10 +182,10 @@ class SimpleLock {
set<__s32> gather_set; // auth+rep. >= 0 is mds, < 0 is client

// local state
int num_wrlock, num_xlock;
int num_wrlock = 0, num_xlock = 0;
MutationRef xlock_by;
client_t xlock_by_client;
client_t excl_client;
client_t xlock_by_client = -1;
client_t excl_client = -1;

bool empty() {
return
Expand All @@ -197,11 +197,7 @@ class SimpleLock {
excl_client == -1;
}

unstable_bits_t() : num_wrlock(0),
num_xlock(0),
xlock_by(),
xlock_by_client(-1),
excl_client(-1) {}
unstable_bits_t() {}
};

mutable std::unique_ptr<unstable_bits_t> _unstable;
Expand Down

0 comments on commit cd12e7a

Please sign in to comment.