2010-11-26 13:45:10 +00:00
|
|
|
// (c) 2010 Thomas Schoebel-Theuer / 1&1 Internet AG
|
2011-03-07 10:27:38 +00:00
|
|
|
#ifndef MARS_AIO_H
|
|
|
|
#define MARS_AIO_H
|
2010-11-26 13:45:10 +00:00
|
|
|
|
|
|
|
#include <linux/aio.h>
|
|
|
|
#include <linux/syscalls.h>
|
|
|
|
|
2011-03-07 10:27:38 +00:00
|
|
|
struct aio_mref_aspect {
|
2010-12-15 12:13:18 +00:00
|
|
|
GENERIC_ASPECT(mref);
|
2010-11-26 13:45:10 +00:00
|
|
|
struct list_head io_head;
|
2011-03-10 11:40:06 +00:00
|
|
|
long long start_jiffies;
|
2010-11-26 13:45:10 +00:00
|
|
|
int resubmit;
|
2010-12-10 17:40:20 +00:00
|
|
|
bool do_dealloc;
|
2010-11-26 13:45:10 +00:00
|
|
|
};
|
|
|
|
|
2011-03-07 10:27:38 +00:00
|
|
|
struct aio_brick {
|
|
|
|
MARS_BRICK(aio);
|
2011-03-11 13:57:54 +00:00
|
|
|
// parameters
|
|
|
|
int readahead;
|
|
|
|
bool o_direct;
|
|
|
|
bool o_fdsync;
|
2010-11-26 13:45:10 +00:00
|
|
|
};
|
|
|
|
|
2011-03-07 10:27:38 +00:00
|
|
|
struct aio_input {
|
|
|
|
MARS_INPUT(aio);
|
2010-11-26 13:45:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct aio_threadinfo {
|
2011-03-10 11:40:06 +00:00
|
|
|
struct list_head mref_list[MARS_PRIO_LOW+1];
|
2011-03-07 10:27:38 +00:00
|
|
|
struct aio_output *output;
|
2010-11-26 13:45:10 +00:00
|
|
|
struct task_struct *thread;
|
|
|
|
wait_queue_head_t event;
|
|
|
|
spinlock_t lock;
|
2011-02-23 20:48:06 +00:00
|
|
|
bool terminated;
|
2010-11-26 13:45:10 +00:00
|
|
|
};
|
|
|
|
|
2011-03-07 10:27:38 +00:00
|
|
|
struct aio_output {
|
|
|
|
MARS_OUTPUT(aio);
|
2010-11-26 13:45:10 +00:00
|
|
|
// private
|
|
|
|
struct file *filp;
|
|
|
|
int fd; // FIXME: remove this!
|
|
|
|
struct aio_threadinfo tinfo[3];
|
|
|
|
aio_context_t ctxp;
|
|
|
|
};
|
|
|
|
|
2011-03-07 10:27:38 +00:00
|
|
|
MARS_TYPES(aio);
|
2010-11-26 13:45:10 +00:00
|
|
|
|
|
|
|
#endif
|