diff options
-rw-r--r-- | fs/gfs2/glock.c | 11 | ||||
-rw-r--r-- | fs/gfs2/incore.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 6cd71c50b8bd..c38ab6c81898 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -80,9 +80,9 @@ static struct rhashtable_params ht_parms = { | |||
80 | 80 | ||
81 | static struct rhashtable gl_hash_table; | 81 | static struct rhashtable gl_hash_table; |
82 | 82 | ||
83 | void gfs2_glock_free(struct gfs2_glock *gl) | 83 | static void gfs2_glock_dealloc(struct rcu_head *rcu) |
84 | { | 84 | { |
85 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; | 85 | struct gfs2_glock *gl = container_of(rcu, struct gfs2_glock, gl_rcu); |
86 | 86 | ||
87 | if (gl->gl_ops->go_flags & GLOF_ASPACE) { | 87 | if (gl->gl_ops->go_flags & GLOF_ASPACE) { |
88 | kmem_cache_free(gfs2_glock_aspace_cachep, gl); | 88 | kmem_cache_free(gfs2_glock_aspace_cachep, gl); |
@@ -90,6 +90,13 @@ void gfs2_glock_free(struct gfs2_glock *gl) | |||
90 | kfree(gl->gl_lksb.sb_lvbptr); | 90 | kfree(gl->gl_lksb.sb_lvbptr); |
91 | kmem_cache_free(gfs2_glock_cachep, gl); | 91 | kmem_cache_free(gfs2_glock_cachep, gl); |
92 | } | 92 | } |
93 | } | ||
94 | |||
95 | void gfs2_glock_free(struct gfs2_glock *gl) | ||
96 | { | ||
97 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; | ||
98 | |||
99 | call_rcu(&gl->gl_rcu, gfs2_glock_dealloc); | ||
93 | if (atomic_dec_and_test(&sdp->sd_glock_disposal)) | 100 | if (atomic_dec_and_test(&sdp->sd_glock_disposal)) |
94 | wake_up(&sdp->sd_glock_wait); | 101 | wake_up(&sdp->sd_glock_wait); |
95 | } | 102 | } |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 790e73984288..73fce76e67ee 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -373,6 +373,7 @@ struct gfs2_glock { | |||
373 | loff_t end; | 373 | loff_t end; |
374 | } gl_vm; | 374 | } gl_vm; |
375 | }; | 375 | }; |
376 | struct rcu_head gl_rcu; | ||
376 | struct rhash_head gl_node; | 377 | struct rhash_head gl_node; |
377 | }; | 378 | }; |
378 | 379 | ||