1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * Implementation of cl_io for LOV layer.
38 * Author: Nikita Danilov <nikita.danilov@sun.com>
41 #define DEBUG_SUBSYSTEM S_LOV
43 #include "lov_cl_internal.h"
45 /** \addtogroup lov lov @{ */
47 static void lov_sub_enter(struct lov_io_sub *sub)
50 if (sub->sub_reenter++ == 0) {
51 sub->sub_cookie = cl_env_reenter();
52 cl_env_implant(sub->sub_env, &sub->sub_refcheck2);
57 static void lov_sub_exit(struct lov_io_sub *sub)
60 if (--sub->sub_reenter == 0) {
61 cl_env_unplant(sub->sub_env, &sub->sub_refcheck2);
62 cl_env_reexit(sub->sub_cookie);
67 static void lov_io_sub_fini(const struct lu_env *env, struct lov_io *lio,
68 struct lov_io_sub *sub)
71 if (sub->sub_io != NULL) {
72 if (sub->sub_io_initialized) {
74 cl_io_fini(sub->sub_env, sub->sub_io);
76 sub->sub_io_initialized = 0;
77 lio->lis_active_subios--;
79 if (sub->sub_stripe == lio->lis_single_subio_index)
80 lio->lis_single_subio_index = -1;
81 else if (!sub->sub_borrowed)
82 OBD_FREE_PTR(sub->sub_io);
85 if (sub->sub_env != NULL && !IS_ERR(sub->sub_env)) {
86 if (!sub->sub_borrowed)
87 cl_env_put(sub->sub_env, &sub->sub_refcheck);
93 static void lov_io_sub_inherit(struct cl_io *io, struct lov_io *lio,
94 int stripe, loff_t start, loff_t end)
96 struct lov_stripe_md *lsm = lov_r0(lio->lis_object)->lo_lsm;
97 struct cl_io *parent = lio->lis_cl.cis_io;
101 size_t new_size = parent->u.ci_truncate.tr_size;
103 new_size = lov_size_to_stripe(lsm, new_size, stripe);
104 io->u.ci_truncate.tr_capa = parent->u.ci_truncate.tr_capa;
105 io->u.ci_truncate.tr_size = new_size;
109 struct cl_object *obj = parent->ci_obj;
110 loff_t off = cl_offset(obj, parent->u.ci_fault.ft_index);
112 io->u.ci_fault = parent->u.ci_fault;
113 off = lov_size_to_stripe(lsm, off, stripe);
114 io->u.ci_fault.ft_index = cl_index(obj, off);
119 io->u.ci_rw.crw_pos = start;
120 io->u.ci_rw.crw_count = end - start;
128 static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio,
129 struct lov_io_sub *sub)
131 struct lov_object *lov = lio->lis_object;
132 struct lov_device *ld = lu2lov_dev(lov2cl(lov)->co_lu.lo_dev);
133 struct cl_io *sub_io;
134 struct cl_object *sub_obj;
135 struct cl_io *io = lio->lis_cl.cis_io;
137 int stripe = sub->sub_stripe;
140 LASSERT(sub->sub_io == NULL);
141 LASSERT(sub->sub_env == NULL);
142 LASSERT(sub->sub_stripe < lio->lis_stripe_count);
146 sub->sub_io_initialized = 0;
147 sub->sub_borrowed = 0;
150 * First sub-io. Use ->lis_single_subio and current environment, to
151 * avoid dynamic allocation.
153 if (lio->lis_active_subios == 0) {
154 sub->sub_io = &lio->lis_single_subio;
155 lio->lis_single_subio_index = stripe;
156 sub->sub_env = cl_env_get(&sub->sub_refcheck);
157 LASSERT(sub->sub_env == env);
158 } else if (lio->lis_mem_frozen) {
159 LASSERT(mutex_is_locked(&ld->ld_mutex));
160 sub->sub_io = &ld->ld_emrg[stripe]->emrg_subio;
161 sub->sub_env = ld->ld_emrg[stripe]->emrg_env;
162 sub->sub_borrowed = 1;
166 /* obtain new environment */
167 cookie = cl_env_reenter();
168 sub->sub_env = cl_env_get(&sub->sub_refcheck);
169 cl_env_reexit(cookie);
171 OBD_ALLOC_PTR(sub->sub_io);
172 if (IS_ERR(sub->sub_env))
173 result = PTR_ERR(sub->sub_env);
174 else if (sub->sub_io == NULL)
179 sub_obj = lovsub2cl(lov_r0(lov)->lo_sub[stripe]);
180 sub_io = sub->sub_io;
182 sub_io->ci_obj = sub_obj;
183 sub_io->ci_result = 0;
185 sub_io->ci_parent = io;
186 sub_io->ci_lockreq = io->ci_lockreq;
187 sub_io->ci_type = io->ci_type;
190 result = cl_io_sub_init(sub->sub_env, sub_io,
191 io->ci_type, sub_obj);
194 lio->lis_active_subios++;
195 sub->sub_io_initialized = 1;
200 lov_io_sub_fini(env, lio, sub);
204 struct lov_io_sub *lov_sub_get(const struct lu_env *env,
205 struct lov_io *lio, int stripe)
208 struct lov_io_sub *sub = &lio->lis_subs[stripe];
210 LASSERT(stripe < lio->lis_stripe_count);
213 if (!sub->sub_io_initialized) {
214 sub->sub_stripe = stripe;
215 rc = lov_io_sub_init(env, lio, sub);
225 void lov_sub_put(struct lov_io_sub *sub)
230 /*****************************************************************************
236 static int lov_page_stripe(const struct cl_page *page)
238 struct lovsub_object *subobj;
242 lu_object_locate(page->cp_child->cp_obj->co_lu.lo_header,
243 &lovsub_device_type));
244 LASSERT(subobj != NULL);
245 RETURN(subobj->lso_index);
248 struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio,
249 const struct cl_page_slice *slice)
251 struct lov_stripe_md *lsm = lov_r0(lio->lis_object)->lo_lsm;
252 struct cl_page *page = slice->cpl_page;
255 LASSERT(lio->lis_cl.cis_io != NULL);
256 LASSERT(cl2lov(slice->cpl_obj) == lio->lis_object);
257 LASSERT(lsm != NULL);
258 LASSERT(lio->lis_nr_subios > 0);
261 stripe = lov_page_stripe(page);
262 RETURN(lov_sub_get(env, lio, stripe));
266 static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio,
269 struct lov_object *lov = lio->lis_object;
270 struct lov_stripe_md *lsm = lov_r0(lov)->lo_lsm;
273 LASSERT(lio->lis_object != NULL);
277 * Need to be optimized, we can't afford to allocate a piece of memory
278 * when writing a page. -jay
280 OBD_ALLOC(lio->lis_subs,
281 lsm->lsm_stripe_count * sizeof lio->lis_subs[0]);
282 if (lio->lis_subs != NULL) {
283 lio->lis_nr_subios = lio->lis_stripe_count;
284 lio->lis_single_subio_index = -1;
285 lio->lis_active_subios = 0;
292 static void lov_io_slice_init(struct lov_io *lio,
293 struct lov_object *obj, struct cl_io *io)
295 struct lov_stripe_md *lsm = lov_r0(obj)->lo_lsm;
297 LASSERT(lsm != NULL);
301 lio->lis_object = obj;
302 lio->lis_stripe_count = lsm->lsm_stripe_count;
304 switch (io->ci_type) {
307 lio->lis_pos = io->u.ci_rw.crw_pos;
308 lio->lis_endpos = io->u.ci_rw.crw_pos + io->u.ci_rw.crw_count;
309 lio->lis_io_endpos = lio->lis_endpos;
310 if (cl_io_is_append(io)) {
311 LASSERT(io->ci_type == CIT_WRITE);
313 lio->lis_endpos = OBD_OBJECT_EOF;
318 lio->lis_pos = io->u.ci_truncate.tr_size;
319 lio->lis_endpos = OBD_OBJECT_EOF;
323 pgoff_t index = io->u.ci_fault.ft_index;
324 lio->lis_pos = cl_offset(io->ci_obj, index);
325 lio->lis_endpos = cl_offset(io->ci_obj, index + 1);
331 lio->lis_endpos = OBD_OBJECT_EOF;
341 static void lov_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
343 struct lov_io *lio = cl2lov_io(env, ios);
347 if (lio->lis_subs != NULL) {
348 for (i = 0; i < lio->lis_nr_subios; i++)
349 lov_io_sub_fini(env, lio, &lio->lis_subs[i]);
350 OBD_FREE(lio->lis_subs,
351 lio->lis_nr_subios * sizeof lio->lis_subs[0]);
352 lio->lis_nr_subios = 0;
357 static obd_off lov_offset_mod(obd_off val, int delta)
359 if (val != OBD_OBJECT_EOF)
364 static int lov_io_iter_init(const struct lu_env *env,
365 const struct cl_io_slice *ios)
367 struct lov_io *lio = cl2lov_io(env, ios);
368 struct lov_stripe_md *lsm = lov_r0(lio->lis_object)->lo_lsm;
369 struct lov_io_sub *sub;
377 endpos = lov_offset_mod(lio->lis_endpos, -1);
378 for (stripe = 0; stripe < lio->lis_stripe_count; stripe++) {
379 if (!lov_stripe_intersects(lsm, stripe, lio->lis_pos,
380 endpos, &start, &end))
383 end = lov_offset_mod(end, +1);
384 sub = lov_sub_get(env, lio, stripe);
386 lov_io_sub_inherit(sub->sub_io, lio, stripe,
388 rc = cl_io_iter_init(sub->sub_env, sub->sub_io);
390 CDEBUG(D_VFSTRACE, "shrink: %i [%llu, %llu)\n",
396 list_add_tail(&sub->sub_linkage, &lio->lis_active);
403 static int lov_io_rw_iter_init(const struct lu_env *env,
404 const struct cl_io_slice *ios)
406 struct lov_io *lio = cl2lov_io(env, ios);
407 struct cl_io *io = ios->cis_io;
408 struct lov_stripe_md *lsm = lov_r0(cl2lov(ios->cis_obj))->lo_lsm;
409 loff_t start = io->u.ci_rw.crw_pos;
411 int ssize = lsm->lsm_stripe_size;
413 LASSERT(io->ci_type == CIT_READ || io->ci_type == CIT_WRITE);
416 /* fast path for common case. */
417 if (lio->lis_nr_subios != 1 && !cl_io_is_append(io)) {
419 do_div(start, ssize);
420 next = (start + 1) * ssize;
421 if (next <= start * ssize)
424 io->ci_continue = next < lio->lis_io_endpos;
425 io->u.ci_rw.crw_count = min_t(loff_t, lio->lis_io_endpos,
426 next) - io->u.ci_rw.crw_pos;
427 lio->lis_pos = io->u.ci_rw.crw_pos;
428 lio->lis_endpos = io->u.ci_rw.crw_pos + io->u.ci_rw.crw_count;
429 CDEBUG(D_VFSTRACE, "stripe: %llu chunk: [%llu, %llu) %llu\n",
430 (__u64)start, lio->lis_pos, lio->lis_endpos,
431 (__u64)lio->lis_io_endpos);
434 * XXX The following call should be optimized: we know, that
435 * [lio->lis_pos, lio->lis_endpos) intersects with exactly one stripe.
437 RETURN(lov_io_iter_init(env, ios));
440 static int lov_io_call(const struct lu_env *env, struct lov_io *lio,
441 int (*iofunc)(const struct lu_env *, struct cl_io *))
443 struct lov_io_sub *sub;
447 list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
449 rc = iofunc(sub->sub_env, sub->sub_io);
457 static int lov_io_lock(const struct lu_env *env, const struct cl_io_slice *ios)
460 RETURN(lov_io_call(env, cl2lov_io(env, ios), cl_io_lock));
463 static int lov_io_start(const struct lu_env *env, const struct cl_io_slice *ios)
466 RETURN(lov_io_call(env, cl2lov_io(env, ios), cl_io_start));
469 static int lov_io_end_wrapper(const struct lu_env *env, struct cl_io *io)
473 * It's possible that lov_io_start() wasn't called against this
474 * sub-io, either because previous sub-io failed, or upper layer
477 if (io->ci_state == CIS_IO_GOING)
480 io->ci_state = CIS_IO_FINISHED;
484 static int lov_io_iter_fini_wrapper(const struct lu_env *env, struct cl_io *io)
486 cl_io_iter_fini(env, io);
490 static int lov_io_unlock_wrapper(const struct lu_env *env, struct cl_io *io)
492 cl_io_unlock(env, io);
496 static void lov_io_end(const struct lu_env *env, const struct cl_io_slice *ios)
500 rc = lov_io_call(env, cl2lov_io(env, ios), lov_io_end_wrapper);
504 static void lov_io_iter_fini(const struct lu_env *env,
505 const struct cl_io_slice *ios)
507 struct lov_io *lio = cl2lov_io(env, ios);
511 rc = lov_io_call(env, lio, lov_io_iter_fini_wrapper);
513 while (!list_empty(&lio->lis_active))
514 list_del_init(lio->lis_active.next);
518 static void lov_io_unlock(const struct lu_env *env,
519 const struct cl_io_slice *ios)
524 rc = lov_io_call(env, cl2lov_io(env, ios), lov_io_unlock_wrapper);
530 static struct cl_page_list *lov_io_submit_qin(struct lov_device *ld,
531 struct cl_page_list *qin,
534 return alloc ? &qin[idx] : &ld->ld_emrg[idx]->emrg_page_list;
538 * lov implementation of cl_operations::cio_submit() method. It takes a list
539 * of pages in \a queue, splits it into per-stripe sub-lists, invokes
540 * cl_io_submit() on underlying devices to submit sub-lists, and then splices
543 * Major complication of this function is a need to handle memory cleansing:
544 * cl_io_submit() is called to write out pages as a part of VM memory
545 * reclamation, and hence it may not fail due to memory shortages (system
546 * dead-locks otherwise). To deal with this, some resources (sub-lists,
547 * sub-environment, etc.) are allocated per-device on "startup" (i.e., in a
548 * not-memory cleansing context), and in case of memory shortage, these
549 * pre-allocated resources are used by lov_io_submit() under
550 * lov_device::ld_mutex mutex.
552 static int lov_io_submit(const struct lu_env *env,
553 const struct cl_io_slice *ios,
554 enum cl_req_type crt, struct cl_2queue *queue)
556 struct lov_io *lio = cl2lov_io(env, ios);
557 struct lov_object *obj = lio->lis_object;
558 struct lov_device *ld = lu2lov_dev(lov2cl(obj)->co_lu.lo_dev);
559 struct cl_page_list *qin = &queue->c2_qin;
560 struct cl_2queue *cl2q = &lov_env_info(env)->lti_cl2q;
561 struct cl_page_list *stripes_qin = NULL;
562 struct cl_page *page;
566 #define QIN(stripe) lov_io_submit_qin(ld, stripes_qin, stripe, alloc)
570 #if defined(__KERNEL__) && defined(__linux__)
571 !(current->flags & PF_MEMALLOC);
576 if (lio->lis_active_subios == 1) {
577 int idx = lio->lis_single_subio_index;
578 struct lov_io_sub *sub;
580 LASSERT(idx < lio->lis_nr_subios);
581 sub = lov_sub_get(env, lio, idx);
582 LASSERT(!IS_ERR(sub));
583 LASSERT(sub->sub_io == &lio->lis_single_subio);
584 rc = cl_io_submit_rw(sub->sub_env, sub->sub_io, crt, queue);
589 LASSERT(lio->lis_subs != NULL);
591 OBD_ALLOC(stripes_qin,
592 sizeof(*stripes_qin) * lio->lis_nr_subios);
593 if (stripes_qin == NULL)
596 for (stripe = 0; stripe < lio->lis_nr_subios; stripe++)
597 cl_page_list_init(&stripes_qin[stripe]);
600 * If we get here, it means pageout & swap doesn't help.
601 * In order to not make things worse, even don't try to
602 * allocate the memory with __GFP_NOWARN. -jay
604 mutex_lock(&ld->ld_mutex);
605 lio->lis_mem_frozen = 1;
608 cl_2queue_init(cl2q);
609 cl_page_list_for_each_safe(page, tmp, qin) {
610 stripe = lov_page_stripe(page);
611 cl_page_list_move(QIN(stripe), qin, page);
614 for (stripe = 0; stripe < lio->lis_nr_subios; stripe++) {
615 struct lov_io_sub *sub;
616 struct cl_page_list *sub_qin = QIN(stripe);
618 if (list_empty(&sub_qin->pl_pages))
621 cl_page_list_splice(sub_qin, &cl2q->c2_qin);
622 sub = lov_sub_get(env, lio, stripe);
624 rc = cl_io_submit_rw(sub->sub_env, sub->sub_io,
629 cl_page_list_splice(&cl2q->c2_qin, &queue->c2_qin);
630 cl_page_list_splice(&cl2q->c2_qout, &queue->c2_qout);
635 for (stripe = 0; stripe < lio->lis_nr_subios; stripe++) {
636 struct cl_page_list *sub_qin = QIN(stripe);
638 if (list_empty(&sub_qin->pl_pages))
641 cl_page_list_splice(sub_qin, qin);
645 OBD_FREE(stripes_qin,
646 sizeof(*stripes_qin) * lio->lis_nr_subios);
650 for (i = 0; i < lio->lis_nr_subios; i++) {
651 struct cl_io *cio = lio->lis_subs[i].sub_io;
653 if (cio && cio == &ld->ld_emrg[i]->emrg_subio)
654 lov_io_sub_fini(env, lio, &lio->lis_subs[i]);
656 lio->lis_mem_frozen = 0;
657 mutex_unlock(&ld->ld_mutex);
664 static int lov_io_prepare_write(const struct lu_env *env,
665 const struct cl_io_slice *ios,
666 const struct cl_page_slice *slice,
667 unsigned from, unsigned to)
669 struct lov_io *lio = cl2lov_io(env, ios);
670 struct cl_page *sub_page = lov_sub_page(slice);
671 struct lov_io_sub *sub;
675 sub = lov_page_subio(env, lio, slice);
677 result = cl_io_prepare_write(sub->sub_env, sub->sub_io,
681 result = PTR_ERR(sub);
685 static int lov_io_commit_write(const struct lu_env *env,
686 const struct cl_io_slice *ios,
687 const struct cl_page_slice *slice,
688 unsigned from, unsigned to)
690 struct lov_io *lio = cl2lov_io(env, ios);
691 struct cl_page *sub_page = lov_sub_page(slice);
692 struct lov_io_sub *sub;
696 sub = lov_page_subio(env, lio, slice);
698 result = cl_io_commit_write(sub->sub_env, sub->sub_io,
702 result = PTR_ERR(sub);
706 static int lov_io_fault_start(const struct lu_env *env,
707 const struct cl_io_slice *ios)
709 struct cl_fault_io *fio;
711 struct lov_io_sub *sub;
714 fio = &ios->cis_io->u.ci_fault;
715 lio = cl2lov_io(env, ios);
716 sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page));
717 sub->sub_io->u.ci_fault.ft_nob = fio->ft_nob;
719 RETURN(lov_io_start(env, ios));
722 static const struct cl_io_operations lov_io_ops = {
725 .cio_fini = lov_io_fini,
726 .cio_iter_init = lov_io_rw_iter_init,
727 .cio_iter_fini = lov_io_iter_fini,
728 .cio_lock = lov_io_lock,
729 .cio_unlock = lov_io_unlock,
730 .cio_start = lov_io_start,
731 .cio_end = lov_io_end
734 .cio_fini = lov_io_fini,
735 .cio_iter_init = lov_io_rw_iter_init,
736 .cio_iter_fini = lov_io_iter_fini,
737 .cio_lock = lov_io_lock,
738 .cio_unlock = lov_io_unlock,
739 .cio_start = lov_io_start,
740 .cio_end = lov_io_end
743 .cio_fini = lov_io_fini,
744 .cio_iter_init = lov_io_iter_init,
745 .cio_iter_fini = lov_io_iter_fini,
746 .cio_lock = lov_io_lock,
747 .cio_unlock = lov_io_unlock,
748 .cio_start = lov_io_start,
749 .cio_end = lov_io_end
752 .cio_fini = lov_io_fini,
753 .cio_iter_init = lov_io_iter_init,
754 .cio_iter_fini = lov_io_iter_fini,
755 .cio_lock = lov_io_lock,
756 .cio_unlock = lov_io_unlock,
757 .cio_start = lov_io_fault_start,
758 .cio_end = lov_io_end
761 .cio_fini = lov_io_fini
766 .cio_submit = lov_io_submit
769 .cio_submit = lov_io_submit
772 .cio_prepare_write = lov_io_prepare_write,
773 .cio_commit_write = lov_io_commit_write
776 /*****************************************************************************
778 * Empty lov io operations.
782 static void lov_empty_io_fini(const struct lu_env *env,
783 const struct cl_io_slice *ios)
789 static void lov_empty_impossible(const struct lu_env *env,
790 struct cl_io_slice *ios)
795 #define LOV_EMPTY_IMPOSSIBLE ((void *)lov_empty_impossible)
798 * An io operation vector for files without stripes.
800 static const struct cl_io_operations lov_empty_io_ops = {
804 .cio_fini = lov_empty_io_fini,
805 .cio_iter_init = LOV_EMPTY_IMPOSSIBLE,
806 .cio_lock = LOV_EMPTY_IMPOSSIBLE,
807 .cio_start = LOV_EMPTY_IMPOSSIBLE,
808 .cio_end = LOV_EMPTY_IMPOSSIBLE
812 .cio_fini = lov_empty_io_fini,
813 .cio_iter_init = LOV_EMPTY_IMPOSSIBLE,
814 .cio_lock = LOV_EMPTY_IMPOSSIBLE,
815 .cio_start = LOV_EMPTY_IMPOSSIBLE,
816 .cio_end = LOV_EMPTY_IMPOSSIBLE
819 .cio_fini = lov_empty_io_fini,
820 .cio_iter_init = LOV_EMPTY_IMPOSSIBLE,
821 .cio_lock = LOV_EMPTY_IMPOSSIBLE,
822 .cio_start = LOV_EMPTY_IMPOSSIBLE,
823 .cio_end = LOV_EMPTY_IMPOSSIBLE
826 .cio_fini = lov_empty_io_fini,
827 .cio_iter_init = LOV_EMPTY_IMPOSSIBLE,
828 .cio_lock = LOV_EMPTY_IMPOSSIBLE,
829 .cio_start = LOV_EMPTY_IMPOSSIBLE,
830 .cio_end = LOV_EMPTY_IMPOSSIBLE
833 .cio_fini = lov_empty_io_fini
838 .cio_submit = LOV_EMPTY_IMPOSSIBLE
841 .cio_submit = LOV_EMPTY_IMPOSSIBLE
844 .cio_commit_write = LOV_EMPTY_IMPOSSIBLE
847 int lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj,
850 struct lov_io *lio = lov_env_io(env);
851 struct lov_object *lov = cl2lov(obj);
854 CFS_INIT_LIST_HEAD(&lio->lis_active);
855 lov_io_slice_init(lio, lov, io);
856 if (io->ci_result == 0) {
857 LASSERT(lov_r0(lov)->lo_lsm != NULL);
858 io->ci_result = lov_io_subio_init(env, lio, io);
859 if (io->ci_result == 0)
860 cl_io_slice_add(io, &lio->lis_cl, obj, &lov_io_ops);
862 RETURN(io->ci_result);
865 int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
868 struct lov_io *lio = lov_env_io(env);
872 switch (io->ci_type) {
885 CERROR("Page fault on a file without stripes: "DFID"\n",
886 PFID(lu_object_fid(&obj->co_lu)));
890 cl_io_slice_add(io, &lio->lis_cl, obj, &lov_empty_io_ops);
891 io->ci_result = result;