@@ -65,7 +65,6 @@ static void request_demote(struct gfs2_glock *gl, unsigned int state,
65
65
unsigned long delay , bool remote );
66
66
67
67
static struct dentry * gfs2_root ;
68
- static struct workqueue_struct * glock_workqueue ;
69
68
static LIST_HEAD (lru_list );
70
69
static atomic_t lru_count = ATOMIC_INIT (0 );
71
70
static DEFINE_SPINLOCK (lru_lock );
@@ -274,7 +273,9 @@ static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
274
273
* work queue.
275
274
*/
276
275
static void gfs2_glock_queue_work (struct gfs2_glock * gl , unsigned long delay ) {
277
- if (!queue_delayed_work (glock_workqueue , & gl -> gl_work , delay )) {
276
+ struct gfs2_sbd * sdp = gl -> gl_name .ln_sbd ;
277
+
278
+ if (!queue_delayed_work (sdp -> sd_glock_wq , & gl -> gl_work , delay )) {
278
279
/*
279
280
* We are holding the lockref spinlock, and the work was still
280
281
* queued above. The queued work (glock_work_func) takes that
@@ -2252,9 +2253,10 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
2252
2253
bool timed_out = false;
2253
2254
2254
2255
set_bit (SDF_SKIP_DLM_UNLOCK , & sdp -> sd_flags );
2255
- flush_workqueue (glock_workqueue );
2256
+ flush_workqueue (sdp -> sd_glock_wq );
2256
2257
glock_hash_walk (clear_glock , sdp );
2257
- flush_workqueue (glock_workqueue );
2258
+ flush_workqueue (sdp -> sd_glock_wq );
2259
+
2258
2260
while (!timed_out ) {
2259
2261
wait_event_timeout (sdp -> sd_kill_wait ,
2260
2262
!atomic_read (& sdp -> sd_glock_disposal ),
@@ -2270,6 +2272,7 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
2270
2272
gfs2_lm_unmount (sdp );
2271
2273
gfs2_free_dead_glocks (sdp );
2272
2274
glock_hash_walk (dump_glock_func , sdp );
2275
+ destroy_workqueue (sdp -> sd_glock_wq );
2273
2276
}
2274
2277
2275
2278
static const char * state2str (unsigned state )
@@ -2534,16 +2537,8 @@ int __init gfs2_glock_init(void)
2534
2537
if (ret < 0 )
2535
2538
return ret ;
2536
2539
2537
- glock_workqueue = alloc_workqueue ("glock_workqueue" , WQ_MEM_RECLAIM |
2538
- WQ_HIGHPRI | WQ_FREEZABLE , 0 );
2539
- if (!glock_workqueue ) {
2540
- rhashtable_destroy (& gl_hash_table );
2541
- return - ENOMEM ;
2542
- }
2543
-
2544
2540
glock_shrinker = shrinker_alloc (0 , "gfs2-glock" );
2545
2541
if (!glock_shrinker ) {
2546
- destroy_workqueue (glock_workqueue );
2547
2542
rhashtable_destroy (& gl_hash_table );
2548
2543
return - ENOMEM ;
2549
2544
}
@@ -2563,7 +2558,6 @@ void gfs2_glock_exit(void)
2563
2558
{
2564
2559
shrinker_free (glock_shrinker );
2565
2560
rhashtable_destroy (& gl_hash_table );
2566
- destroy_workqueue (glock_workqueue );
2567
2561
}
2568
2562
2569
2563
static void gfs2_glock_iter_next (struct gfs2_glock_iter * gi , loff_t n )
0 commit comments