Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38848
b: refs/heads/master
c: a5e08a9
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Sep 9, 2006
1 parent 96bcc28 commit f822931
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 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: 087efdd391f47305dc251a7b00dcc5d69e8c636a
refs/heads/master: a5e08a9ef50e8b6feb099f8e4b253df04f5ec9db
30 changes: 12 additions & 18 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,26 +1494,20 @@ int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,

static int glock_compare(const void *arg_a, const void *arg_b)
{
struct gfs2_holder *gh_a = *(struct gfs2_holder **)arg_a;
struct gfs2_holder *gh_b = *(struct gfs2_holder **)arg_b;
struct lm_lockname *a = &gh_a->gh_gl->gl_name;
struct lm_lockname *b = &gh_b->gh_gl->gl_name;
int ret = 0;
const struct gfs2_holder *gh_a = *(const struct gfs2_holder **)arg_a;
const struct gfs2_holder *gh_b = *(const struct gfs2_holder **)arg_b;
const struct lm_lockname *a = &gh_a->gh_gl->gl_name;
const struct lm_lockname *b = &gh_b->gh_gl->gl_name;

if (a->ln_number > b->ln_number)
ret = 1;
else if (a->ln_number < b->ln_number)
ret = -1;
else {
if (gh_a->gh_state == LM_ST_SHARED &&
gh_b->gh_state == LM_ST_EXCLUSIVE)
ret = 1;
else if (!(gh_a->gh_flags & GL_LOCAL_EXCL) &&
(gh_b->gh_flags & GL_LOCAL_EXCL))
ret = 1;
}

return ret;
return 1;
if (a->ln_number < b->ln_number)
return -1;
if (gh_a->gh_state == LM_ST_SHARED && gh_b->gh_state == LM_ST_EXCLUSIVE)
return 1;
if (!(gh_a->gh_flags & GL_LOCAL_EXCL) && (gh_b->gh_flags & GL_LOCAL_EXCL))
return 1;
return 0;
}

/**
Expand Down

0 comments on commit f822931

Please sign in to comment.