long timeout, int ioret);
struct cl_dio_aio *cl_dio_aio_alloc(struct kiocb *iocb, struct cl_object *obj,
bool is_aio);
-struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool sync);
+struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool write,
+ bool sync);
void cl_dio_aio_free(const struct lu_env *env, struct cl_dio_aio *aio);
void cl_sub_dio_free(struct cl_sub_dio *sdio);
static inline void cl_sync_io_init(struct cl_sync_io *anchor, int nr)
ssize_t csd_bytes;
struct cl_dio_aio *csd_ll_aio;
struct ll_dio_pages csd_dio_pages;
- unsigned csd_creator_free:1;
+ unsigned csd_creator_free:1,
+ csd_write:1;
};
#if defined(HAVE_DIRECTIO_ITER) || defined(HAVE_IOV_ITER_RW) || \
defined(HAVE_DIRECTIO_2ARGS)
* otherwise it is freed on the final call to cl_sync_io_note
* (either in this function or from a ptlrpcd daemon)
*/
- sdio = cl_sub_dio_alloc(ll_dio_aio, sync_submit);
+ sdio = cl_sub_dio_alloc(ll_dio_aio, rw == WRITE, sync_submit);
if (!sdio)
GOTO(out, result = -ENOMEM);
}
EXPORT_SYMBOL(cl_dio_aio_alloc);
-struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool sync)
+struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool write,
+ bool sync)
{
struct cl_sub_dio *sdio;
sdio->csd_ll_aio = ll_aio;
atomic_add(1, &ll_aio->cda_sync.csi_sync_nr);
sdio->csd_creator_free = sync;
+ sdio->csd_write = write;
}
return sdio;
}