summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ed92ac0)
A few comments, pass down port short instead of buffer.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
if (io_u->offset == f->last_completed_pos)
return 0;
if (io_u->offset == f->last_completed_pos)
return 0;
+ /*
+ * If offset is different from last end position, it's a seek.
+ * As network io is purely sequential, we don't allow seeks.
+ */
td_verror(td, EINVAL);
return 1;
}
td_verror(td, EINVAL);
return 1;
}
}
static int fio_netio_setup_connect(struct thread_data *td, const char *host,
}
static int fio_netio_setup_connect(struct thread_data *td, const char *host,
{
struct sockaddr_in addr;
struct fio_file *f;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
{
struct sockaddr_in addr;
struct fio_file *f;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_port = htons(atoi(port));
+ addr.sin_port = htons(port);
if (inet_aton(host, &addr.sin_addr) != 1) {
struct hostent *hent = gethostbyname(host);
if (inet_aton(host, &addr.sin_addr) != 1) {
struct hostent *hent = gethostbyname(host);
-static int fio_netio_setup_listen(struct thread_data *td, const char *port)
+static int fio_netio_setup_listen(struct thread_data *td, unsigned short port)
{
struct sockaddr_in addr;
socklen_t socklen;
{
struct sockaddr_in addr;
socklen_t socklen;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
- addr.sin_port = htons(atoi(port));
+ addr.sin_port = htons(port);
if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
td_vmsg(td, errno, "bind");
if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
td_vmsg(td, errno, "bind");
static int fio_netio_setup(struct thread_data *td)
{
static int fio_netio_setup(struct thread_data *td)
{
- char host[64], port[64], buf[128];
+ char host[64], buf[128];
*sep = '\0';
sep++;
strcpy(host, buf);
*sep = '\0';
sep++;
strcpy(host, buf);
if (td->ddir == READ) {
nd->send_to_net = 0;
if (td->ddir == READ) {
nd->send_to_net = 0;
+ /*
+ * Hack to work-around the ->setup() function calling init on its
+ * own, since it needs ->io_ops->data to be set up.
+ */
if (td->io_ops->data)
return 0;
if (td->io_ops->data)
return 0;