Whamcloud - gitweb
LU-11132 compile: fix LC_BI_BDEV for old kernels
[fs/lustre-release.git] / lustre / lov / lov_dev.c
index bf9dba2..52f022f 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2016, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -46,7 +46,6 @@ struct kmem_cache *lov_object_kmem;
 struct kmem_cache *lov_thread_kmem;
 struct kmem_cache *lov_session_kmem;
 
-struct kmem_cache *lovsub_lock_kmem;
 struct kmem_cache *lovsub_object_kmem;
 
 struct lu_kmem_descr lov_caches[] = {
@@ -71,11 +70,6 @@ struct lu_kmem_descr lov_caches[] = {
                 .ckd_size  = sizeof (struct lov_session)
         },
         {
-                .ckd_cache = &lovsub_lock_kmem,
-                .ckd_name  = "lovsub_lock_kmem",
-                .ckd_size  = sizeof (struct lovsub_lock)
-        },
-        {
                 .ckd_cache = &lovsub_object_kmem,
                 .ckd_name  = "lovsub_object_kmem",
                 .ckd_size  = sizeof (struct lovsub_object)
@@ -337,7 +331,7 @@ static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
         int rc;
         ENTRY;
 
-        obd_getref(obd);
+       lov_tgts_getref(obd);
 
         tgt = obd->u.lov.lov_tgts[index];
         LASSERT(tgt != NULL);
@@ -362,8 +356,10 @@ static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
                        rc = PTR_ERR(cl);
                }
         }
-        obd_putref(obd);
-        RETURN(rc);
+
+       lov_tgts_putref(obd);
+
+       RETURN(rc);
 }
 
 /**
@@ -453,9 +449,9 @@ static int lov_process_config(const struct lu_env *env,
        int cmd;
        int rc;
        int gen;
-       __u32 index;
+       u32 index;
 
-       obd_getref(obd);
+       lov_tgts_getref(obd);
 
        cmd = cfg->lcfg_command;
 
@@ -485,8 +481,9 @@ static int lov_process_config(const struct lu_env *env,
 
                obd_str2uuid(&tgt_uuid, lustre_cfg_buf(cfg, 1));
 
-               if (sscanf(lustre_cfg_buf(cfg, 2), "%d", &index) != 1)
-                       GOTO(out, rc = -EINVAL);
+               rc = kstrtou32(lustre_cfg_buf(cfg, 2), 10, &index);
+               if (rc)
+                       GOTO(out, rc);
 
                mdc = class_find_client_obd(&tgt_uuid, LUSTRE_MDC_NAME,
                                            &obd->obd_uuid);
@@ -497,7 +494,7 @@ static int lov_process_config(const struct lu_env *env,
        }
        }
 out:
-       obd_putref(obd);
+       lov_tgts_putref(obd);
        RETURN(rc);
 }