Whamcloud - gitweb
LU-9367 llite: restore ll_file_getstripe in ll_lov_setstripe
[fs/lustre-release.git] / lustre / obdclass / cl_object.c
index c2e045b..ddf97fc 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -343,7 +339,7 @@ EXPORT_SYMBOL(cl_object_prune);
  * Get stripe information of this object.
  */
 int cl_object_getstripe(const struct lu_env *env, struct cl_object *obj,
-                       struct lov_user_md __user *uarg)
+                       struct lov_user_md __user *uarg, size_t size)
 {
        struct lu_object_header *top;
        int                     result = 0;
@@ -352,7 +348,8 @@ int cl_object_getstripe(const struct lu_env *env, struct cl_object *obj,
        top = obj->co_lu.lo_header;
        list_for_each_entry(obj, &top->loh_layers, co_lu.lo_linkage) {
                if (obj->co_ops->coo_getstripe != NULL) {
-                       result = obj->co_ops->coo_getstripe(env, obj, uarg);
+                       result = obj->co_ops->coo_getstripe(env, obj, uarg,
+                                                           size);
                        if (result != 0)
                                break;
                }
@@ -1026,20 +1023,8 @@ struct cl_thread_info *cl_env_info(const struct lu_env *env)
         return lu_context_key_get(&env->le_ctx, &cl_key);
 }
 
-/* defines cl0_key_{init,fini}() */
-LU_KEY_INIT_FINI(cl0, struct cl_thread_info);
-
-static void *cl_key_init(const struct lu_context *ctx,
-                         struct lu_context_key *key)
-{
-       return cl0_key_init(ctx, key);
-}
-
-static void cl_key_fini(const struct lu_context *ctx,
-                        struct lu_context_key *key, void *data)
-{
-       cl0_key_fini(ctx, key, data);
-}
+/* defines cl_key_{init,fini}() */
+LU_KEY_INIT_FINI(cl, struct cl_thread_info);
 
 static struct lu_context_key cl_key = {
         .lct_tags = LCT_CL_THREAD,
@@ -1058,6 +1043,8 @@ static struct lu_kmem_descr cl_object_caches[] = {
         }
 };
 
+struct cfs_ptask_engine *cl_io_engine;
+
 /**
  * Global initialization of cl-data. Create kmem caches, register
  * lu_context_key's, etc.
@@ -1085,8 +1072,17 @@ int cl_global_init(void)
        if (result) /* no cl_env_percpu_fini on error */
                GOTO(out_keys, result);
 
+       cl_io_engine = cfs_ptengine_init("clio", cpu_online_mask);
+       if (IS_ERR(cl_io_engine)) {
+               result = PTR_ERR(cl_io_engine);
+               cl_io_engine = NULL;
+               GOTO(out_percpu, result);
+       }
+
        return 0;
 
+out_percpu:
+       cl_env_percpu_fini();
 out_keys:
        lu_context_key_degister(&cl_key);
 out_kmem:
@@ -1102,6 +1098,8 @@ out:
  */
 void cl_global_fini(void)
 {
+       cfs_ptengine_fini(cl_io_engine);
+       cl_io_engine = NULL;
        cl_env_percpu_fini();
        lu_context_key_degister(&cl_key);
        lu_kmem_fini(cl_object_caches);