Whamcloud - gitweb
LU-3285 mdc: add IO methods to the MDC
[fs/lustre-release.git] / lustre / osc / osc_io.c
index 65c511c..6e25563 100644 (file)
@@ -104,9 +104,8 @@ static int osc_io_read_ahead(const struct lu_env *env,
  * or, if page is already submitted, changes osc flags through
  * osc_set_async_flags().
  */
-static int osc_io_submit(const struct lu_env *env,
-                         const struct cl_io_slice *ios,
-                        enum cl_req_type crt, struct cl_2queue *queue)
+int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
+                 enum cl_req_type crt, struct cl_2queue *queue)
 {
        struct cl_page    *page;
        struct cl_page    *tmp;
@@ -211,6 +210,7 @@ static int osc_io_submit(const struct lu_env *env,
        CDEBUG(D_INFO, "%d/%d %d\n", qin->pl_nr, qout->pl_nr, result);
        return qout->pl_nr > 0 ? 0 : result;
 }
+EXPORT_SYMBOL(osc_io_submit);
 
 /**
  * This is called when a page is accessed within file in a way that creates
@@ -256,10 +256,10 @@ static void osc_page_touch_at(const struct lu_env *env,
        cl_object_attr_unlock(obj);
 }
 
-static int osc_io_commit_async(const struct lu_env *env,
-                               const struct cl_io_slice *ios,
-                               struct cl_page_list *qin, int from, int to,
-                               cl_commit_cbt cb)
+int osc_io_commit_async(const struct lu_env *env,
+                       const struct cl_io_slice *ios,
+                       struct cl_page_list *qin, int from, int to,
+                       cl_commit_cbt cb)
 {
        struct cl_io    *io = ios->cis_io;
        struct osc_io   *oio = cl2osc_io(env, ios);
@@ -328,9 +328,9 @@ static int osc_io_commit_async(const struct lu_env *env,
        CDEBUG(D_INFO, "%d %d\n", qin->pl_nr, result);
        RETURN(result);
 }
+EXPORT_SYMBOL(osc_io_commit_async);
 
-static int osc_io_iter_init(const struct lu_env *env,
-                           const struct cl_io_slice *ios)
+int osc_io_iter_init(const struct lu_env *env, const struct cl_io_slice *ios)
 {
        struct osc_object *osc = cl2osc(ios->cis_obj);
        struct obd_import *imp = osc_cli(osc)->cl_import;
@@ -348,9 +348,10 @@ static int osc_io_iter_init(const struct lu_env *env,
 
        return rc;
 }
+EXPORT_SYMBOL(osc_io_iter_init);
 
-static int osc_io_write_iter_init(const struct lu_env *env,
-                                 const struct cl_io_slice *ios)
+int osc_io_write_iter_init(const struct lu_env *env,
+                          const struct cl_io_slice *ios)
 {
        struct cl_io *io = ios->cis_io;
        struct osc_io *oio = osc_env_io(env);
@@ -369,9 +370,10 @@ static int osc_io_write_iter_init(const struct lu_env *env,
 
        RETURN(osc_io_iter_init(env, ios));
 }
+EXPORT_SYMBOL(osc_io_write_iter_init);
 
-static void osc_io_iter_fini(const struct lu_env *env,
-                            const struct cl_io_slice *ios)
+void osc_io_iter_fini(const struct lu_env *env,
+                     const struct cl_io_slice *ios)
 {
        struct osc_io *oio = osc_env_io(env);
 
@@ -384,9 +386,10 @@ static void osc_io_iter_fini(const struct lu_env *env,
                        wake_up_all(&osc->oo_io_waitq);
        }
 }
+EXPORT_SYMBOL(osc_io_iter_fini);
 
-static void osc_io_write_iter_fini(const struct lu_env *env,
-                                  const struct cl_io_slice *ios)
+void osc_io_write_iter_fini(const struct lu_env *env,
+                           const struct cl_io_slice *ios)
 {
        struct osc_io *oio = osc_env_io(env);
        struct osc_object *osc = cl2osc(ios->cis_obj);
@@ -399,9 +402,9 @@ static void osc_io_write_iter_fini(const struct lu_env *env,
 
        osc_io_iter_fini(env, ios);
 }
+EXPORT_SYMBOL(osc_io_write_iter_fini);
 
-static int osc_io_fault_start(const struct lu_env *env,
-                             const struct cl_io_slice *ios)
+int osc_io_fault_start(const struct lu_env *env, const struct cl_io_slice *ios)
 {
        struct cl_io       *io;
        struct cl_fault_io *fio;
@@ -421,6 +424,8 @@ static int osc_io_fault_start(const struct lu_env *env,
                                  fio->ft_index, fio->ft_nob);
        RETURN(0);
 }
+EXPORT_SYMBOL(osc_io_fault_start);
+
 
 static int osc_async_upcall(void *a, int rc)
 {
@@ -562,9 +567,8 @@ static int osc_io_setattr_start(const struct lu_env *env,
                init_completion(&cbargs->opc_sync);
 
                if (ia_valid & ATTR_SIZE)
-                       result = osc_punch_base(osc_export(cl2osc(obj)),
-                                               oa, osc_async_upcall,
-                                               cbargs, PTLRPCD_SET);
+                       result = osc_punch_send(osc_export(cl2osc(obj)),
+                                               oa, osc_async_upcall, cbargs);
                else
                        result = osc_setattr_async(osc_export(cl2osc(obj)),
                                                   oa, osc_async_upcall,
@@ -576,8 +580,8 @@ static int osc_io_setattr_start(const struct lu_env *env,
        RETURN(result);
 }
 
-static void osc_io_setattr_end(const struct lu_env *env,
-                               const struct cl_io_slice *slice)
+void osc_io_setattr_end(const struct lu_env *env,
+                       const struct cl_io_slice *slice)
 {
        struct cl_io     *io  = slice->cis_io;
        struct osc_io    *oio = cl2osc_io(env, slice);
@@ -607,6 +611,7 @@ static void osc_io_setattr_end(const struct lu_env *env,
                oio->oi_trunc = NULL;
        }
 }
+EXPORT_SYMBOL(osc_io_setattr_end);
 
 struct osc_data_version_args {
        struct osc_io *dva_oio;
@@ -713,8 +718,8 @@ static void osc_io_data_version_end(const struct lu_env *env,
        EXIT;
 }
 
-static int osc_io_read_start(const struct lu_env *env,
-                             const struct cl_io_slice *slice)
+int osc_io_read_start(const struct lu_env *env,
+                     const struct cl_io_slice *slice)
 {
        struct cl_object *obj  = slice->cis_obj;
        struct cl_attr   *attr = &osc_env_info(env)->oti_attr;
@@ -730,9 +735,10 @@ static int osc_io_read_start(const struct lu_env *env,
 
        RETURN(rc);
 }
+EXPORT_SYMBOL(osc_io_read_start);
 
-static int osc_io_write_start(const struct lu_env *env,
-                              const struct cl_io_slice *slice)
+int osc_io_write_start(const struct lu_env *env,
+                      const struct cl_io_slice *slice)
 {
        struct cl_object *obj   = slice->cis_obj;
        struct cl_attr   *attr  = &osc_env_info(env)->oti_attr;
@@ -747,6 +753,7 @@ static int osc_io_write_start(const struct lu_env *env,
 
        RETURN(rc);
 }
+EXPORT_SYMBOL(osc_io_write_start);
 
 static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
                         struct cl_fsync_io *fio)
@@ -775,8 +782,8 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
        RETURN(rc);
 }
 
-static int osc_io_fsync_start(const struct lu_env *env,
-                             const struct cl_io_slice *slice)
+int osc_io_fsync_start(const struct lu_env *env,
+                      const struct cl_io_slice *slice)
 {
        struct cl_io       *io  = slice->cis_io;
        struct cl_fsync_io *fio = &io->u.ci_fsync;
@@ -814,9 +821,10 @@ static int osc_io_fsync_start(const struct lu_env *env,
 
        RETURN(result);
 }
+EXPORT_SYMBOL(osc_io_fsync_start);
 
-static void osc_io_fsync_end(const struct lu_env *env,
-                            const struct cl_io_slice *slice)
+void osc_io_fsync_end(const struct lu_env *env,
+                     const struct cl_io_slice *slice)
 {
        struct cl_fsync_io *fio = &slice->cis_io->u.ci_fsync;
        struct cl_object   *obj = slice->cis_obj;
@@ -836,6 +844,7 @@ static void osc_io_fsync_end(const struct lu_env *env,
        }
        slice->cis_io->ci_result = result;
 }
+EXPORT_SYMBOL(osc_io_fsync_end);
 
 static int osc_io_ladvise_start(const struct lu_env *env,
                                const struct cl_io_slice *slice)
@@ -907,8 +916,7 @@ static void osc_io_ladvise_end(const struct lu_env *env,
        slice->cis_io->ci_result = result;
 }
 
-static void osc_io_end(const struct lu_env *env,
-                      const struct cl_io_slice *slice)
+void osc_io_end(const struct lu_env *env, const struct cl_io_slice *slice)
 {
        struct osc_io *oio = cl2osc_io(env, slice);
 
@@ -917,6 +925,7 @@ static void osc_io_end(const struct lu_env *env,
                oio->oi_active = NULL;
        }
 }
+EXPORT_SYMBOL(osc_io_end);
 
 static const struct cl_io_operations osc_io_ops = {
        .op = {