Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140312
b: refs/heads/master
c: 6800791
h: refs/heads/master
v: v3
  • Loading branch information
Sunil Mushran authored and Mark Fasheh committed Apr 3, 2009
1 parent 6b869ed commit f8582f1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2041d8fdcec7603401829f60810c1dbd5e96c043
refs/heads/master: 6800791ab773453bdec337efb3f0cec6557f3bb3
5 changes: 2 additions & 3 deletions trunk/fs/ocfs2/dlm/dlmcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ struct dlm_ctxt
/* these give a really vague idea of the system load */
atomic_t mle_tot_count[DLM_MLE_NUM_TYPES];
atomic_t mle_cur_count[DLM_MLE_NUM_TYPES];
atomic_t local_resources;
atomic_t remote_resources;
atomic_t unknown_resources;
atomic_t res_tot_count;
atomic_t res_cur_count;

struct dlm_debug_ctxt *dlm_debug_ctxt;
struct dentry *dlm_debugfs_subroot;
Expand Down
12 changes: 0 additions & 12 deletions trunk/fs/ocfs2/dlm/dlmdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,6 @@ static int debug_state_print(struct dlm_ctxt *dlm, struct debug_buffer *db)
int out = 0;
struct dlm_reco_node_data *node;
char *state;
int lres, rres, ures, tres;

lres = atomic_read(&dlm->local_resources);
rres = atomic_read(&dlm->remote_resources);
ures = atomic_read(&dlm->unknown_resources);
tres = lres + rres + ures;

spin_lock(&dlm->spinlock);

Expand Down Expand Up @@ -811,12 +805,6 @@ static int debug_state_print(struct dlm_ctxt *dlm, struct debug_buffer *db)
db->buf + out, db->len - out);
out += snprintf(db->buf + out, db->len - out, "\n");

/* Mastered Resources Total: xxx Locally: xxx Remotely: ... */
out += snprintf(db->buf + out, db->len - out,
"Mastered Resources Total: %d Locally: %d "
"Remotely: %d Unknown: %d\n",
tres, lres, rres, ures);

/* Lists: Dirty=Empty Purge=InUse PendingASTs=Empty ... */
out += snprintf(db->buf + out, db->len - out,
"Lists: Dirty=%s Purge=%s PendingASTs=%s "
Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/ocfs2/dlm/dlmdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,10 +1604,9 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain,

dlm->reco.new_master = O2NM_INVALID_NODE_NUM;
dlm->reco.dead_node = O2NM_INVALID_NODE_NUM;
atomic_set(&dlm->local_resources, 0);
atomic_set(&dlm->remote_resources, 0);
atomic_set(&dlm->unknown_resources, 0);

atomic_set(&dlm->res_tot_count, 0);
atomic_set(&dlm->res_cur_count, 0);
for (i = 0; i < DLM_MLE_NUM_TYPES; ++i) {
atomic_set(&dlm->mle_tot_count[i], 0);
atomic_set(&dlm->mle_cur_count[i], 0);
Expand Down
27 changes: 7 additions & 20 deletions trunk/fs/ocfs2/dlm/dlmmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,6 @@ static void dlm_set_lockres_owner(struct dlm_ctxt *dlm,
{
assert_spin_locked(&res->spinlock);

mlog_entry("%.*s, %u\n", res->lockname.len, res->lockname.name, owner);

if (owner == dlm->node_num)
atomic_inc(&dlm->local_resources);
else if (owner == DLM_LOCK_RES_OWNER_UNKNOWN)
atomic_inc(&dlm->unknown_resources);
else
atomic_inc(&dlm->remote_resources);

res->owner = owner;
}

Expand All @@ -534,17 +525,8 @@ void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
{
assert_spin_locked(&res->spinlock);

if (owner == res->owner)
return;

if (res->owner == dlm->node_num)
atomic_dec(&dlm->local_resources);
else if (res->owner == DLM_LOCK_RES_OWNER_UNKNOWN)
atomic_dec(&dlm->unknown_resources);
else
atomic_dec(&dlm->remote_resources);

dlm_set_lockres_owner(dlm, res, owner);
if (owner != res->owner)
dlm_set_lockres_owner(dlm, res, owner);
}


Expand Down Expand Up @@ -573,6 +555,8 @@ static void dlm_lockres_release(struct kref *kref)
}
spin_unlock(&dlm->track_lock);

atomic_dec(&dlm->res_cur_count);

dlm_put(dlm);

if (!hlist_unhashed(&res->hash_node) ||
Expand Down Expand Up @@ -653,6 +637,9 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm,

kref_init(&res->refs);

atomic_inc(&dlm->res_tot_count);
atomic_inc(&dlm->res_cur_count);

/* just for consistency */
spin_lock(&res->spinlock);
dlm_set_lockres_owner(dlm, res, DLM_LOCK_RES_OWNER_UNKNOWN);
Expand Down

0 comments on commit f8582f1

Please sign in to comment.