|
@ -362,12 +362,8 @@ static int gettimeofday(struct timeval *tv, struct timezone *tz) |
|
|
|
|
|
|
|
|
#define EIO_TICKS ((1000000 + 1023) >> 10) |
|
|
#define EIO_TICKS ((1000000 + 1023) >> 10) |
|
|
|
|
|
|
|
|
#define ETP_PRI_MIN EIO_PRI_MIN |
|
|
|
|
|
#define ETP_PRI_MAX EIO_PRI_MAX |
|
|
|
|
|
|
|
|
|
|
|
struct etp_worker; |
|
|
struct etp_worker; |
|
|
|
|
|
|
|
|
#define ETP_REQ eio_req |
|
|
|
|
|
#define ETP_DESTROY(req) eio_destroy (req) |
|
|
#define ETP_DESTROY(req) eio_destroy (req) |
|
|
static int eio_finish (eio_req *req); |
|
|
static int eio_finish (eio_req *req); |
|
|
#define ETP_FINISH(req) eio_finish (req) |
|
|
#define ETP_FINISH(req) eio_finish (req) |
|
@ -376,8 +372,6 @@ static void eio_execute (struct etp_worker *self, eio_req *req); |
|
|
|
|
|
|
|
|
/*****************************************************************************/ |
|
|
/*****************************************************************************/ |
|
|
|
|
|
|
|
|
#define ETP_NUM_PRI (ETP_PRI_MAX - ETP_PRI_MIN + 1) |
|
|
|
|
|
|
|
|
|
|
|
/* calculate time difference in ~1/EIO_TICKS of a second */ |
|
|
/* calculate time difference in ~1/EIO_TICKS of a second */ |
|
|
ecb_inline int |
|
|
ecb_inline int |
|
|
tvdiff (struct timeval *tv1, struct timeval *tv2) |
|
|
tvdiff (struct timeval *tv1, struct timeval *tv2) |
|
@ -388,8 +382,8 @@ tvdiff (struct timeval *tv1, struct timeval *tv2) |
|
|
|
|
|
|
|
|
static unsigned int started, idle, wanted = 4; |
|
|
static unsigned int started, idle, wanted = 4; |
|
|
|
|
|
|
|
|
static void (*want_poll_cb) (void); |
|
|
static void (*want_poll_cb) (eio_channel *); |
|
|
static void (*done_poll_cb) (void); |
|
|
static void (*done_poll_cb) (eio_channel *); |
|
|
|
|
|
|
|
|
static unsigned int max_poll_time; /* reslock */ |
|
|
static unsigned int max_poll_time; /* reslock */ |
|
|
static unsigned int max_poll_reqs; /* reslock */ |
|
|
static unsigned int max_poll_reqs; /* reslock */ |
|
@ -506,18 +500,8 @@ etp_nthreads (void) |
|
|
return retval; |
|
|
return retval; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* a somewhat faster data structure might be nice, but |
|
|
|
|
|
* with 8 priorities this actually needs <20 insns |
|
|
|
|
|
* per shift, the most expensive operation. |
|
|
|
|
|
*/ |
|
|
|
|
|
typedef struct { |
|
|
|
|
|
ETP_REQ *qs[ETP_NUM_PRI], *qe[ETP_NUM_PRI]; /* qstart, qend */ |
|
|
|
|
|
int size; |
|
|
|
|
|
} etp_reqq; |
|
|
|
|
|
|
|
|
|
|
|
static etp_reqq req_queue; |
|
|
static etp_reqq req_queue; |
|
|
static etp_reqq res_queue; |
|
|
static eio_channel default_channel; |
|
|
|
|
|
|
|
|
static void ecb_noinline ecb_cold |
|
|
static void ecb_noinline ecb_cold |
|
|
reqq_init (etp_reqq *q) |
|
|
reqq_init (etp_reqq *q) |
|
@ -574,7 +558,7 @@ reqq_shift (etp_reqq *q) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static int ecb_cold |
|
|
static int ecb_cold |
|
|
etp_init (void (*want_poll)(void), void (*done_poll)(void)) |
|
|
etp_init (void (*want_poll)(eio_channel *), void (*done_poll)(eio_channel *)) |
|
|
{ |
|
|
{ |
|
|
X_MUTEX_CREATE (wrklock); |
|
|
X_MUTEX_CREATE (wrklock); |
|
|
X_MUTEX_CREATE (reslock); |
|
|
X_MUTEX_CREATE (reslock); |
|
@ -582,7 +566,7 @@ etp_init (void (*want_poll)(void), void (*done_poll)(void)) |
|
|
X_COND_CREATE (reqwait); |
|
|
X_COND_CREATE (reqwait); |
|
|
|
|
|
|
|
|
reqq_init (&req_queue); |
|
|
reqq_init (&req_queue); |
|
|
reqq_init (&res_queue); |
|
|
eio_channel_init (&default_channel, 0); |
|
|
|
|
|
|
|
|
wrk_first.next = |
|
|
wrk_first.next = |
|
|
wrk_first.prev = &wrk_first; |
|
|
wrk_first.prev = &wrk_first; |
|
@ -656,12 +640,19 @@ etp_end_thread (void) |
|
|
X_UNLOCK (wrklock); |
|
|
X_UNLOCK (wrklock); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
eio_channel_init(eio_channel *channel, void *data) { |
|
|
|
|
|
reqq_init(&channel->res_queue); |
|
|
|
|
|
channel->data = data; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static int |
|
|
static int |
|
|
etp_poll (void) |
|
|
etp_poll (eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
unsigned int maxreqs; |
|
|
unsigned int maxreqs; |
|
|
unsigned int maxtime; |
|
|
unsigned int maxtime; |
|
|
struct timeval tv_start, tv_now; |
|
|
struct timeval tv_start, tv_now; |
|
|
|
|
|
if(!channel) channel = &default_channel; |
|
|
|
|
|
|
|
|
X_LOCK (reslock); |
|
|
X_LOCK (reslock); |
|
|
maxreqs = max_poll_reqs; |
|
|
maxreqs = max_poll_reqs; |
|
@ -678,14 +669,14 @@ etp_poll (void) |
|
|
etp_maybe_start_thread (); |
|
|
etp_maybe_start_thread (); |
|
|
|
|
|
|
|
|
X_LOCK (reslock); |
|
|
X_LOCK (reslock); |
|
|
req = reqq_shift (&res_queue); |
|
|
req = reqq_shift (&channel->res_queue); |
|
|
|
|
|
|
|
|
if (req) |
|
|
if (req) |
|
|
{ |
|
|
{ |
|
|
--npending; |
|
|
--npending; |
|
|
|
|
|
|
|
|
if (!res_queue.size && done_poll_cb) |
|
|
if (!channel->res_queue.size && done_poll_cb) |
|
|
done_poll_cb (); |
|
|
done_poll_cb (channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
X_UNLOCK (reslock); |
|
|
X_UNLOCK (reslock); |
|
@ -752,8 +743,8 @@ etp_submit (ETP_REQ *req) |
|
|
|
|
|
|
|
|
++npending; |
|
|
++npending; |
|
|
|
|
|
|
|
|
if (!reqq_push (&res_queue, req) && want_poll_cb) |
|
|
if (!reqq_push (&req->channel->res_queue, req) && want_poll_cb) |
|
|
want_poll_cb (); |
|
|
want_poll_cb (req->channel); |
|
|
|
|
|
|
|
|
X_UNLOCK (reslock); |
|
|
X_UNLOCK (reslock); |
|
|
} |
|
|
} |
|
@ -970,9 +961,9 @@ eio_set_max_parallel (unsigned int nthreads) |
|
|
etp_set_max_parallel (nthreads); |
|
|
etp_set_max_parallel (nthreads); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int eio_poll (void) |
|
|
int eio_poll (eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return etp_poll (); |
|
|
return etp_poll (channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*****************************************************************************/ |
|
|
/*****************************************************************************/ |
|
@ -2092,8 +2083,8 @@ X_THREAD_PROC (etp_proc) |
|
|
|
|
|
|
|
|
++npending; |
|
|
++npending; |
|
|
|
|
|
|
|
|
if (!reqq_push (&res_queue, req) && want_poll_cb) |
|
|
if (!reqq_push (&req->channel->res_queue, req) && want_poll_cb) |
|
|
want_poll_cb (); |
|
|
want_poll_cb (req->channel); |
|
|
|
|
|
|
|
|
self->req = 0; |
|
|
self->req = 0; |
|
|
etp_worker_clear (self); |
|
|
etp_worker_clear (self); |
|
@ -2112,7 +2103,7 @@ quit: |
|
|
/*****************************************************************************/ |
|
|
/*****************************************************************************/ |
|
|
|
|
|
|
|
|
int ecb_cold |
|
|
int ecb_cold |
|
|
eio_init (void (*want_poll)(void), void (*done_poll)(void)) |
|
|
eio_init (void (*want_poll)(eio_channel *), void (*done_poll)(eio_channel *)) |
|
|
{ |
|
|
{ |
|
|
#if !HAVE_PREADWRITE |
|
|
#if !HAVE_PREADWRITE |
|
|
X_MUTEX_CREATE (preadwritelock); |
|
|
X_MUTEX_CREATE (preadwritelock); |
|
@ -2138,7 +2129,8 @@ eio_api_destroy (eio_req *req) |
|
|
req->pri = pri; \ |
|
|
req->pri = pri; \ |
|
|
req->finish = cb; \ |
|
|
req->finish = cb; \ |
|
|
req->data = data; \ |
|
|
req->data = data; \ |
|
|
req->destroy = eio_api_destroy; |
|
|
req->destroy = eio_api_destroy; \ |
|
|
|
|
|
req->channel = channel |
|
|
|
|
|
|
|
|
#define SEND eio_submit (req); return req |
|
|
#define SEND eio_submit (req); return req |
|
|
|
|
|
|
|
@ -2294,209 +2286,209 @@ eio_execute (etp_worker *self, eio_req *req) |
|
|
|
|
|
|
|
|
#ifndef EIO_NO_WRAPPERS |
|
|
#ifndef EIO_NO_WRAPPERS |
|
|
|
|
|
|
|
|
eio_req *eio_nop (int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_nop (int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_NOP); SEND; |
|
|
REQ (EIO_NOP); SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_busy (double delay, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_busy (double delay, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_BUSY); req->nv1 = delay; SEND; |
|
|
REQ (EIO_BUSY); req->nv1 = delay; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_sync (int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_sync (int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_SYNC); SEND; |
|
|
REQ (EIO_SYNC); SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_fsync (int fd, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_fsync (int fd, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FSYNC); req->int1 = fd; SEND; |
|
|
REQ (EIO_FSYNC); req->int1 = fd; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_msync (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_msync (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_MSYNC); req->ptr2 = addr; req->size = length; req->int1 = flags; SEND; |
|
|
REQ (EIO_MSYNC); req->ptr2 = addr; req->size = length; req->int1 = flags; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_fdatasync (int fd, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_fdatasync (int fd, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FDATASYNC); req->int1 = fd; SEND; |
|
|
REQ (EIO_FDATASYNC); req->int1 = fd; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_syncfs (int fd, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_syncfs (int fd, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_SYNCFS); req->int1 = fd; SEND; |
|
|
REQ (EIO_SYNCFS); req->int1 = fd; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_sync_file_range (int fd, off_t offset, size_t nbytes, unsigned int flags, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_sync_file_range (int fd, off_t offset, size_t nbytes, unsigned int flags, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_SYNC_FILE_RANGE); req->int1 = fd; req->offs = offset; req->size = nbytes; req->int2 = flags; SEND; |
|
|
REQ (EIO_SYNC_FILE_RANGE); req->int1 = fd; req->offs = offset; req->size = nbytes; req->int2 = flags; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_MTOUCH); req->ptr2 = addr; req->size = length; req->int1 = flags; SEND; |
|
|
REQ (EIO_MTOUCH); req->ptr2 = addr; req->size = length; req->int1 = flags; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_mlock (void *addr, size_t length, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_mlock (void *addr, size_t length, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_MLOCK); req->ptr2 = addr; req->size = length; SEND; |
|
|
REQ (EIO_MLOCK); req->ptr2 = addr; req->size = length; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_mlockall (int flags, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_mlockall (int flags, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_MLOCKALL); req->int1 = flags; SEND; |
|
|
REQ (EIO_MLOCKALL); req->int1 = flags; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_fallocate (int fd, int mode, off_t offset, size_t len, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_fallocate (int fd, int mode, off_t offset, size_t len, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FALLOCATE); req->int1 = fd; req->int2 = mode; req->offs = offset; req->size = len; SEND; |
|
|
REQ (EIO_FALLOCATE); req->int1 = fd; req->int2 = mode; req->offs = offset; req->size = len; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_close (int fd, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_close (int fd, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_CLOSE); req->int1 = fd; SEND; |
|
|
REQ (EIO_CLOSE); req->int1 = fd; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_readahead (int fd, off_t offset, size_t length, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_readahead (int fd, off_t offset, size_t length, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_READAHEAD); req->int1 = fd; req->offs = offset; req->size = length; SEND; |
|
|
REQ (EIO_READAHEAD); req->int1 = fd; req->offs = offset; req->size = length; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_read (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_read (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_READ); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = buf; SEND; |
|
|
REQ (EIO_READ); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = buf; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_write (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_write (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_WRITE); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = buf; SEND; |
|
|
REQ (EIO_WRITE); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = buf; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FSTAT); req->int1 = fd; SEND; |
|
|
REQ (EIO_FSTAT); req->int1 = fd; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FSTATVFS); req->int1 = fd; SEND; |
|
|
REQ (EIO_FSTATVFS); req->int1 = fd; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_futime (int fd, double atime, double mtime, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_futime (int fd, double atime, double mtime, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FUTIME); req->int1 = fd; req->nv1 = atime; req->nv2 = mtime; SEND; |
|
|
REQ (EIO_FUTIME); req->int1 = fd; req->nv1 = atime; req->nv2 = mtime; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_ftruncate (int fd, off_t offset, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_ftruncate (int fd, off_t offset, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FTRUNCATE); req->int1 = fd; req->offs = offset; SEND; |
|
|
REQ (EIO_FTRUNCATE); req->int1 = fd; req->offs = offset; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_fchmod (int fd, eio_mode_t mode, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_fchmod (int fd, eio_mode_t mode, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FCHMOD); req->int1 = fd; req->int2 = (long)mode; SEND; |
|
|
REQ (EIO_FCHMOD); req->int1 = fd; req->int2 = (long)mode; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_fchown (int fd, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_fchown (int fd, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_FCHOWN); req->int1 = fd; req->int2 = (long)uid; req->int3 = (long)gid; SEND; |
|
|
REQ (EIO_FCHOWN); req->int1 = fd; req->int2 = (long)uid; req->int3 = (long)gid; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_dup2 (int fd, int fd2, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_dup2 (int fd, int fd2, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_DUP2); req->int1 = fd; req->int2 = fd2; SEND; |
|
|
REQ (EIO_DUP2); req->int1 = fd; req->int2 = fd2; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_SENDFILE); req->int1 = out_fd; req->int2 = in_fd; req->offs = in_offset; req->size = length; SEND; |
|
|
REQ (EIO_SENDFILE); req->int1 = out_fd; req->int2 = in_fd; req->offs = in_offset; req->size = length; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_open (const char *path, int flags, eio_mode_t mode, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_open (const char *path, int flags, eio_mode_t mode, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_OPEN); PATH; req->int1 = flags; req->int2 = (long)mode; SEND; |
|
|
REQ (EIO_OPEN); PATH; req->int1 = flags; req->int2 = (long)mode; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_utime (const char *path, double atime, double mtime, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_utime (const char *path, double atime, double mtime, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_UTIME); PATH; req->nv1 = atime; req->nv2 = mtime; SEND; |
|
|
REQ (EIO_UTIME); PATH; req->nv1 = atime; req->nv2 = mtime; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_truncate (const char *path, off_t offset, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_truncate (const char *path, off_t offset, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_TRUNCATE); PATH; req->offs = offset; SEND; |
|
|
REQ (EIO_TRUNCATE); PATH; req->offs = offset; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_chown (const char *path, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_chown (const char *path, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_CHOWN); PATH; req->int2 = (long)uid; req->int3 = (long)gid; SEND; |
|
|
REQ (EIO_CHOWN); PATH; req->int2 = (long)uid; req->int3 = (long)gid; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_chmod (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_chmod (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_CHMOD); PATH; req->int2 = (long)mode; SEND; |
|
|
REQ (EIO_CHMOD); PATH; req->int2 = (long)mode; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_mkdir (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_mkdir (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_MKDIR); PATH; req->int2 = (long)mode; SEND; |
|
|
REQ (EIO_MKDIR); PATH; req->int2 = (long)mode; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static eio_req * |
|
|
static eio_req * |
|
|
eio__1path (int type, const char *path, int pri, eio_cb cb, void *data) |
|
|
eio__1path (int type, const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (type); PATH; SEND; |
|
|
REQ (type); PATH; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_readlink (const char *path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_readlink (const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__1path (EIO_READLINK, path, pri, cb, data); |
|
|
return eio__1path (EIO_READLINK, path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_realpath (const char *path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_realpath (const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__1path (EIO_REALPATH, path, pri, cb, data); |
|
|
return eio__1path (EIO_REALPATH, path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_stat (const char *path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_stat (const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__1path (EIO_STAT, path, pri, cb, data); |
|
|
return eio__1path (EIO_STAT, path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_lstat (const char *path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_lstat (const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__1path (EIO_LSTAT, path, pri, cb, data); |
|
|
return eio__1path (EIO_LSTAT, path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_statvfs (const char *path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_statvfs (const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__1path (EIO_STATVFS, path, pri, cb, data); |
|
|
return eio__1path (EIO_STATVFS, path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_unlink (const char *path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_unlink (const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__1path (EIO_UNLINK, path, pri, cb, data); |
|
|
return eio__1path (EIO_UNLINK, path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_rmdir (const char *path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_rmdir (const char *path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__1path (EIO_RMDIR, path, pri, cb, data); |
|
|
return eio__1path (EIO_RMDIR, path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_readdir (const char *path, int flags, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_readdir (const char *path, int flags, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_READDIR); PATH; req->int1 = flags; SEND; |
|
|
REQ (EIO_READDIR); PATH; req->int1 = flags; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_mknod (const char *path, eio_mode_t mode, dev_t dev, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_mknod (const char *path, eio_mode_t mode, dev_t dev, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_MKNOD); PATH; req->int2 = (long)mode; req->offs = (off_t)dev; SEND; |
|
|
REQ (EIO_MKNOD); PATH; req->int2 = (long)mode; req->offs = (off_t)dev; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static eio_req * |
|
|
static eio_req * |
|
|
eio__2path (int type, const char *path, const char *new_path, int pri, eio_cb cb, void *data) |
|
|
eio__2path (int type, const char *path, const char *new_path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (type); PATH; |
|
|
REQ (type); PATH; |
|
|
|
|
|
|
|
@ -2511,29 +2503,29 @@ eio__2path (int type, const char *path, const char *new_path, int pri, eio_cb cb |
|
|
SEND; |
|
|
SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_link (const char *path, const char *new_path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_link (const char *path, const char *new_path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__2path (EIO_LINK, path, new_path, pri, cb, data); |
|
|
return eio__2path (EIO_LINK, path, new_path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_symlink (const char *path, const char *new_path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_symlink (const char *path, const char *new_path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__2path (EIO_SYMLINK, path, new_path, pri, cb, data); |
|
|
return eio__2path (EIO_SYMLINK, path, new_path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
return eio__2path (EIO_RENAME, path, new_path, pri, cb, data); |
|
|
return eio__2path (EIO_RENAME, path, new_path, pri, cb, data, channel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
eio_req *eio_custom (void (*execute)(eio_req *), int pri, eio_cb cb, void *data) |
|
|
eio_req *eio_custom (void (*execute)(eio_req *), int pri, eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
REQ (EIO_CUSTOM); req->feed = execute; SEND; |
|
|
REQ (EIO_CUSTOM); req->feed = execute; SEND; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
eio_req *eio_grp (eio_cb cb, void *data) |
|
|
eio_req *eio_grp (eio_cb cb, void *data, eio_channel *channel) |
|
|
{ |
|
|
{ |
|
|
const int pri = EIO_PRI_MAX; |
|
|
const int pri = EIO_PRI_MAX; |
|
|
|
|
|
|
|
|