1 | ./" static inline void io_prep_fsync(struct iocb *iocb, int fd) |
---|
2 | ./" { |
---|
3 | ./" memset(iocb, 0, sizeof(*iocb)); |
---|
4 | ./" iocb->aio_fildes = fd; |
---|
5 | ./" iocb->aio_lio_opcode = IO_CMD_FSYNC; |
---|
6 | ./" iocb->aio_reqprio = 0; |
---|
7 | ./" } |
---|
8 | .TH io_prep_fsync 3 2002-09-12 "Linux 2.4" Linux AIO" |
---|
9 | .SH NAME |
---|
10 | io_prep_fsync \- Synchronize a file's complete in-core state with that on disk |
---|
11 | .SH SYNOPSYS |
---|
12 | .nf |
---|
13 | .B #include <errno.h> |
---|
14 | .br |
---|
15 | .sp |
---|
16 | .B #include <libaio.h> |
---|
17 | .br |
---|
18 | .sp |
---|
19 | .BI "static inline void io_prep_fsync(struct iocb *iocb, int fd)" |
---|
20 | .sp |
---|
21 | struct iocb { |
---|
22 | void *data; |
---|
23 | unsigned key; |
---|
24 | short aio_lio_opcode; |
---|
25 | short aio_reqprio; |
---|
26 | int aio_fildes; |
---|
27 | }; |
---|
28 | .sp |
---|
29 | .fi |
---|
30 | .SH DESCRIPTION |
---|
31 | This is an inline convenience function for setting up an iocbv for a FSYNC request. |
---|
32 | .br |
---|
33 | The file for which |
---|
34 | .TP |
---|
35 | .IR "iocb->aio_fildes = fd" |
---|
36 | is a descriptor is set up with |
---|
37 | the command |
---|
38 | .TP |
---|
39 | .IR "iocb->aio_lio_opcode = IO_CMD_FSYNC: |
---|
40 | . |
---|
41 | .PP |
---|
42 | The io_prep_fsync() function shall set up an IO_CMD_FSYNC operation |
---|
43 | to asynchronously force all I/O |
---|
44 | operations associated with the file indicated by the file |
---|
45 | descriptor aio_fildes member of the iocb structure referenced by |
---|
46 | the iocb argument and queued at the time of the call to |
---|
47 | io_submit() to the synchronized I/O completion state. The function |
---|
48 | call shall return when the synchronization request has been |
---|
49 | initiated or queued to the file or device (even when the data |
---|
50 | cannot be synchronized immediately). |
---|
51 | |
---|
52 | All currently queued I/O operations shall be completed as if by a call |
---|
53 | to fsync(); that is, as defined for synchronized I/O file |
---|
54 | integrity completion. If the |
---|
55 | operation queued by io_prep_fsync() fails, then, as for fsync(), |
---|
56 | outstanding I/O operations are not guaranteed to have |
---|
57 | been completed. |
---|
58 | |
---|
59 | If io_prep_fsync() succeeds, then it is only the I/O that was queued |
---|
60 | at the time of the call to io_submit() that is guaranteed to be |
---|
61 | forced to the relevant completion state. The completion of |
---|
62 | subsequent I/O on the file descriptor is not guaranteed to be |
---|
63 | completed in a synchronized fashion. |
---|
64 | .PP |
---|
65 | This function returns immediately . To schedule the operation, the |
---|
66 | function |
---|
67 | .IR io_submit |
---|
68 | must be called. |
---|
69 | .PP |
---|
70 | Simultaneous asynchronous operations using the same iocb produce |
---|
71 | undefined results. |
---|
72 | .SH "RETURN VALUES" |
---|
73 | None |
---|
74 | .SH ERRORS |
---|
75 | None |
---|
76 | .SH "SEE ALSO" |
---|
77 | .BR io(3), |
---|
78 | .BR io_cancel(3), |
---|
79 | .BR io_fsync(3), |
---|
80 | .BR io_getevents(3), |
---|
81 | .BR io_prep_pread(3), |
---|
82 | .BR io_prep_pwrite(3), |
---|
83 | .BR io_queue_init(3), |
---|
84 | .BR io_queue_release(3), |
---|
85 | .BR io_queue_run(3), |
---|
86 | .BR io_queue_wait(3), |
---|
87 | .BR io_set_callback(3), |
---|
88 | .BR io_submit(3), |
---|
89 | .BR errno(3) |
---|