~ubuntu-branches/ubuntu/precise/tgt/precise

« back to all changes in this revision

Viewing changes to usr/iscsi/conn.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-02-08 10:31:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110208103104-oots1az6acnkfvuw
Tags: 1:1.0.13-0ubuntu1
* New upstream release.
* debian/patches/make-tgt-setup-lun-executable: Dropped no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <string.h>
24
24
#include <errno.h>
25
25
#include <sys/stat.h>
 
26
#include <sys/epoll.h>
26
27
 
27
28
#include "iscsid.h"
28
29
#include "tgtd.h"
120
121
                iscsi_free_task(task);
121
122
        }
122
123
 
 
124
        if (conn->tx_task) {
 
125
                dprintf("Add current tx task to the tx list for removal "
 
126
                        "%p %" PRIx64 "\n",
 
127
                        conn->tx_task, conn->tx_task->tag);
 
128
                list_add(&conn->tx_task->c_list, &conn->tx_clist);
 
129
                conn->tx_task = NULL;
 
130
        }
 
131
 
123
132
        list_for_each_entry_safe(task, tmp, &conn->tx_clist, c_list) {
124
133
                uint8_t op;
125
134
 
158
167
        }
159
168
        conn->rx_task = NULL;
160
169
 
161
 
        if (conn->tx_task) {
162
 
                eprintf("Forcing release of tx task %p %" PRIx64 "\n",
163
 
                        conn->tx_task, conn->tx_task->tag);
164
 
                iscsi_free_task(conn->tx_task);
165
 
        }
166
 
        conn->tx_task = NULL;
167
 
 
168
170
        /* cleaning up commands waiting for SCSI_DATA_OUT */
169
171
        list_for_each_entry_safe(task, tmp, &conn->task_list, c_siblings) {
170
172
                /*
231
233
                        list_for_each_entry(conn, &session->conn_list, clist) {
232
234
                                if (conn->cid == cid) {
233
235
                                        eprintf("close %" PRIx64 " %u\n", sid, cid);
234
 
                                        conn_close(conn);
 
236
                                        conn->state = STATE_CLOSE;
 
237
                                        conn->tp->ep_event_modify(conn,
 
238
                                                  EPOLLIN|EPOLLOUT|EPOLLERR);
235
239
                                        return TGTADM_SUCCESS;
236
240
                                }
237
241
                        }