#include "lov_cl_internal.h"
-/** \addtogroup lov lov @{ */
+/** \addtogroup lov
+ * @{
+ */
static void lov_sub_enter(struct lov_io_sub *sub)
{
sub->sub_io_initialized = 0;
sub->sub_borrowed = 0;
- /*
- * First sub-io. Use ->lis_single_subio and current environment, to
- * avoid dynamic allocation.
- */
- if (lio->lis_active_subios == 0) {
- sub->sub_io = &lio->lis_single_subio;
- lio->lis_single_subio_index = stripe;
- sub->sub_env = cl_env_get(&sub->sub_refcheck);
- LASSERT(sub->sub_env == env);
- } else if (lio->lis_mem_frozen) {
+ if (lio->lis_mem_frozen) {
LASSERT(mutex_is_locked(&ld->ld_mutex));
sub->sub_io = &ld->ld_emrg[stripe]->emrg_subio;
sub->sub_env = ld->ld_emrg[stripe]->emrg_env;
cookie = cl_env_reenter();
sub->sub_env = cl_env_get(&sub->sub_refcheck);
cl_env_reexit(cookie);
-
- OBD_ALLOC_PTR(sub->sub_io);
if (IS_ERR(sub->sub_env))
result = PTR_ERR(sub->sub_env);
- else if (sub->sub_io == NULL)
- result = -ENOMEM;
+
+ if (result == 0) {
+ /*
+ * First sub-io. Use ->lis_single_subio to
+ * avoid dynamic allocation.
+ */
+ if (lio->lis_active_subios == 0) {
+ sub->sub_io = &lio->lis_single_subio;
+ lio->lis_single_subio_index = stripe;
+ } else {
+ OBD_ALLOC_PTR(sub->sub_io);
+ if (sub->sub_io == NULL)
+ result = -ENOMEM;
+ }
+ }
}
if (result == 0) {
sub_io->ci_parent = io;
sub_io->ci_lockreq = io->ci_lockreq;
sub_io->ci_type = io->ci_type;
+ sub_io->ci_no_srvlock = io->ci_no_srvlock;
lov_sub_enter(sub);
result = cl_io_sub_init(sub->sub_env, sub_io,
struct lov_stripe_md *lsm = lov_r0(cl2lov(ios->cis_obj))->lo_lsm;
loff_t start = io->u.ci_rw.crw_pos;
loff_t next;
- int ssize = lsm->lsm_stripe_size;
+ unsigned long ssize = lsm->lsm_stripe_size;
LASSERT(io->ci_type == CIT_READ || io->ci_type == CIT_WRITE);
ENTRY;
*/
static int lov_io_submit(const struct lu_env *env,
const struct cl_io_slice *ios,
- enum cl_req_type crt, struct cl_2queue *queue)
+ enum cl_req_type crt, struct cl_2queue *queue,
+ enum cl_req_priority priority)
{
struct lov_io *lio = cl2lov_io(env, ios);
struct lov_object *obj = lio->lis_object;
sub = lov_sub_get(env, lio, idx);
LASSERT(!IS_ERR(sub));
LASSERT(sub->sub_io == &lio->lis_single_subio);
- rc = cl_io_submit_rw(sub->sub_env, sub->sub_io, crt, queue);
+ rc = cl_io_submit_rw(sub->sub_env, sub->sub_io,
+ crt, queue, priority);
lov_sub_put(sub);
RETURN(rc);
}
sub = lov_sub_get(env, lio, stripe);
if (!IS_ERR(sub)) {
rc = cl_io_submit_rw(sub->sub_env, sub->sub_io,
- crt, cl2q);
+ crt, cl2q, priority);
lov_sub_put(sub);
} else
rc = PTR_ERR(sub);