]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/gfs2/glock.c
mm: add context argument to shrinker callback
[net-next-2.6.git] / fs / gfs2 / glock.c
index 454d4b4eb36ba7f5b12111cd86730eef90ddc65c..0898f3ec8212e5599df8c547d7d106aeb15d6c86 100644 (file)
@@ -706,8 +706,18 @@ static void glock_work_func(struct work_struct *work)
 {
        unsigned long delay = 0;
        struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work);
+       struct gfs2_holder *gh;
        int drop_ref = 0;
 
+       if (unlikely(test_bit(GLF_FROZEN, &gl->gl_flags))) {
+               spin_lock(&gl->gl_spin);
+               gh = find_first_waiter(gl);
+               if (gh && (gh->gh_flags & LM_FLAG_NOEXP) &&
+                   test_and_clear_bit(GLF_FROZEN, &gl->gl_flags))
+                       set_bit(GLF_REPLY_PENDING, &gl->gl_flags);
+               spin_unlock(&gl->gl_spin);
+       }
+
        if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) {
                finish_xmote(gl, gl->gl_reply);
                drop_ref = 1;
@@ -855,6 +865,9 @@ void gfs2_holder_reinit(unsigned int state, unsigned flags, struct gfs2_holder *
        gh->gh_flags = flags;
        gh->gh_iflags = 0;
        gh->gh_ip = (unsigned long)__builtin_return_address(0);
+       if (gh->gh_owner_pid)
+               put_pid(gh->gh_owner_pid);
+       gh->gh_owner_pid = get_pid(task_pid(current));
 }
 
 /**
@@ -1345,7 +1358,7 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
 }
 
 
-static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
+static int gfs2_shrink_glock_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 {
        struct gfs2_glock *gl;
        int may_demote;