configure: lex force off
[fio.git] / server.c
index f53e2c8d161c251469432a71e586b46b83e67416..dfcc9f3879596da8fbc7cb38f57cb48234357a3f 100644 (file)
--- a/server.c
+++ b/server.c
@@ -46,7 +46,7 @@ struct sk_entry {
        int opcode;             /* Actual command fields */
        void *buf;
        off_t size;
-       uint64_t *tagptr;
+       uint64_t tag;
        struct flist_head next; /* Other sk_entry's, if linked command */
 };
 
@@ -536,7 +536,10 @@ static struct sk_entry *fio_net_prep_cmd(uint16_t opcode, void *buf,
                entry->buf = buf;
 
        entry->size = size;
-       entry->tagptr = tagptr;
+       if (tagptr)
+               entry->tag = *tagptr;
+       else
+               entry->tag = 0;
        entry->flags = flags;
        return entry;
 }
@@ -1069,29 +1072,24 @@ static void finish_entry(struct sk_entry *entry)
        sfree(entry);
 }
 
-static void entry_set_flags_tag(struct sk_entry *entry, struct flist_head *list,
-                               unsigned int *flags, uint64_t *tag)
+static void entry_set_flags(struct sk_entry *entry, struct flist_head *list,
+                           unsigned int *flags)
 {
        if (!flist_empty(list))
                *flags = FIO_NET_CMD_F_MORE;
        else
                *flags = 0;
-
-       if (entry->tagptr)
-               *tag = *entry->tagptr;
-       else
-               *tag = 0;
 }
 
 static int send_vec_entry(struct sk_out *sk_out, struct sk_entry *first)
 {
        unsigned int flags;
-       uint64_t tag;
        int ret;
 
-       entry_set_flags_tag(first, &first->next, &flags, &tag);
+       entry_set_flags(first, &first->next, &flags);
 
-       ret = fio_send_cmd_ext_pdu(sk_out->sk, first->opcode, first->buf, first->size, tag, flags);
+       ret = fio_send_cmd_ext_pdu(sk_out->sk, first->opcode, first->buf,
+                                       first->size, first->tag, flags);
 
        while (!flist_empty(&first->next)) {
                struct sk_entry *next;
@@ -1099,9 +1097,10 @@ static int send_vec_entry(struct sk_out *sk_out, struct sk_entry *first)
                next = flist_first_entry(&first->next, struct sk_entry, list);
                flist_del_init(&next->list);
 
-               entry_set_flags_tag(next, &first->next, &flags, &tag);
+               entry_set_flags(next, &first->next, &flags);
 
-               ret += fio_send_cmd_ext_pdu(sk_out->sk, next->opcode, next->buf, next->size, tag, flags);
+               ret += fio_send_cmd_ext_pdu(sk_out->sk, next->opcode, next->buf,
+                                               next->size, next->tag, flags);
                finish_entry(next);
        }
 
@@ -1117,16 +1116,11 @@ static int handle_sk_entry(struct sk_out *sk_out, struct sk_entry *entry)
        if (entry->flags & SK_F_VEC)
                ret = send_vec_entry(sk_out, entry);
        else if (entry->flags & SK_F_SIMPLE) {
-               uint64_t tag = 0;
-
-               if (entry->tagptr)
-                       tag = *entry->tagptr;
-
-               ret = fio_net_send_simple_cmd(sk_out->sk, entry->opcode, tag,
-                                               NULL);
+               ret = fio_net_send_simple_cmd(sk_out->sk, entry->opcode,
+                                               entry->tag, NULL);
        } else {
                ret = fio_net_send_cmd(sk_out->sk, entry->opcode, entry->buf,
-                                       entry->size, entry->tagptr, NULL);
+                                       entry->size, &entry->tag, NULL);
        }
 
        fio_mutex_up(&sk_out->xmit);
@@ -1829,8 +1823,8 @@ int fio_server_get_verify_state(const char *name, int threadnumber,
        }
 
        if (rep->error) {
-               log_err("fio: failure on receiving state file: %s\n",
-                               strerror(rep->error));
+               log_err("fio: failure on receiving state file %s: %s\n",
+                               out.path, strerror(rep->error));
 fail:
                *datap = NULL;
                sfree(rep);