Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235059
b: refs/heads/master
c: fc0e38d
h: refs/heads/master
i:
  235057: 01aad58
  235055: 75ce7f1
v: v3
  • Loading branch information
Steven Whitehouse committed Mar 9, 2011
1 parent 5501e20 commit cbe172b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 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: 662e3a551b468c7338f5291d7a00389fe85885e2
refs/heads/master: fc0e38dae645f65424d1fb5d2a938aab8ce48a58
10 changes: 8 additions & 2 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,21 @@ static inline void spin_unlock_bucket(unsigned int hash)
__bit_spin_unlock(0, (unsigned long *)bl);
}

void gfs2_glock_free(struct rcu_head *rcu)
static void gfs2_glock_dealloc(struct rcu_head *rcu)
{
struct gfs2_glock *gl = container_of(rcu, struct gfs2_glock, gl_rcu);
struct gfs2_sbd *sdp = gl->gl_sbd;

if (gl->gl_ops->go_flags & GLOF_ASPACE)
kmem_cache_free(gfs2_glock_aspace_cachep, gl);
else
kmem_cache_free(gfs2_glock_cachep, gl);
}

void gfs2_glock_free(struct gfs2_glock *gl)
{
struct gfs2_sbd *sdp = gl->gl_sbd;

call_rcu(&gl->gl_rcu, gfs2_glock_dealloc);
if (atomic_dec_and_test(&sdp->sd_glock_disposal))
wake_up(&sdp->sd_glock_wait);
}
Expand Down Expand Up @@ -760,6 +765,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
if (tmp) {
spin_unlock_bucket(hash);
kmem_cache_free(cachep, gl);
atomic_dec(&sdp->sd_glock_disposal);
gl = tmp;
} else {
hlist_bl_add_head_rcu(&gl->gl_list, &gl_hash_table[hash]);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/glock.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ extern void gfs2_gl_hash_clear(struct gfs2_sbd *sdp);
extern void gfs2_glock_finish_truncate(struct gfs2_inode *ip);
extern void gfs2_glock_thaw(struct gfs2_sbd *sdp);
extern void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl);
extern void gfs2_glock_free(struct rcu_head *rcu);
extern void gfs2_glock_free(struct gfs2_glock *gl);

extern int __init gfs2_glock_init(void);
extern void gfs2_glock_exit(void);
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/gfs2/lock_dlm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void gdlm_ast(void *arg)

switch (gl->gl_lksb.sb_status) {
case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */
call_rcu(&gl->gl_rcu, gfs2_glock_free);
gfs2_glock_free(gl);
return;
case -DLM_ECANCEL: /* Cancel while getting lock */
ret |= LM_OUT_CANCELED;
Expand Down Expand Up @@ -165,7 +165,7 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
int error;

if (gl->gl_lksb.sb_lkid == 0) {
call_rcu(&gl->gl_rcu, gfs2_glock_free);
gfs2_glock_free(gl);
return;
}

Expand Down
7 changes: 1 addition & 6 deletions trunk/fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,14 +928,9 @@ static const match_table_t nolock_tokens = {
{ Opt_err, NULL },
};

static void nolock_put_lock(struct gfs2_glock *gl)
{
call_rcu(&gl->gl_rcu, gfs2_glock_free);
}

static const struct lm_lockops nolock_ops = {
.lm_proto_name = "lock_nolock",
.lm_put_lock = nolock_put_lock,
.lm_put_lock = gfs2_glock_free,
.lm_tokens = &nolock_tokens,
};

Expand Down

0 comments on commit cbe172b

Please sign in to comment.