GFS2: inline __gfs2_glock_schedule_for_reclaim
authorBob Peterson <rpeterso@redhat.com>
Thu, 9 Aug 2012 17:48:43 +0000 (12:48 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 24 Sep 2012 09:47:07 +0000 (10:47 +0100)
Since function gfs2_glock_schedule_for_reclaim is only two
significant lines, we can eliminate it, simplifying the code
and making it more readable.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glock.c

index 1ed81f40da0dc7c0cf1e71b6da268d5edce07ca7..67f3e42d4bd21fcf2eef8e27f4089233694c7657 100644 (file)
@@ -185,20 +185,6 @@ static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
        spin_unlock(&lru_lock);
 }
 
-/**
- * __gfs2_glock_schedule_for_reclaim - Add a glock to the reclaim list
- * @gl: the glock
- *
- * If the glock is demotable, then we add it (or move it) to the end
- * of the glock LRU list.
- */
-
-static void __gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl)
-{
-       if (demote_ok(gl))
-               gfs2_glock_add_to_lru(gl);
-}
-
 /**
  * gfs2_glock_put_nolock() - Decrement reference count on glock
  * @gl: The glock to put
@@ -1121,8 +1107,9 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
                    !test_bit(GLF_DEMOTE, &gl->gl_flags))
                        fast_path = 1;
        }
-       if (!test_bit(GLF_LFLUSH, &gl->gl_flags))
-               __gfs2_glock_schedule_for_reclaim(gl);
+       if (!test_bit(GLF_LFLUSH, &gl->gl_flags) && demote_ok(gl))
+               gfs2_glock_add_to_lru(gl);
+
        trace_gfs2_glock_queue(gh, 0);
        spin_unlock(&gl->gl_spin);
        if (likely(fast_path))