Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 1 | /* |
Jens Axboe | da751ca | 2007-03-14 10:59:33 +0100 | [diff] [blame] | 2 | * net engine |
| 3 | * |
| 4 | * IO engine that reads/writes to/from sockets. |
| 5 | * |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 6 | */ |
| 7 | #include <stdio.h> |
| 8 | #include <stdlib.h> |
| 9 | #include <unistd.h> |
| 10 | #include <errno.h> |
| 11 | #include <assert.h> |
| 12 | #include <netinet/in.h> |
| 13 | #include <arpa/inet.h> |
| 14 | #include <netdb.h> |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 15 | #include <sys/poll.h> |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 16 | |
| 17 | #include "../fio.h" |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 18 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 19 | struct netio_data { |
| 20 | int listenfd; |
| 21 | int send_to_net; |
| 22 | char host[64]; |
| 23 | struct sockaddr_in addr; |
| 24 | }; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 25 | |
| 26 | static int fio_netio_prep(struct thread_data *td, struct io_u *io_u) |
| 27 | { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 28 | struct netio_data *nd = td->io_ops->data; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 29 | struct fio_file *f = io_u->file; |
| 30 | |
Jens Axboe | 7a6499d | 2007-02-07 09:35:29 +0100 | [diff] [blame] | 31 | /* |
| 32 | * Make sure we don't see spurious reads to a receiver, and vice versa |
| 33 | */ |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 34 | if ((nd->send_to_net && io_u->ddir == DDIR_READ) || |
| 35 | (!nd->send_to_net && io_u->ddir == DDIR_WRITE)) { |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 36 | td_verror(td, EINVAL, "bad direction"); |
Jens Axboe | 7a6499d | 2007-02-07 09:35:29 +0100 | [diff] [blame] | 37 | return 1; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 38 | } |
Jens Axboe | 7a6499d | 2007-02-07 09:35:29 +0100 | [diff] [blame] | 39 | |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 40 | if (io_u->ddir == DDIR_SYNC) |
| 41 | return 0; |
| 42 | if (io_u->offset == f->last_completed_pos) |
| 43 | return 0; |
| 44 | |
Jens Axboe | e01547d | 2007-02-06 19:16:01 +0100 | [diff] [blame] | 45 | /* |
| 46 | * If offset is different from last end position, it's a seek. |
| 47 | * As network io is purely sequential, we don't allow seeks. |
| 48 | */ |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 49 | td_verror(td, EINVAL, "cannot seek"); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 50 | return 1; |
| 51 | } |
| 52 | |
| 53 | static int fio_netio_queue(struct thread_data *td, struct io_u *io_u) |
| 54 | { |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 55 | struct fio_file *f = io_u->file; |
Jens Axboe | d4f12dd | 2007-02-08 12:59:02 +0100 | [diff] [blame] | 56 | int ret, flags = 0; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 57 | |
Jens Axboe | 7a6499d | 2007-02-07 09:35:29 +0100 | [diff] [blame] | 58 | if (io_u->ddir == DDIR_WRITE) { |
Jens Axboe | 7a6499d | 2007-02-07 09:35:29 +0100 | [diff] [blame] | 59 | /* |
| 60 | * if we are going to write more, set MSG_MORE |
| 61 | */ |
| 62 | if (td->this_io_bytes[DDIR_WRITE] + io_u->xfer_buflen < |
Jens Axboe | 7bb48f8 | 2007-03-27 15:30:28 +0200 | [diff] [blame] | 63 | td->o.size) |
Jens Axboe | 7a6499d | 2007-02-07 09:35:29 +0100 | [diff] [blame] | 64 | flags = MSG_MORE; |
| 65 | |
| 66 | ret = send(f->fd, io_u->xfer_buf, io_u->xfer_buflen, flags); |
Jens Axboe | d4f12dd | 2007-02-08 12:59:02 +0100 | [diff] [blame] | 67 | } else if (io_u->ddir == DDIR_READ) { |
| 68 | flags = MSG_WAITALL; |
| 69 | ret = recv(f->fd, io_u->xfer_buf, io_u->xfer_buflen, flags); |
| 70 | } else |
Jens Axboe | 7a6499d | 2007-02-07 09:35:29 +0100 | [diff] [blame] | 71 | ret = 0; /* must be a SYNC */ |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 72 | |
Jens Axboe | cec6b55 | 2007-02-06 20:15:38 +0100 | [diff] [blame] | 73 | if (ret != (int) io_u->xfer_buflen) { |
Jens Axboe | 22819ec | 2007-02-18 07:47:14 +0100 | [diff] [blame] | 74 | if (ret >= 0) { |
Jens Axboe | cec6b55 | 2007-02-06 20:15:38 +0100 | [diff] [blame] | 75 | io_u->resid = io_u->xfer_buflen - ret; |
| 76 | io_u->error = 0; |
Jens Axboe | 36167d8 | 2007-02-18 05:41:31 +0100 | [diff] [blame] | 77 | return FIO_Q_COMPLETED; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 78 | } else |
| 79 | io_u->error = errno; |
| 80 | } |
| 81 | |
Jens Axboe | 36167d8 | 2007-02-18 05:41:31 +0100 | [diff] [blame] | 82 | if (io_u->error) |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 83 | td_verror(td, io_u->error, "xfer"); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 84 | |
Jens Axboe | 36167d8 | 2007-02-18 05:41:31 +0100 | [diff] [blame] | 85 | return FIO_Q_COMPLETED; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 86 | } |
| 87 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 88 | static int fio_netio_connect(struct thread_data *td, struct fio_file *f) |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 89 | { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 90 | struct netio_data *nd = td->io_ops->data; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 91 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 92 | f->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
| 93 | if (f->fd < 0) { |
| 94 | td_verror(td, errno, "socket"); |
| 95 | return 1; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 96 | } |
| 97 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 98 | if (connect(f->fd, (struct sockaddr *) &nd->addr, sizeof(nd->addr)) < 0) { |
| 99 | td_verror(td, errno, "connect"); |
| 100 | return 1; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | return 0; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 104 | } |
| 105 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 106 | static int fio_netio_accept(struct thread_data *td, struct fio_file *f) |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 107 | { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 108 | struct netio_data *nd = td->io_ops->data; |
| 109 | socklen_t socklen = sizeof(nd->addr); |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 110 | struct pollfd pfd; |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 111 | int ret; |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 112 | |
Jens Axboe | 6d86144 | 2007-03-15 09:22:23 +0100 | [diff] [blame] | 113 | log_info("fio: waiting for connection\n"); |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 114 | |
| 115 | /* |
| 116 | * Accept loop. poll for incoming events, accept them. Repeat until we |
| 117 | * have all connections. |
| 118 | */ |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 119 | while (!td->terminate) { |
| 120 | pfd.fd = nd->listenfd; |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 121 | pfd.events = POLLIN; |
| 122 | |
| 123 | ret = poll(&pfd, 1, -1); |
| 124 | if (ret < 0) { |
| 125 | if (errno == EINTR) |
| 126 | continue; |
| 127 | |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 128 | td_verror(td, errno, "poll"); |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 129 | break; |
| 130 | } else if (!ret) |
| 131 | continue; |
| 132 | |
Jens Axboe | 0c09442 | 2007-02-11 04:44:02 +0100 | [diff] [blame] | 133 | /* |
| 134 | * should be impossible |
| 135 | */ |
| 136 | if (!(pfd.revents & POLLIN)) |
| 137 | continue; |
| 138 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 139 | f->fd = accept(nd->listenfd, (struct sockaddr *) &nd->addr, &socklen); |
| 140 | if (f->fd < 0) { |
| 141 | td_verror(td, errno, "accept"); |
| 142 | return 1; |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 143 | } |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 144 | break; |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | return 0; |
| 148 | } |
| 149 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 150 | |
| 151 | static int fio_netio_open_file(struct thread_data *td, struct fio_file *f) |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 152 | { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 153 | if (td_read(td)) |
| 154 | return fio_netio_accept(td, f); |
| 155 | else |
| 156 | return fio_netio_connect(td, f); |
| 157 | } |
| 158 | |
| 159 | static int fio_netio_setup_connect(struct thread_data *td, const char *host, |
| 160 | unsigned short port) |
| 161 | { |
| 162 | struct netio_data *nd = td->io_ops->data; |
| 163 | |
| 164 | nd->addr.sin_family = AF_INET; |
| 165 | nd->addr.sin_port = htons(port); |
| 166 | |
| 167 | if (inet_aton(host, &nd->addr.sin_addr) != 1) { |
| 168 | struct hostent *hent; |
| 169 | |
| 170 | hent = gethostbyname(host); |
| 171 | if (!hent) { |
| 172 | td_verror(td, errno, "gethostbyname"); |
| 173 | return 1; |
| 174 | } |
| 175 | |
| 176 | memcpy(&nd->addr.sin_addr, hent->h_addr, 4); |
| 177 | } |
| 178 | |
| 179 | return 0; |
| 180 | } |
| 181 | |
| 182 | static int fio_netio_setup_listen(struct thread_data *td, short port) |
| 183 | { |
| 184 | struct netio_data *nd = td->io_ops->data; |
Jens Axboe | 5fdd124 | 2007-02-11 04:00:37 +0100 | [diff] [blame] | 185 | int fd, opt; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 186 | |
Jens Axboe | 6bedbfa | 2007-02-07 09:54:40 +0100 | [diff] [blame] | 187 | fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 188 | if (fd < 0) { |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 189 | td_verror(td, errno, "socket"); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 190 | return 1; |
| 191 | } |
| 192 | |
| 193 | opt = 1; |
| 194 | if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) { |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 195 | td_verror(td, errno, "setsockopt"); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 196 | return 1; |
| 197 | } |
Jens Axboe | 6bedbfa | 2007-02-07 09:54:40 +0100 | [diff] [blame] | 198 | #ifdef SO_REUSEPORT |
| 199 | if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) < 0) { |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 200 | td_verror(td, errno, "setsockopt"); |
Jens Axboe | 6bedbfa | 2007-02-07 09:54:40 +0100 | [diff] [blame] | 201 | return 1; |
| 202 | } |
| 203 | #endif |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 204 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 205 | nd->addr.sin_family = AF_INET; |
| 206 | nd->addr.sin_addr.s_addr = htonl(INADDR_ANY); |
| 207 | nd->addr.sin_port = htons(port); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 208 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 209 | if (bind(fd, (struct sockaddr *) &nd->addr, sizeof(nd->addr)) < 0) { |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 210 | td_verror(td, errno, "bind"); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 211 | return 1; |
| 212 | } |
| 213 | if (listen(fd, 1) < 0) { |
Jens Axboe | e1161c3 | 2007-02-22 19:36:48 +0100 | [diff] [blame] | 214 | td_verror(td, errno, "listen"); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 215 | return 1; |
| 216 | } |
| 217 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 218 | nd->listenfd = fd; |
| 219 | return 0; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 220 | } |
| 221 | |
Jens Axboe | 9bec88e | 2007-03-02 08:55:48 +0100 | [diff] [blame] | 222 | static int fio_netio_init(struct thread_data *td) |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 223 | { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 224 | struct netio_data *nd = td->io_ops->data; |
Jens Axboe | e01547d | 2007-02-06 19:16:01 +0100 | [diff] [blame] | 225 | unsigned short port; |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 226 | char host[64], buf[128]; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 227 | char *sep; |
Jens Axboe | af52b34 | 2007-03-13 10:07:47 +0100 | [diff] [blame] | 228 | int ret; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 229 | |
Jens Axboe | 413dd45 | 2007-02-23 09:26:09 +0100 | [diff] [blame] | 230 | if (td_rw(td)) { |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 231 | log_err("fio: network connections must be read OR write\n"); |
| 232 | return 1; |
| 233 | } |
Jens Axboe | 16d55aa | 2007-05-22 09:21:37 +0200 | [diff] [blame^] | 234 | if (td_random(td)) { |
| 235 | log_err("fio: network IO can't be random\n"); |
| 236 | return 1; |
| 237 | } |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 238 | |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 239 | strcpy(buf, td->o.filename); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 240 | |
Jens Axboe | 9f9214f | 2007-03-13 14:02:16 +0100 | [diff] [blame] | 241 | sep = strchr(buf, '/'); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 242 | if (!sep) { |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 243 | log_err("fio: bad network host/port <<%s>>\n", td->o.filename); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 244 | return 1; |
| 245 | } |
| 246 | |
| 247 | *sep = '\0'; |
| 248 | sep++; |
| 249 | strcpy(host, buf); |
Jens Axboe | e01547d | 2007-02-06 19:16:01 +0100 | [diff] [blame] | 250 | port = atoi(sep); |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 251 | |
Jens Axboe | 413dd45 | 2007-02-23 09:26:09 +0100 | [diff] [blame] | 252 | if (td_read(td)) { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 253 | nd->send_to_net = 0; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 254 | ret = fio_netio_setup_listen(td, port); |
| 255 | } else { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 256 | nd->send_to_net = 1; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 257 | ret = fio_netio_setup_connect(td, host, port); |
| 258 | } |
| 259 | |
Jens Axboe | 7bb48f8 | 2007-03-27 15:30:28 +0200 | [diff] [blame] | 260 | return ret; |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 261 | } |
| 262 | |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 263 | static void fio_netio_cleanup(struct thread_data *td) |
Jens Axboe | 9bec88e | 2007-03-02 08:55:48 +0100 | [diff] [blame] | 264 | { |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 265 | struct netio_data *nd = td->io_ops->data; |
| 266 | |
| 267 | if (nd) { |
| 268 | free(nd); |
| 269 | td->io_ops->data = NULL; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | static int fio_netio_setup(struct thread_data *td) |
| 274 | { |
Jens Axboe | 7bb48f8 | 2007-03-27 15:30:28 +0200 | [diff] [blame] | 275 | struct netio_data *nd; |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 276 | |
Jens Axboe | 7bb48f8 | 2007-03-27 15:30:28 +0200 | [diff] [blame] | 277 | if (!td->io_ops->data) { |
| 278 | nd = malloc(sizeof(*nd));; |
| 279 | |
| 280 | memset(nd, 0, sizeof(*nd)); |
| 281 | nd->listenfd = -1; |
| 282 | td->io_ops->data = nd; |
Jens Axboe | 7bb48f8 | 2007-03-27 15:30:28 +0200 | [diff] [blame] | 283 | } |
| 284 | |
Jens Axboe | 9bec88e | 2007-03-02 08:55:48 +0100 | [diff] [blame] | 285 | return 0; |
| 286 | } |
| 287 | |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 288 | static struct ioengine_ops ioengine = { |
| 289 | .name = "net", |
| 290 | .version = FIO_IOOPS_VERSION, |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 291 | .prep = fio_netio_prep, |
| 292 | .queue = fio_netio_queue, |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 293 | .setup = fio_netio_setup, |
Jens Axboe | 9bec88e | 2007-03-02 08:55:48 +0100 | [diff] [blame] | 294 | .init = fio_netio_init, |
Jens Axboe | b5af829 | 2007-03-08 12:43:13 +0100 | [diff] [blame] | 295 | .cleanup = fio_netio_cleanup, |
| 296 | .open_file = fio_netio_open_file, |
| 297 | .close_file = generic_close_file, |
| 298 | .flags = FIO_SYNCIO | FIO_DISKLESSIO, |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 299 | }; |
| 300 | |
| 301 | static void fio_init fio_netio_register(void) |
| 302 | { |
| 303 | register_ioengine(&ioengine); |
| 304 | } |
| 305 | |
| 306 | static void fio_exit fio_netio_unregister(void) |
| 307 | { |
| 308 | unregister_ioengine(&ioengine); |
| 309 | } |