@@ -518,8 +518,7 @@ int gfs2_instantiate(struct gfs2_holder *gh)
518518 * do_promote - promote as many requests as possible on the current queue
519519 * @gl: The glock
520520 *
521- * Returns: 1 if there is a blocked holder at the head of the list, or 2
522- * if a type specific operation is underway.
521+ * Returns: 1 if there is a blocked holder at the head of the list
523522 */
524523
525524static int do_promote (struct gfs2_glock * gl )
@@ -627,7 +626,6 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
627626 const struct gfs2_glock_operations * glops = gl -> gl_ops ;
628627 struct gfs2_holder * gh ;
629628 unsigned state = ret & LM_OUT_ST_MASK ;
630- int rv ;
631629
632630 spin_lock (& gl -> gl_lockref .lock );
633631 trace_gfs2_glock_state_change (gl , state );
@@ -685,6 +683,8 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
685683 gfs2_demote_wake (gl );
686684 if (state != LM_ST_UNLOCKED ) {
687685 if (glops -> go_xmote_bh ) {
686+ int rv ;
687+
688688 spin_unlock (& gl -> gl_lockref .lock );
689689 rv = glops -> go_xmote_bh (gl );
690690 spin_lock (& gl -> gl_lockref .lock );
@@ -693,13 +693,10 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
693693 goto out ;
694694 }
695695 }
696- rv = do_promote (gl );
697- if (rv == 2 )
698- goto out_locked ;
696+ do_promote (gl );
699697 }
700698out :
701699 clear_bit (GLF_LOCK , & gl -> gl_flags );
702- out_locked :
703700 spin_unlock (& gl -> gl_lockref .lock );
704701}
705702
@@ -856,7 +853,6 @@ __releases(&gl->gl_lockref.lock)
856853__acquires (& gl - > gl_lockref .lock )
857854{
858855 struct gfs2_holder * gh = NULL ;
859- int ret ;
860856
861857 if (test_and_set_bit (GLF_LOCK , & gl -> gl_flags ))
862858 return ;
@@ -875,18 +871,14 @@ __acquires(&gl->gl_lockref.lock)
875871 } else {
876872 if (test_bit (GLF_DEMOTE , & gl -> gl_flags ))
877873 gfs2_demote_wake (gl );
878- ret = do_promote (gl );
879- if (ret == 0 )
874+ if (do_promote (gl ) == 0 )
880875 goto out_unlock ;
881- if (ret == 2 )
882- goto out ;
883876 gh = find_first_waiter (gl );
884877 gl -> gl_target = gh -> gh_state ;
885878 if (!(gh -> gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB )))
886879 do_error (gl , 0 ); /* Fail queued try locks */
887880 }
888881 do_xmote (gl , gh , gl -> gl_target );
889- out :
890882 return ;
891883
892884out_sched :
@@ -2213,29 +2205,6 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
22132205 glock_hash_walk (dump_glock_func , sdp );
22142206}
22152207
2216- void gfs2_glock_finish_truncate (struct gfs2_inode * ip )
2217- {
2218- struct gfs2_glock * gl = ip -> i_gl ;
2219- int ret ;
2220-
2221- ret = gfs2_truncatei_resume (ip );
2222- gfs2_glock_assert_withdraw (gl , ret == 0 );
2223-
2224- spin_lock (& gl -> gl_lockref .lock );
2225- clear_bit (GLF_LOCK , & gl -> gl_flags );
2226- run_queue (gl , 1 );
2227- wake_up_glock (gl );
2228- spin_unlock (& gl -> gl_lockref .lock );
2229- }
2230-
2231- void gfs2_wait_truncate (struct gfs2_inode * ip )
2232- {
2233- struct gfs2_glock * gl = ip -> i_gl ;
2234- wait_queue_head_t * wq = glock_waitqueue (& gl -> gl_name );
2235-
2236- wait_event (* wq , !(ip -> i_diskflags & GFS2_DIF_TRUNC_IN_PROG ));
2237- }
2238-
22392208static const char * state2str (unsigned state )
22402209{
22412210 switch (state ) {
0 commit comments