Whamcloud - gitweb
LU-9065 osc: fix for cl_env_get in low memory
[fs/lustre-release.git] / lustre / osc / osc_lock.c
index 6069c21..f0f5d00 100644 (file)
@@ -302,11 +302,10 @@ static int osc_lock_upcall(void *cookie, struct lustre_handle *lockh,
        struct cl_lock_slice    *slice = &oscl->ols_cl;
        struct lu_env           *env;
        int                     rc;
-       __u16                   refcheck;
 
        ENTRY;
 
-       env = cl_env_get(&refcheck);
+       env = cl_env_percpu_get();
        /* should never happen, similar to osc_ldlm_blocking_ast(). */
        LASSERT(!IS_ERR(env));
 
@@ -345,7 +344,7 @@ static int osc_lock_upcall(void *cookie, struct lustre_handle *lockh,
 
        if (oscl->ols_owner != NULL)
                cl_sync_io_note(env, oscl->ols_owner, rc);
-       cl_env_put(env, &refcheck);
+       cl_env_percpu_put(env);
 
        RETURN(rc);
 }