Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180224
b: refs/heads/master
c: 8f05228
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Feb 3, 2010
1 parent d6ecfc0 commit ec41809
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 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: e402746a945ceb9d0486a8e3d5917c9228fa4404
refs/heads/master: 8f05228ee7c8f409ae3c6f9c3e13d7ccb9c18360
4 changes: 4 additions & 0 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
if (!gl)
return -ENOMEM;

atomic_inc(&sdp->sd_glock_disposal);
gl->gl_flags = 0;
gl->gl_name = name;
atomic_set(&gl->gl_ref, 1);
Expand Down Expand Up @@ -1538,6 +1539,9 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
up_write(&gfs2_umount_flush_sem);
msleep(10);
}
flush_workqueue(glock_workqueue);
wait_event(sdp->sd_glock_wait, atomic_read(&sdp->sd_glock_disposal) == 0);
gfs2_dump_lockstate(sdp);
}

void gfs2_glock_finish_truncate(struct gfs2_inode *ip)
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 @@ -123,7 +123,7 @@ struct lm_lockops {
int (*lm_mount) (struct gfs2_sbd *sdp, const char *fsname);
void (*lm_unmount) (struct gfs2_sbd *sdp);
void (*lm_withdraw) (struct gfs2_sbd *sdp);
void (*lm_put_lock) (struct kmem_cache *cachep, void *gl);
void (*lm_put_lock) (struct kmem_cache *cachep, struct gfs2_glock *gl);
unsigned int (*lm_lock) (struct gfs2_glock *gl,
unsigned int req_state, unsigned int flags);
void (*lm_cancel) (struct gfs2_glock *gl);
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/gfs2/lock_dlm.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,16 @@ static unsigned int gdlm_lock(struct gfs2_glock *gl,
return LM_OUT_ASYNC;
}

static void gdlm_put_lock(struct kmem_cache *cachep, void *ptr)
static void gdlm_put_lock(struct kmem_cache *cachep, struct gfs2_glock *gl)
{
struct gfs2_glock *gl = ptr;
struct gfs2_sbd *sdp = gl->gl_sbd;
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
int error;

if (gl->gl_lksb.sb_lkid == 0) {
kmem_cache_free(cachep, gl);
if (atomic_dec_and_test(&sdp->sd_glock_disposal))
wake_up(&sdp->sd_glock_wait);
return;
}

Expand All @@ -187,7 +188,6 @@ static void gdlm_put_lock(struct kmem_cache *cachep, void *ptr)
(unsigned long long)gl->gl_name.ln_number, error);
return;
}
atomic_inc(&sdp->sd_glock_disposal);
}

static void gdlm_cancel(struct gfs2_glock *gl)
Expand Down
10 changes: 9 additions & 1 deletion trunk/fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,9 +985,17 @@ static const match_table_t nolock_tokens = {
{ Opt_err, NULL },
};

static void nolock_put_lock(struct kmem_cache *cachep, struct gfs2_glock *gl)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
kmem_cache_free(cachep, gl);
if (atomic_dec_and_test(&sdp->sd_glock_disposal))
wake_up(&sdp->sd_glock_wait);
}

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

Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/gfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,6 @@ static void gfs2_put_super(struct super_block *sb)
gfs2_jindex_free(sdp);
/* Take apart glock structures and buffer lists */
gfs2_gl_hash_clear(sdp);
/* Wait for dlm to reply to all our unlock requests */
wait_event(sdp->sd_glock_wait, atomic_read(&sdp->sd_glock_disposal) == 0);
/* Unmount the locking protocol */
gfs2_lm_unmount(sdp);

Expand Down

0 comments on commit ec41809

Please sign in to comment.