Whamcloud - gitweb
LU-7243 misc: update Intel copyright messages 2015
[fs/lustre-release.git] / lustre / osc / osc_object.c
index 7337489..c233d13 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -214,10 +214,6 @@ static int osc_object_prune(const struct lu_env *env, struct cl_object *obj)
        struct osc_object       *osc = cl2osc(obj);
        struct ldlm_res_id      *resname = &osc_env_info(env)->oti_resname;
 
-       LASSERTF(osc->oo_npages == 0,
-                DFID "still have %lu pages, obj: %p, osc: %p\n",
-                PFID(lu_object_fid(&obj->co_lu)), osc->oo_npages, obj, osc);
-
        /* DLM locks don't hold a reference of osc_object so we have to
         * clear it before the object is being destroyed. */
        ostid_build_res_name(&osc->oo_oinfo->loi_oi, resname);
@@ -494,9 +490,15 @@ int osc_object_invalidate(const struct lu_env *env, struct osc_object *osc)
 
        l_wait_event(osc->oo_io_waitq, atomic_read(&osc->oo_nr_ios) == 0, &lwi);
 
-       /* Discard all pages of this object. */
+       /* Discard all dirty pages of this object. */
        osc_cache_truncate_start(env, osc, 0, NULL);
 
+       /* Discard all caching pages */
+       osc_lock_discard_pages(env, osc, 0, CL_PAGE_EOF, CLM_WRITE);
+
+       /* Clear ast data of dlm lock. Do this after discarding all pages */
+       osc_object_prune(env, osc2cl(osc));
+
        RETURN(0);
 }