*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* Implementation of cl_io for LOV layer.
*
*ext = (typeof(*ext)) { lio->lis_pos, lio->lis_endpos };
io->ci_need_write_intent = 0;
- if (!(io->ci_type == CIT_WRITE || cl_io_is_trunc(io) ||
- cl_io_is_mkwrite(io)))
+ if (!(io->ci_type == CIT_WRITE || cl_io_is_mkwrite(io) ||
+ cl_io_is_fallocate(io) || cl_io_is_trunc(io)))
RETURN(0);
/*
CDEBUG(D_LAYOUT, "designated I/O mirror state: %d\n",
lov_flr_state(obj));
- if ((cl_io_is_trunc(io) || io->ci_type == CIT_WRITE) &&
+ if ((cl_io_is_trunc(io) || io->ci_type == CIT_WRITE ||
+ cl_io_is_fallocate(io)) &&
(io->ci_layout_version != obj->lo_lsm->lsm_layout_gen)) {
/*
* For resync I/O, the ci_layout_version was the layout
io->ci_result = 0;
lio->lis_object = obj;
+ lio->lis_cached_entry = LIS_CACHE_ENTRY_NONE;
switch (io->ci_type) {
case CIT_READ:
{
struct lov_io *lio = cl2lov_io(env, ios);
struct lov_object *lov = cl2lov(ios->cis_obj);
+ struct lov_io_sub *sub;
ENTRY;
-
LASSERT(list_empty(&lio->lis_active));
- while (!list_empty(&lio->lis_subios)) {
- struct lov_io_sub *sub = list_entry(lio->lis_subios.next,
- struct lov_io_sub,
- sub_list);
-
+ while ((sub = list_first_entry_or_null(&lio->lis_subios,
+ struct lov_io_sub,
+ sub_list)) != NULL) {
list_del_init(&sub->sub_list);
lio->lis_nr_subios--;
LASSERT(atomic_read(&lov->lo_active_ios) > 0);
if (atomic_dec_and_test(&lov->lo_active_ios))
- wake_up_all(&lov->lo_waitq);
+ wake_up(&lov->lo_waitq);
EXIT;
}
if (cl_io_is_fallocate(io)) {
io->u.ci_setattr.sa_falloc_offset = start;
io->u.ci_setattr.sa_falloc_end = end;
+ io->u.ci_setattr.sa_falloc_uid =
+ parent->u.ci_setattr.sa_falloc_uid;
+ io->u.ci_setattr.sa_falloc_gid =
+ parent->u.ci_setattr.sa_falloc_gid;
}
if (cl_io_is_trunc(io)) {
loff_t new_size = parent->u.ci_setattr.sa_attr.lvb_size;
{
int rc;
+ /* Before ending each i/o, we must set lis_cached_entry to tell the
+ * next i/o not to use stale cached lis information.
+ */
+ cl2lov_io(env, ios)->lis_cached_entry = LIS_CACHE_ENTRY_NONE;
+
rc = lov_io_call(env, cl2lov_io(env, ios), lov_io_end_wrapper);
LASSERT(rc == 0);
}
struct lov_io *lio = cl2lov_io(env, ios);
struct lov_io_sub *sub;
struct cl_page_list *plist = &lov_env_info(env)->lti_plist;
- struct cl_page *page;
+ struct cl_page *page = cl_page_list_first(qin);
struct cl_page *tmp;
+ bool dio = false;
int index;
int rc = 0;
ENTRY;
+ if (page->cp_type == CPT_TRANSIENT)
+ dio = true;
+
cl_page_list_init(plist);
while (qin->pl_nr > 0) {
struct cl_2queue *cl2q = &lov_env_info(env)->lti_cl2q;
cl_page_list_move(&cl2q->c2_qin, qin, page);
index = page->cp_lov_index;
- cl_page_list_for_each_safe(page, tmp, qin) {
- /* this page is not on this stripe */
- if (index != page->cp_lov_index)
- continue;
-
- cl_page_list_move(&cl2q->c2_qin, qin, page);
+ /* DIO is already split by stripe */
+ if (!dio) {
+ cl_page_list_for_each_safe(page, tmp, qin) {
+ /* this page is not on this stripe */
+ if (index != page->cp_lov_index)
+ continue;
+
+ cl_page_list_move(&cl2q->c2_qin, qin, page);
+ }
+ } else {
+ cl_page_list_splice(qin, &cl2q->c2_qin);
}
sub = lov_sub_get(env, lio, index);
ENTRY;
if (atomic_dec_and_test(&lov->lo_active_ios))
- wake_up_all(&lov->lo_waitq);
+ wake_up(&lov->lo_waitq);
EXIT;
}