Whamcloud - gitweb
LU-709 build: cleanup VFS_KERN_MOUNT/INVALIDATEPAGE_RETURN_INT
[fs/lustre-release.git] / lustre / ptlrpc / sec_bulk.c
index dfe6b87..d4c7983 100644 (file)
@@ -28,6 +28,8 @@
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -396,7 +398,7 @@ static void enc_pools_insert(cfs_page_t ***pools, int npools, int npages)
 
 static int enc_pools_add_pages(int npages)
 {
-        static CFS_DECLARE_MUTEX(sem_add_pages);
+        static CFS_DEFINE_MUTEX(add_pages_mutex);
         cfs_page_t   ***pools;
         int             npools, alloced = 0;
         int             i, j, rc = -ENOMEM;
@@ -404,7 +406,7 @@ static int enc_pools_add_pages(int npages)
         if (npages < PTLRPC_MAX_BRW_PAGES)
                 npages = PTLRPC_MAX_BRW_PAGES;
 
-        cfs_down(&sem_add_pages);
+        cfs_mutex_lock(&add_pages_mutex);
 
         if (npages + page_pools.epp_total_pages > page_pools.epp_max_pages)
                 npages = page_pools.epp_max_pages - page_pools.epp_total_pages;
@@ -446,7 +448,7 @@ out:
                 CERROR("Failed to allocate %d enc pages\n", npages);
         }
 
-        cfs_up(&sem_add_pages);
+        cfs_mutex_unlock(&add_pages_mutex);
         return rc;
 }
 
@@ -773,14 +775,15 @@ void sptlrpc_enc_pool_fini(void)
         enc_pools_free();
 
         if (page_pools.epp_st_access > 0) {
-                CWARN("max pages %lu, grows %u, grow fails %u, shrinks %u, "
-                      "access %lu, missing %lu, max qlen %u, max wait "
-                      CFS_TIME_T"/%d\n",
-                      page_pools.epp_st_max_pages, page_pools.epp_st_grows,
-                      page_pools.epp_st_grow_fails,
-                      page_pools.epp_st_shrinks, page_pools.epp_st_access,
-                      page_pools.epp_st_missings, page_pools.epp_st_max_wqlen,
-                      page_pools.epp_st_max_wait, CFS_HZ);
+                CDEBUG(D_SEC,
+                       "max pages %lu, grows %u, grow fails %u, shrinks %u, "
+                       "access %lu, missing %lu, max qlen %u, max wait "
+                       CFS_TIME_T"/%d\n",
+                       page_pools.epp_st_max_pages, page_pools.epp_st_grows,
+                       page_pools.epp_st_grow_fails,
+                       page_pools.epp_st_shrinks, page_pools.epp_st_access,
+                       page_pools.epp_st_missings, page_pools.epp_st_max_wqlen,
+                       page_pools.epp_st_max_wait, CFS_HZ);
         }
 }