ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.h
(Generate patch)

Comparing libeio/eio.h (file contents):
Revision 1.1 by root, Sat May 10 17:16:39 2008 UTC vs.
Revision 1.4 by root, Sun May 11 13:05:10 2008 UTC

1#ifndef EIO_H_ 1#ifndef EIO_H_
2#define EIO_H_ 2#define EIO_H_
3 3
4#include <stddef.h> 4#include <stddef.h>
5#include <stdlib.h> 5#include <sys/types.h>
6 6
7typedef struct eio_req eio_req; 7typedef struct eio_req eio_req;
8 8
9typedef int (*eio_cb)(eio_req *req); 9typedef int (*eio_cb)(eio_req *req);
10 10
44 ssize_t result; /* result of syscall, e.g. result = read (... */ 44 ssize_t result; /* result of syscall, e.g. result = read (... */
45 off_t offs; /* read, write, truncate, readahead: file offset; mknod: dev_t */ 45 off_t offs; /* read, write, truncate, readahead: file offset; mknod: dev_t */
46 size_t size; /* read, write, readahead, sendfile: length */ 46 size_t size; /* read, write, readahead, sendfile: length */
47 void *ptr1; /* all applicable requests: pathname, old name */ 47 void *ptr1; /* all applicable requests: pathname, old name */
48 void *ptr2; /* all applicable requests: new name or memory buffer */ 48 void *ptr2; /* all applicable requests: new name or memory buffer */
49 eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ 49 eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */
50 eio_tstamp nv2; /* utime, futime: mtime */ 50 eio_tstamp nv2; /* utime, futime: mtime */
51 51
52 int type; /* EIO_xxx constant */ 52 int type; /* EIO_xxx constant */
53 int int1; /* all applicable requests: file descriptor; sendfile: output fd; open: flags */ 53 int int1; /* all applicable requests: file descriptor; sendfile: output fd; open: flags */
54 long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode */ 54 long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode */
55 long int3; /* chown, fchown: gid */ 55 long int3; /* chown, fchown: gid */
92 92
93/* stop polling if poll took longer than duration seconds */ 93/* stop polling if poll took longer than duration seconds */
94void eio_set_max_poll_time (eio_tstamp nseconds); 94void eio_set_max_poll_time (eio_tstamp nseconds);
95/* do not handle more then count requests in one call to eio_poll_cb */ 95/* do not handle more then count requests in one call to eio_poll_cb */
96void eio_set_max_poll_reqs (unsigned int nreqs); 96void eio_set_max_poll_reqs (unsigned int nreqs);
97/* when != 0, then eio_submit blocks as long as nready > count */
98void eio_set_max_outstanding (unsigned int maxreqs);
99/* set maxinum number of idle threads */
100void eio_set_max_idle (unsigned int nthreads);
101 97
102/* set minimum required number 98/* set minimum required number
103 * maximum wanted number 99 * maximum wanted number
104 * or maximum idle number of threads */ 100 * or maximum idle number of threads */
105void eio_set_min_parallel (unsigned int nthreads); 101void eio_set_min_parallel (unsigned int nthreads);
143eio_req *eio_busy (eio_tstamp delay, eio_cb cb); /* ties a thread for this long, simulating busyness */ 139eio_req *eio_busy (eio_tstamp delay, eio_cb cb); /* ties a thread for this long, simulating busyness */
144eio_req *eio_nop (eio_cb cb); /* does nothing except go through the whole process */ 140eio_req *eio_nop (eio_cb cb); /* does nothing except go through the whole process */
145 141
146/* for groups */ 142/* for groups */
147eio_req *eio_grp (eio_cb cb); 143eio_req *eio_grp (eio_cb cb);
148void eio_grp_feed (eio_req *grp, int limit, void (*feed)(eio_req *req)); 144void eio_grp_feed (eio_req *grp, void (*feed)(eio_req *req), int limit);
145void eio_grp_limit (eio_req *grp, int limit);
149void eio_grp_add (eio_req *grp, eio_req *req); 146void eio_grp_add (eio_req *grp, eio_req *req);
150void eio_grp_cancel (eio_req *grp); /* cancels all sub requests but not the group */ 147void eio_grp_cancel (eio_req *grp); /* cancels all sub requests but not the group */
151 148
152/*****************************************************************************/ 149/*****************************************************************************/
153/* low-level request API */ 150/* low-level request API */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines