1 | /* |
1 | /* |
2 | * libeio API header |
2 | * libeio API header |
3 | * |
3 | * |
4 | * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libeio@schmorp.de> |
4 | * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libeio@schmorp.de> |
5 | * All rights reserved. |
5 | * All rights reserved. |
6 | * |
6 | * |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
8 | * tion, are permitted provided that the following conditions are met: |
8 | * tion, are permitted provided that the following conditions are met: |
9 | * |
9 | * |
… | |
… | |
93 | EIO_DT_WHT = 14, |
93 | EIO_DT_WHT = 14, |
94 | EIO_DT_MAX = 15 /* highest DT_VALUE ever, hopefully */ |
94 | EIO_DT_MAX = 15 /* highest DT_VALUE ever, hopefully */ |
95 | }; |
95 | }; |
96 | |
96 | |
97 | struct eio_dirent { |
97 | struct eio_dirent { |
98 | char *name; |
98 | int nameofs; /* offset of null-terminated name string in (char *)req->ptr2 */ |
99 | ino_t inode; |
99 | unsigned short namelen; /* size of filename without trailing 0 */ |
100 | unsigned short namelen; |
100 | unsigned char type; /* one of EIO_DT_* */ |
101 | unsigned char type; |
|
|
102 | unsigned char score; /* internal use */ |
101 | signed char score; /* internal use */ |
103 | /* 0-4 bytes padding */ |
102 | ino_t inode; /* the inode number, if available, otherwise unspecified */ |
|
|
103 | }; |
|
|
104 | |
|
|
105 | /* eio_msync flags */ |
|
|
106 | enum { |
|
|
107 | EIO_MS_ASYNC = 1, |
|
|
108 | EIO_MS_INVALIDATE = 2, |
|
|
109 | EIO_MS_SYNC = 4 |
|
|
110 | }; |
|
|
111 | |
|
|
112 | /* eio_mtouch flags */ |
|
|
113 | |
|
|
114 | enum { |
|
|
115 | EIO_MT_MODIFY = 1 |
104 | }; |
116 | }; |
105 | |
117 | |
106 | /* eio_sync_file_range flags */ |
118 | /* eio_sync_file_range flags */ |
107 | |
119 | |
108 | enum { |
120 | enum { |
… | |
… | |
142 | eio_req volatile *next; /* private ETP */ |
154 | eio_req volatile *next; /* private ETP */ |
143 | |
155 | |
144 | ssize_t result; /* result of syscall, e.g. result = read (... */ |
156 | ssize_t result; /* result of syscall, e.g. result = read (... */ |
145 | off_t offs; /* read, write, truncate, readahead, sync_file_range: file offset */ |
157 | off_t offs; /* read, write, truncate, readahead, sync_file_range: file offset */ |
146 | size_t size; /* read, write, readahead, sendfile, msync, sync_file_range: length */ |
158 | size_t size; /* read, write, readahead, sendfile, msync, sync_file_range: length */ |
147 | void *ptr1; /* all applicable requests: pathname, old name; readdir: possible output memory buffer */ |
159 | void *ptr1; /* all applicable requests: pathname, old name; readdir: optional eio_dirents */ |
148 | void *ptr2; /* all applicable requests: new name or memory buffer */ |
160 | void *ptr2; /* all applicable requests: new name or memory buffer; readdir: name strings */ |
149 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
161 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
150 | eio_tstamp nv2; /* utime, futime: mtime */ |
162 | eio_tstamp nv2; /* utime, futime: mtime */ |
151 | |
163 | |
152 | int type; /* EIO_xxx constant ETP */ |
164 | int type; /* EIO_xxx constant ETP */ |
153 | int int1; /* all applicable requests: file descriptor; sendfile: output fd; open, msync, readdir: flags */ |
165 | int int1; /* all applicable requests: file descriptor; sendfile: output fd; open, msync, readdir: flags */ |