Whamcloud - gitweb
LU-6068 misc: update Intel copyright messages 2014
[fs/lustre-release.git] / lustre / llite / vvp_page.c
index d031f8b..90c9417 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, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -43,8 +43,7 @@
 
 
 #include <obd.h>
-#include <lustre_lite.h>
-
+#include "llite_internal.h"
 #include "vvp_internal.h"
 
 /*****************************************************************************
@@ -424,9 +423,6 @@ static const struct cl_page_operations vvp_page_ops = {
 
 static void vvp_transient_page_verify(const struct cl_page *page)
 {
-       struct inode *inode = ccc_object_inode(page->cp_obj);
-
-       LASSERT(!mutex_trylock(&inode->i_mutex));
 }
 
 static int vvp_transient_page_own(const struct lu_env *env,
@@ -500,8 +496,7 @@ static void vvp_transient_page_fini(const struct lu_env *env,
        struct ccc_object *clobj = cl2ccc(clp->cp_obj);
 
        vvp_page_fini_common(cp);
-       LASSERT(!mutex_trylock(&clobj->cob_inode->i_mutex));
-       clobj->cob_transient_pages--;
+       atomic_dec(&clobj->cob_transient_pages);
 }
 
 static const struct cl_page_operations vvp_transient_page_ops = {
@@ -548,10 +543,9 @@ int vvp_page_init(const struct lu_env *env, struct cl_object *obj,
        } else {
                struct ccc_object *clobj = cl2ccc(obj);
 
-               LASSERT(!mutex_trylock(&clobj->cob_inode->i_mutex));
                cl_page_slice_add(page, &cpg->cpg_cl, obj, index,
                                &vvp_transient_page_ops);
-               clobj->cob_transient_pages++;
+               atomic_inc(&clobj->cob_transient_pages);
        }
        return 0;
 }