/* There are only two requests that we are going to see in actual practise: LM_ST_SHARED and LM_ST_UNLOCKED  */
static void handle_callback(struct gfs2_glock *gl, unsigned int state, unsigned long delay)
/* There are only two requests that we are going to see in actual practise: LM_ST_SHARED and LM_ST_UNLOCKED  */
static void handle_callback(struct gfs2_glock *gl, unsigned int state, unsigned long delay)
{
	int bit = delay ? GLF_PENDING_DEMOTE : GLF_DEMOTE;
	set_bit(bit, &gl->gl_flags);
	if (gl->gl_demote_state == LM_ST_EXCLUSIVE) {
		gl->gl_demote_state = state;
		gl->gl_demote_time = jiffies;
	} else if (gl->gl_demote_state != LM_ST_UNLOCKED &&
			gl->gl_demote_state != state) {
		gl->gl_demote_state = LM_ST_UNLOCKED;
	}
	if (gl->gl_ops->go_callback)
		gl->gl_ops->go_callback(gl);
	trace_gfs2_demote_rq(gl);
}