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