Whamcloud - gitweb
LU-744 clio: save memory allocations for cl_page
[fs/lustre-release.git] / lustre / lov / lov_dev.c
index 97d220c..4dce6a6 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +26,8 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 
 #include "lov_cl_internal.h"
 
-cfs_mem_cache_t *lov_page_kmem;
 cfs_mem_cache_t *lov_lock_kmem;
 cfs_mem_cache_t *lov_object_kmem;
 cfs_mem_cache_t *lov_thread_kmem;
 cfs_mem_cache_t *lov_session_kmem;
 cfs_mem_cache_t *lov_req_kmem;
 
-cfs_mem_cache_t *lovsub_page_kmem;
 cfs_mem_cache_t *lovsub_lock_kmem;
 cfs_mem_cache_t *lovsub_object_kmem;
 cfs_mem_cache_t *lovsub_req_kmem;
@@ -60,15 +58,10 @@ cfs_mem_cache_t *lovsub_req_kmem;
 cfs_mem_cache_t *lov_lock_link_kmem;
 
 /** Lock class of lov_device::ld_mutex. */
-cfs_lock_class_key_t cl_lov_device_mutex_class;
+struct lock_class_key cl_lov_device_mutex_class;
 
 struct lu_kmem_descr lov_caches[] = {
         {
-                .ckd_cache = &lov_page_kmem,
-                .ckd_name  = "lov_page_kmem",
-                .ckd_size  = sizeof (struct lov_page)
-        },
-        {
                 .ckd_cache = &lov_lock_kmem,
                 .ckd_name  = "lov_lock_kmem",
                 .ckd_size  = sizeof (struct lov_lock)
@@ -94,11 +87,6 @@ struct lu_kmem_descr lov_caches[] = {
                 .ckd_size  = sizeof (struct lov_req)
         },
         {
-                .ckd_cache = &lovsub_page_kmem,
-                .ckd_name  = "lovsub_page_kmem",
-                .ckd_size  = sizeof (struct lovsub_page)
-        },
-        {
                 .ckd_cache = &lovsub_lock_kmem,
                 .ckd_name  = "lovsub_lock_kmem",
                 .ckd_size  = sizeof (struct lovsub_lock)
@@ -387,7 +375,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
 
                 OBD_ALLOC(newd, tgt_size * sz);
                 if (newd != NULL) {
-                        cfs_mutex_lock(&dev->ld_mutex);
+                       mutex_lock(&dev->ld_mutex);
                         if (sub_size > 0) {
                                 memcpy(newd, dev->ld_target, sub_size * sz);
                                 OBD_FREE(dev->ld_target, sub_size * sz);
@@ -398,7 +386,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
                         if (dev->ld_emrg != NULL)
                                 lov_emerg_free(dev->ld_emrg, sub_size);
                         dev->ld_emrg = emerg;
-                        cfs_mutex_unlock(&dev->ld_mutex);
+                       mutex_unlock(&dev->ld_mutex);
                 } else {
                         lov_emerg_free(emerg, tgt_size);
                         result = -ENOMEM;
@@ -504,8 +492,8 @@ static struct lu_device *lov_device_alloc(const struct lu_env *env,
         d->ld_ops        = &lov_lu_ops;
         ld->ld_cl.cd_ops = &lov_cl_ops;
 
-        cfs_mutex_init(&ld->ld_mutex);
-        cfs_lockdep_set_class(&ld->ld_mutex, &cl_lov_device_mutex_class);
+       mutex_init(&ld->ld_mutex);
+       lockdep_set_class(&ld->ld_mutex, &cl_lov_device_mutex_class);
 
         /* setup the LOV OBD */
         obd = class_name2obd(lustre_cfg_string(cfg, 0));