if (!can_populate_pages(env, io, inode))
RETURN(0);
+ if (!(file->f_flags & O_DIRECT)) {
+ result = cl_io_lru_reserve(env, io, pos, cnt);
+ if (result)
+ RETURN(result);
+ }
+
/* Unless this is reading a sparse file, otherwise the lock has already
* been acquired so vvp_prep_size() is an empty op. */
result = vvp_prep_size(env, obj, io, pos, cnt, &exceed);
if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_NOSEC) && lock_inode)
RETURN(-EINVAL);
+ if (!(file->f_flags & O_DIRECT)) {
+ result = cl_io_lru_reserve(env, io, pos, cnt);
+ if (result)
+ RETURN(result);
+ }
+
if (vio->vui_iter == NULL) {
/* from a temp io in ll_cl_init(). */
result = 0;