LU_OBJECT_HEADER(D_VFSTRACE, env, &io->ci_obj->co_lu,
"io range: %i [%llu, %llu) %i %i\n",
- iot, (__u64)pos, (__u64)pos + count,
+ iot, (__u64)pos, (__u64)(pos + count),
io->u.ci_rw.crw_nonblock, io->u.ci_wr.wr_append);
io->u.ci_rw.crw_pos = pos;
io->u.ci_rw.crw_count = count;
scan->cis_iop->op[io->ci_type].cio_unlock(env, scan);
}
io->ci_state = CIS_UNLOCKED;
- LASSERT(cl_env_info(env)->clt_nr_locks_acquired == 0);
+ LASSERT(!cl_env_info(env)->clt_counters[CNL_TOP].ctc_nr_locks_acquired);
EXIT;
}
EXPORT_SYMBOL(cl_io_unlock);
* Allocates new lock link, and uses it to add a lock to a lockset.
*/
int cl_io_lock_alloc_add(const struct lu_env *env, struct cl_io *io,
- struct cl_lock_descr *descr)
+ struct cl_lock_descr *descr, int enqflags)
{
struct cl_io_lock_link *link;
int result;
ENTRY;
OBD_ALLOC_PTR(link);
if (link != NULL) {
- link->cill_descr = *descr;
- link->cill_fini = cl_free_io_lock_link;
+ link->cill_descr = *descr;
+ link->cill_enq_flags = enqflags;
+ link->cill_fini = cl_free_io_lock_link;
result = cl_io_lock_add(env, io, link);
if (result) /* lock match */
link->cill_fini(env, link);
}
}
if (result == 0)
- result = cl_io_submit_rw(env, io, CRT_READ, queue);
+ result = cl_io_submit_rw(env, io, CRT_READ, queue, CRP_NORMAL);
/*
* Unlock unsent pages in case of error.
*/
* \see cl_io_operations::cio_submit()
*/
int cl_io_submit_rw(const struct lu_env *env, struct cl_io *io,
- enum cl_req_type crt, struct cl_2queue *queue)
+ enum cl_req_type crt, struct cl_2queue *queue,
+ enum cl_req_priority priority)
{
const struct cl_io_slice *scan;
int result = 0;
if (scan->cis_iop->req_op[crt].cio_submit == NULL)
continue;
result = scan->cis_iop->req_op[crt].cio_submit(env, scan, crt,
- queue);
+ queue, priority);
if (result != 0)
break;
}
struct cl_io *io, struct cl_page_list *plist)
{
struct cl_page *page;
+ struct cl_page *temp;
int result;
- int rc;
LINVRNT(plist->pl_owner == cfs_current());
ENTRY;
result = 0;
- cl_page_list_for_each(page, plist) {
- rc = cl_page_own(env, io, page);
+ cl_page_list_for_each_safe(page, temp, plist) {
+ if (cl_page_own(env, io, page) == 0)
result = result ?: page->cp_error;
+ else
+ cl_page_list_del(env, plist, page);
}
RETURN(result);
}