~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to fs/gfs2/lock_dlm.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
{
23
23
        struct gfs2_glock *gl = arg;
24
24
        unsigned ret = gl->gl_state;
25
 
        struct gfs2_sbd *sdp = gl->gl_sbd;
26
25
 
27
26
        BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED);
28
27
 
31
30
 
32
31
        switch (gl->gl_lksb.sb_status) {
33
32
        case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */
34
 
                if (gl->gl_ops->go_flags & GLOF_ASPACE)
35
 
                        kmem_cache_free(gfs2_glock_aspace_cachep, gl);
36
 
                else
37
 
                        kmem_cache_free(gfs2_glock_cachep, gl);
38
 
                if (atomic_dec_and_test(&sdp->sd_glock_disposal))
39
 
                        wake_up(&sdp->sd_glock_wait);
 
33
                gfs2_glock_free(gl);
40
34
                return;
41
35
        case -DLM_ECANCEL: /* Cancel while getting lock */
42
36
                ret |= LM_OUT_CANCELED;
164
158
                        GDLM_STRNAME_BYTES - 1, 0, gdlm_ast, gl, gdlm_bast);
165
159
}
166
160
 
167
 
static void gdlm_put_lock(struct kmem_cache *cachep, struct gfs2_glock *gl)
 
161
static void gdlm_put_lock(struct gfs2_glock *gl)
168
162
{
169
163
        struct gfs2_sbd *sdp = gl->gl_sbd;
170
164
        struct lm_lockstruct *ls = &sdp->sd_lockstruct;
171
165
        int error;
172
166
 
173
167
        if (gl->gl_lksb.sb_lkid == 0) {
174
 
                kmem_cache_free(cachep, gl);
175
 
                if (atomic_dec_and_test(&sdp->sd_glock_disposal))
176
 
                        wake_up(&sdp->sd_glock_wait);
 
168
                gfs2_glock_free(gl);
177
169
                return;
178
170
        }
179
171