summaryrefslogtreecommitdiffstats
path: root/sys/sys/aio.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-06-15 20:56:45 +0000
committerjhb <jhb@FreeBSD.org>2016-06-15 20:56:45 +0000
commit593d3fb2187dfe976b490a117964497a8974b12e (patch)
tree7a8a2a5f1dd9b6458fc589141deda494ae0a5e91 /sys/sys/aio.h
parent22f8dd6d9be9521c5ab918b035b122b714a7c8b0 (diff)
downloadFreeBSD-src-593d3fb2187dfe976b490a117964497a8974b12e.zip
FreeBSD-src-593d3fb2187dfe976b490a117964497a8974b12e.tar.gz
Move backend-specific fields of kaiocb into a union.
This reduces the size of kaiocb slightly. I've also added some generic fields that other backends can use in place of the BIO-specific fields. Change the socket and Chelsio DDP backends to use 'backend3' instead of abusing _aiocb_private.status directly. This confines the use of _aiocb_private to the AIO internals in vfs_aio.c. Reviewed by: kib (earlier version) Approved by: re (gjb) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D6547
Diffstat (limited to 'sys/sys/aio.h')
-rw-r--r--sys/sys/aio.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/sys/aio.h b/sys/sys/aio.h
index 3c6ed54..134914e 100644
--- a/sys/sys/aio.h
+++ b/sys/sys/aio.h
@@ -121,10 +121,6 @@ struct kaiocb {
int jobflags; /* (a) job flags */
int inputcharge; /* (*) input blocks */
int outputcharge; /* (*) output blocks */
- struct bio *bp; /* (*) BIO backend BIO pointer */
- struct buf *pbuf; /* (*) BIO backend buffer pointer */
- struct vm_page *pages[btoc(MAXPHYS)+1]; /* BIO backend pages */
- int npages; /* BIO backend number of pages */
struct proc *userproc; /* (*) user process */
struct ucred *cred; /* (*) active credential when created */
struct file *fd_file; /* (*) pointer to file structure */
@@ -134,9 +130,25 @@ struct kaiocb {
struct aiocb uaiocb; /* (*) copy of user I/O control block */
ksiginfo_t ksi; /* (a) realtime signal info */
uint64_t seqno; /* (*) job number */
- int pending; /* (a) number of pending I/O, aio_fsync only */
aio_cancel_fn_t *cancel_fn; /* (a) backend cancel function */
aio_handle_fn_t *handle_fn; /* (c) backend handle function */
+ union { /* Backend-specific data fields */
+ struct { /* BIO backend */
+ struct bio *bp; /* (*) BIO pointer */
+ struct buf *pbuf; /* (*) buffer pointer */
+ struct vm_page *pages[btoc(MAXPHYS)+1]; /* (*) */
+ int npages; /* (*) number of pages */
+ };
+ struct { /* fsync() requests */
+ int pending; /* (a) number of pending I/O */
+ };
+ struct {
+ void *backend1;
+ void *backend2;
+ long backend3;
+ int backend4;
+ };
+ };
};
struct socket;
OpenPOWER on IntegriCloud