Whamcloud - gitweb
LU-12296 llite: improve ll_dom_lock_cancel
[fs/lustre-release.git] / lustre / obdclass / cl_object.c
index 39d3800..5aa59de 100644 (file)
@@ -422,6 +422,24 @@ loff_t cl_object_maxbytes(struct cl_object *obj)
 }
 EXPORT_SYMBOL(cl_object_maxbytes);
 
+int cl_object_flush(const struct lu_env *env, struct cl_object *obj,
+                        struct ldlm_lock *lock)
+{
+       struct lu_object_header *top = obj->co_lu.lo_header;
+       int rc = 0;
+       ENTRY;
+
+       list_for_each_entry(obj, &top->loh_layers, co_lu.lo_linkage) {
+               if (obj->co_ops->coo_object_flush) {
+                       rc = obj->co_ops->coo_object_flush(env, obj, lock);
+                       if (rc)
+                               break;
+               }
+       }
+       RETURN(rc);
+}
+EXPORT_SYMBOL(cl_object_flush);
+
 /**
  * Helper function removing all object locks, and marking object for
  * deletion. All object pages must have been deleted at this point.
@@ -1039,8 +1057,6 @@ 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.
@@ -1068,17 +1084,8 @@ 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:
@@ -1094,8 +1101,6 @@ 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);