Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38799
b: refs/heads/master
c: a2242db
h: refs/heads/master
i:
  38797: 313308e
  38795: 632e8c7
  38791: 1fcd786
  38783: 6d0c230
v: v3
  • Loading branch information
Steven Whitehouse committed Aug 24, 2006
1 parent 5f8fc43 commit d512456
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 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: 166afccd71fbb7bd758ab9fc770eef4924081077
refs/heads/master: a2242db0906445491d9ac50bfa756b0de0a25d45
24 changes: 5 additions & 19 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,9 @@ static void kill_glock(struct kref *kref)

int gfs2_glock_put(struct gfs2_glock *gl)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
struct gfs2_gl_hash_bucket *bucket = gl->gl_bucket;
int rv = 0;

mutex_lock(&sdp->sd_invalidate_inodes_mutex);

write_lock(&bucket->hb_lock);
if (kref_put(&gl->gl_ref, kill_glock)) {
list_del_init(&gl->gl_list);
Expand All @@ -166,8 +163,7 @@ int gfs2_glock_put(struct gfs2_glock *gl)
goto out;
}
write_unlock(&bucket->hb_lock);
out:
mutex_unlock(&sdp->sd_invalidate_inodes_mutex);
out:
return rv;
}

Expand Down Expand Up @@ -1964,19 +1960,18 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp,

static void scan_glock(struct gfs2_glock *gl)
{
if (gl->gl_ops == &gfs2_inode_glops)
goto out;

if (gfs2_glmutex_trylock(gl)) {
if (gl->gl_ops == &gfs2_inode_glops)
goto out;
if (queue_empty(gl, &gl->gl_holders) &&
gl->gl_state != LM_ST_UNLOCKED &&
demote_ok(gl))
goto out_schedule;
out:
gfs2_glmutex_unlock(gl);
}

out:
gfs2_glock_put(gl);

return;

out_schedule:
Expand Down Expand Up @@ -2070,16 +2065,7 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp, int wait)
t = jiffies;
}

/* invalidate_inodes() requires that the sb inodes list
not change, but an async completion callback for an
unlock can occur which does glock_put() which
can call iput() which will change the sb inodes list.
invalidate_inodes_mutex prevents glock_put()'s during
an invalidate_inodes() */

mutex_lock(&sdp->sd_invalidate_inodes_mutex);
invalidate_inodes(sdp->sd_vfs);
mutex_unlock(&sdp->sd_invalidate_inodes_mutex);
msleep(10);
}
}
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ struct gfs2_sbd {
struct gfs2_holder sd_live_gh;
struct gfs2_glock *sd_rename_gl;
struct gfs2_glock *sd_trans_gl;
struct mutex sd_invalidate_inodes_mutex;

/* Inode Stuff */

Expand Down
1 change: 0 additions & 1 deletion trunk/fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
INIT_LIST_HEAD(&sdp->sd_reclaim_list);
spin_lock_init(&sdp->sd_reclaim_lock);
init_waitqueue_head(&sdp->sd_reclaim_wq);
mutex_init(&sdp->sd_invalidate_inodes_mutex);

mutex_init(&sdp->sd_inum_mutex);
spin_lock_init(&sdp->sd_statfs_spin);
Expand Down

0 comments on commit d512456

Please sign in to comment.