-static int osc_sync_fs(struct obd_export *exp, struct obd_info *oinfo,
- int wait)
-{
- struct obd_device *obd = class_exp2obd(exp);
- struct client_obd *cli;
- struct lov_oinfo *loi;
- struct lov_oinfo *tloi;
- struct osc_async_page *oap;
- struct osc_async_page *toap;
- struct loi_oap_pages *lop;
- struct lu_env *env;
- int refcheck;
- int rc = 0;
- ENTRY;
-
- env = cl_env_get(&refcheck);
- if (IS_ERR(env))
- RETURN(PTR_ERR(env));
-
- cli = &obd->u.cli;
- client_obd_list_lock(&cli->cl_loi_list_lock);
- cli->cl_sf_wait.sfw_oi = oinfo;
- cli->cl_sf_wait.sfw_upcall = oinfo->oi_cb_up;
- cli->cl_sf_wait.started = 1;
- /* creating cl_loi_sync_fs list */
- cfs_list_for_each_entry_safe(loi, tloi, &cli->cl_loi_write_list,
- loi_write_item) {
- lop = &loi->loi_write_lop;
- cfs_list_for_each_entry_safe(oap, toap, &lop->lop_pending,
- oap_pending_item)
- osc_set_async_flags_base(cli, loi, oap, ASYNC_SYNCFS);
- }
- osc_check_rpcs(env, cli);
- osc_wake_sync_fs(cli);
- client_obd_list_unlock(&cli->cl_loi_list_lock);
- cl_env_put(env, &refcheck);
-
- RETURN(rc);
-}
-