@@ -1407,7 +1407,8 @@ static bool file_is_noatime(const struct file *file)
return false;
}
-void ll_io_init(struct cl_io *io, const struct file *file, int write)
+void ll_io_init(struct cl_io *io, const struct file *file, int write,
+ struct vvp_io_args *args)
{
struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
struct inode *inode = file_inode(file);
@@ -1420,7 +1421,11 @@ void ll_io_init(struct cl_io *io, const struct file *file, int write)
io->u.ci_wr.wr_sync = file->f_flags & O_SYNC ||
file->f_flags & O_DIRECT ||
IS_SYNC(inode);
+ io->u.ci_wr.wr_sync |= !!(args &&
+ (args->u.normal.via_iocb->ki_flags &
+ IOCB_DSYNC));
}
+
io->ci_obj = ll_i2info(inode)->lli_clob;
io->ci_lockreq = CILR_MAYBE;
if (ll_file_nolock(file)) {
@@ -1491,7 +1496,7 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
restart:
io = vvp_env_thread_io(env);
- ll_io_init(io, file, iot == CIT_WRITE);
+ ll_io_init(io, file, iot == CIT_WRITE, args);
io->ci_ndelay_tried = retried;
if (cl_io_rw_init(env, io, iot, *ppos, count) == 0) {
@@ -786,7 +786,6 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
struct ll_file_data *file, loff_t pos,
size_t count, int rw);
-void ll_io_init(struct cl_io *io, const struct file *file, int write);
enum {
LPROC_LL_READ_BYTES,
@@ -1056,6 +1055,9 @@ static inline struct vvp_io_args *ll_env_args(const struct lu_env *env)
return &ll_env_info(env)->lti_args;
}
+void ll_io_init(struct cl_io *io, const struct file *file, int write,
+ struct vvp_io_args *args);
+
/* llite/llite_mmap.c */
int ll_teardown_mmaps(struct address_space *mapping, u64 first, u64 last);
@@ -503,7 +503,7 @@ static void ll_readahead_handle_work(struct work_struct *wq)
}
io = vvp_env_thread_io(env);
- ll_io_init(io, file, 0);
+ ll_io_init(io, file, 0, NULL);
rc = ll_readahead_file_kms(env, io, &kms);
if (rc != 0)