Lines Matching +full:sync +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
15 #include "sync.h"
22 int mode; member
27 struct io_sync *sync = io_kiocb_to_cmd(req, struct io_sync); in io_sfr_prep() local
29 if (unlikely(sqe->addr || sqe->buf_index || sqe->splice_fd_in)) in io_sfr_prep()
30 return -EINVAL; in io_sfr_prep()
32 sync->off = READ_ONCE(sqe->off); in io_sfr_prep()
33 sync->len = READ_ONCE(sqe->len); in io_sfr_prep()
34 sync->flags = READ_ONCE(sqe->sync_range_flags); in io_sfr_prep()
35 req->flags |= REQ_F_FORCE_ASYNC; in io_sfr_prep()
42 struct io_sync *sync = io_kiocb_to_cmd(req, struct io_sync); in io_sync_file_range() local
48 ret = sync_file_range(req->file, sync->off, sync->len, sync->flags); in io_sync_file_range()
55 struct io_sync *sync = io_kiocb_to_cmd(req, struct io_sync); in io_fsync_prep() local
57 if (unlikely(sqe->addr || sqe->buf_index || sqe->splice_fd_in)) in io_fsync_prep()
58 return -EINVAL; in io_fsync_prep()
60 sync->flags = READ_ONCE(sqe->fsync_flags); in io_fsync_prep()
61 if (unlikely(sync->flags & ~IORING_FSYNC_DATASYNC)) in io_fsync_prep()
62 return -EINVAL; in io_fsync_prep()
64 sync->off = READ_ONCE(sqe->off); in io_fsync_prep()
65 sync->len = READ_ONCE(sqe->len); in io_fsync_prep()
66 req->flags |= REQ_F_FORCE_ASYNC; in io_fsync_prep()
72 struct io_sync *sync = io_kiocb_to_cmd(req, struct io_sync); in io_fsync() local
73 loff_t end = sync->off + sync->len; in io_fsync()
79 ret = vfs_fsync_range(req->file, sync->off, end > 0 ? end : LLONG_MAX, in io_fsync()
80 sync->flags & IORING_FSYNC_DATASYNC); in io_fsync()
87 struct io_sync *sync = io_kiocb_to_cmd(req, struct io_sync); in io_fallocate_prep() local
89 if (sqe->buf_index || sqe->rw_flags || sqe->splice_fd_in) in io_fallocate_prep()
90 return -EINVAL; in io_fallocate_prep()
92 sync->off = READ_ONCE(sqe->off); in io_fallocate_prep()
93 sync->len = READ_ONCE(sqe->addr); in io_fallocate_prep()
94 sync->mode = READ_ONCE(sqe->len); in io_fallocate_prep()
95 req->flags |= REQ_F_FORCE_ASYNC; in io_fallocate_prep()
101 struct io_sync *sync = io_kiocb_to_cmd(req, struct io_sync); in io_fallocate() local
107 ret = vfs_fallocate(req->file, sync->mode, sync->off, sync->len); in io_fallocate()
109 fsnotify_modify(req->file); in io_fallocate()