Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38837
b: refs/heads/master
c: b854785
h: refs/heads/master
i:
  38835: 33d7f71
v: v3
  • Loading branch information
Steven Whitehouse committed Sep 7, 2006
1 parent 766b6f0 commit 29cf625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: 62f140c173f2c85e15527eefc6e2fb3c37a97eb1
refs/heads/master: b8547856f9c158ff70effbcfd15969c908fbe1b3
8 changes: 5 additions & 3 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ static inline int relaxed_state_ok(unsigned int actual, unsigned requested,
* Returns: The number of the corresponding hash bucket
*/

static unsigned int gl_hash(const struct lm_lockname *name)
static unsigned int gl_hash(const struct gfs2_sbd *sdp,
const struct lm_lockname *name)
{
unsigned int h;

h = jhash(&name->ln_number, sizeof(u64), 0);
h = jhash(&name->ln_type, sizeof(unsigned int), h);
h = jhash(&sdp, sizeof(struct gfs2_sbd *), h);
h &= GFS2_GL_HASH_MASK;

return h;
Expand Down Expand Up @@ -232,7 +234,7 @@ static struct gfs2_glock *search_bucket(struct gfs2_gl_hash_bucket *bucket,
static struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp,
const struct lm_lockname *name)
{
struct gfs2_gl_hash_bucket *bucket = &sdp->sd_gl_hash[gl_hash(name)];
struct gfs2_gl_hash_bucket *bucket = &sdp->sd_gl_hash[gl_hash(sdp, name)];
struct gfs2_glock *gl;

read_lock(&bucket->hb_lock);
Expand Down Expand Up @@ -266,7 +268,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,

name.ln_number = number;
name.ln_type = glops->go_type;
bucket = &sdp->sd_gl_hash[gl_hash(&name)];
bucket = &sdp->sd_gl_hash[gl_hash(sdp, &name)];

read_lock(&bucket->hb_lock);
gl = search_bucket(bucket, sdp, &name);
Expand Down

0 comments on commit 29cf625

Please sign in to comment.