Commit 7c9421e1 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Jeff Layton

CIFS: Change mid_q_entry structure fields

to be protocol-unspecific and big enough to keep both CIFS
and SMB2 values.
Signed-off-by: default avatarPavel Shilovsky <piastry@etersoft.ru>
parent 243d04b6
...@@ -80,15 +80,15 @@ void cifs_dump_mids(struct TCP_Server_Info *server) ...@@ -80,15 +80,15 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each(tmp, &server->pending_mid_q) { list_for_each(tmp, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %d", cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu",
mid_entry->midState, mid_entry->mid_state,
(int)mid_entry->command, le16_to_cpu(mid_entry->command),
mid_entry->pid, mid_entry->pid,
mid_entry->callback_data, mid_entry->callback_data,
mid_entry->mid); mid_entry->mid);
#ifdef CONFIG_CIFS_STATS2 #ifdef CONFIG_CIFS_STATS2
cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld",
mid_entry->largeBuf, mid_entry->large_buf,
mid_entry->resp_buf, mid_entry->resp_buf,
mid_entry->when_received, mid_entry->when_received,
jiffies); jiffies);
...@@ -218,12 +218,12 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) ...@@ -218,12 +218,12 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
mid_entry = list_entry(tmp3, struct mid_q_entry, mid_entry = list_entry(tmp3, struct mid_q_entry,
qhead); qhead);
seq_printf(m, "\tState: %d com: %d pid:" seq_printf(m, "\tState: %d com: %d pid:"
" %d cbdata: %p mid %d\n", " %d cbdata: %p mid %llu\n",
mid_entry->midState, mid_entry->mid_state,
(int)mid_entry->command, le16_to_cpu(mid_entry->command),
mid_entry->pid, mid_entry->pid,
mid_entry->callback_data, mid_entry->callback_data,
mid_entry->mid); mid_entry->mid);
} }
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
} }
......
...@@ -731,8 +731,8 @@ typedef void (mid_callback_t)(struct mid_q_entry *mid); ...@@ -731,8 +731,8 @@ typedef void (mid_callback_t)(struct mid_q_entry *mid);
/* one of these for every pending CIFS request to the server */ /* one of these for every pending CIFS request to the server */
struct mid_q_entry { struct mid_q_entry {
struct list_head qhead; /* mids waiting on reply from this server */ struct list_head qhead; /* mids waiting on reply from this server */
__u16 mid; /* multiplex id */ __u64 mid; /* multiplex id */
__u16 pid; /* process id */ __u32 pid; /* process id */
__u32 sequence_number; /* for CIFS signing */ __u32 sequence_number; /* for CIFS signing */
unsigned long when_alloc; /* when mid was created */ unsigned long when_alloc; /* when mid was created */
#ifdef CONFIG_CIFS_STATS2 #ifdef CONFIG_CIFS_STATS2
...@@ -743,9 +743,9 @@ struct mid_q_entry { ...@@ -743,9 +743,9 @@ struct mid_q_entry {
mid_callback_t *callback; /* call completion callback */ mid_callback_t *callback; /* call completion callback */
void *callback_data; /* general purpose pointer for callback */ void *callback_data; /* general purpose pointer for callback */
void *resp_buf; /* pointer to received SMB header */ void *resp_buf; /* pointer to received SMB header */
int midState; /* wish this were enum but can not pass to wait_event */ int mid_state; /* wish this were enum but can not pass to wait_event */
__u8 command; /* smb command code */ __le16 command; /* smb command code */
bool largeBuf:1; /* if valid response, is pointer to large buf */ bool large_buf:1; /* if valid response, is pointer to large buf */
bool multiRsp:1; /* multiple trans2 responses for one request */ bool multiRsp:1; /* multiple trans2 responses for one request */
bool multiEnd:1; /* both received */ bool multiEnd:1; /* both received */
}; };
......
...@@ -1467,7 +1467,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) ...@@ -1467,7 +1467,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
pgoff_t eof_index; pgoff_t eof_index;
struct page *page, *tpage; struct page *page, *tpage;
cFYI(1, "%s: mid=%u offset=%llu bytes=%u", __func__, cFYI(1, "%s: mid=%llu offset=%llu bytes=%u", __func__,
mid->mid, rdata->offset, rdata->bytes); mid->mid, rdata->offset, rdata->bytes);
/* /*
...@@ -1665,10 +1665,10 @@ cifs_readv_callback(struct mid_q_entry *mid) ...@@ -1665,10 +1665,10 @@ cifs_readv_callback(struct mid_q_entry *mid)
struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink); struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink);
struct TCP_Server_Info *server = tcon->ses->server; struct TCP_Server_Info *server = tcon->ses->server;
cFYI(1, "%s: mid=%u state=%d result=%d bytes=%u", __func__, cFYI(1, "%s: mid=%llu state=%d result=%d bytes=%u", __func__,
mid->mid, mid->midState, rdata->result, rdata->bytes); mid->mid, mid->mid_state, rdata->result, rdata->bytes);
switch (mid->midState) { switch (mid->mid_state) {
case MID_RESPONSE_RECEIVED: case MID_RESPONSE_RECEIVED:
/* result already set, check signature */ /* result already set, check signature */
if (server->sec_mode & if (server->sec_mode &
...@@ -2086,7 +2086,7 @@ cifs_writedata_alloc(unsigned int nr_pages) ...@@ -2086,7 +2086,7 @@ cifs_writedata_alloc(unsigned int nr_pages)
} }
/* /*
* Check the midState and signature on received buffer (if any), and queue the * Check the mid_state and signature on received buffer (if any), and queue the
* workqueue completion task. * workqueue completion task.
*/ */
static void static void
...@@ -2097,7 +2097,7 @@ cifs_writev_callback(struct mid_q_entry *mid) ...@@ -2097,7 +2097,7 @@ cifs_writev_callback(struct mid_q_entry *mid)
unsigned int written; unsigned int written;
WRITE_RSP *smb = (WRITE_RSP *)mid->resp_buf; WRITE_RSP *smb = (WRITE_RSP *)mid->resp_buf;
switch (mid->midState) { switch (mid->mid_state) {
case MID_RESPONSE_RECEIVED: case MID_RESPONSE_RECEIVED:
wdata->result = cifs_check_receive(mid, tcon->ses->server, 0); wdata->result = cifs_check_receive(mid, tcon->ses->server, 0);
if (wdata->result != 0) if (wdata->result != 0)
......
...@@ -143,8 +143,8 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -143,8 +143,8 @@ cifs_reconnect(struct TCP_Server_Info *server)
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
if (mid_entry->midState == MID_REQUEST_SUBMITTED) if (mid_entry->mid_state == MID_REQUEST_SUBMITTED)
mid_entry->midState = MID_RETRY_NEEDED; mid_entry->mid_state = MID_RETRY_NEEDED;
list_move(&mid_entry->qhead, &retry_list); list_move(&mid_entry->qhead, &retry_list);
} }
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
...@@ -575,8 +575,8 @@ find_mid(struct TCP_Server_Info *server, char *buffer) ...@@ -575,8 +575,8 @@ find_mid(struct TCP_Server_Info *server, char *buffer)
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each_entry(mid, &server->pending_mid_q, qhead) { list_for_each_entry(mid, &server->pending_mid_q, qhead) {
if (mid->mid == buf->Mid && if (mid->mid == buf->Mid &&
mid->midState == MID_REQUEST_SUBMITTED && mid->mid_state == MID_REQUEST_SUBMITTED &&
mid->command == buf->Command) { le16_to_cpu(mid->command) == buf->Command) {
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
return mid; return mid;
} }
...@@ -593,9 +593,9 @@ dequeue_mid(struct mid_q_entry *mid, bool malformed) ...@@ -593,9 +593,9 @@ dequeue_mid(struct mid_q_entry *mid, bool malformed)
#endif #endif
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (!malformed) if (!malformed)
mid->midState = MID_RESPONSE_RECEIVED; mid->mid_state = MID_RESPONSE_RECEIVED;
else else
mid->midState = MID_RESPONSE_MALFORMED; mid->mid_state = MID_RESPONSE_MALFORMED;
list_del_init(&mid->qhead); list_del_init(&mid->qhead);
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
} }
...@@ -622,13 +622,13 @@ handle_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server, ...@@ -622,13 +622,13 @@ handle_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server,
} else { } else {
/* Have first buffer */ /* Have first buffer */
mid->resp_buf = buf; mid->resp_buf = buf;
mid->largeBuf = true; mid->large_buf = true;
server->bigbuf = NULL; server->bigbuf = NULL;
} }
return; return;
} }
mid->resp_buf = buf; mid->resp_buf = buf;
mid->largeBuf = server->large_buf; mid->large_buf = server->large_buf;
/* Was previous buf put in mpx struct for multi-rsp? */ /* Was previous buf put in mpx struct for multi-rsp? */
if (!mid->multiRsp) { if (!mid->multiRsp) {
/* smb buffer will be freed by user thread */ /* smb buffer will be freed by user thread */
...@@ -684,8 +684,8 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server) ...@@ -684,8 +684,8 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
cFYI(1, "Clearing mid 0x%x", mid_entry->mid); cFYI(1, "Clearing mid 0x%llx", mid_entry->mid);
mid_entry->midState = MID_SHUTDOWN; mid_entry->mid_state = MID_SHUTDOWN;
list_move(&mid_entry->qhead, &dispose_list); list_move(&mid_entry->qhead, &dispose_list);
} }
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
...@@ -693,7 +693,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server) ...@@ -693,7 +693,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
/* now walk dispose list and issue callbacks */ /* now walk dispose list and issue callbacks */
list_for_each_safe(tmp, tmp2, &dispose_list) { list_for_each_safe(tmp, tmp2, &dispose_list) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
cFYI(1, "Callback mid 0x%x", mid_entry->mid); cFYI(1, "Callback mid 0x%llx", mid_entry->mid);
list_del_init(&mid_entry->qhead); list_del_init(&mid_entry->qhead);
mid_entry->callback(mid_entry); mid_entry->callback(mid_entry);
} }
......
...@@ -268,7 +268,7 @@ __u64 GetNextMid(struct TCP_Server_Info *server) ...@@ -268,7 +268,7 @@ __u64 GetNextMid(struct TCP_Server_Info *server)
list_for_each_entry(mid_entry, &server->pending_mid_q, qhead) { list_for_each_entry(mid_entry, &server->pending_mid_q, qhead) {
++num_mids; ++num_mids;
if (mid_entry->mid == cur_mid && if (mid_entry->mid == cur_mid &&
mid_entry->midState == MID_REQUEST_SUBMITTED) { mid_entry->mid_state == MID_REQUEST_SUBMITTED) {
/* This mid is in use, try a different one */ /* This mid is in use, try a different one */
collision = true; collision = true;
break; break;
......
...@@ -60,8 +60,8 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) ...@@ -60,8 +60,8 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
memset(temp, 0, sizeof(struct mid_q_entry)); memset(temp, 0, sizeof(struct mid_q_entry));
temp->mid = smb_buffer->Mid; /* always LE */ temp->mid = smb_buffer->Mid; /* always LE */
temp->pid = current->pid; temp->pid = current->pid;
temp->command = smb_buffer->Command; temp->command = cpu_to_le16(smb_buffer->Command);
cFYI(1, "For smb_command %d", temp->command); cFYI(1, "For smb_command %d", smb_buffer->Command);
/* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */
/* when mid allocated can be before when sent */ /* when mid allocated can be before when sent */
temp->when_alloc = jiffies; temp->when_alloc = jiffies;
...@@ -75,7 +75,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) ...@@ -75,7 +75,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
} }
atomic_inc(&midCount); atomic_inc(&midCount);
temp->midState = MID_REQUEST_ALLOCATED; temp->mid_state = MID_REQUEST_ALLOCATED;
return temp; return temp;
} }
...@@ -85,9 +85,9 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) ...@@ -85,9 +85,9 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
#ifdef CONFIG_CIFS_STATS2 #ifdef CONFIG_CIFS_STATS2
unsigned long now; unsigned long now;
#endif #endif
midEntry->midState = MID_FREE; midEntry->mid_state = MID_FREE;
atomic_dec(&midCount); atomic_dec(&midCount);
if (midEntry->largeBuf) if (midEntry->large_buf)
cifs_buf_release(midEntry->resp_buf); cifs_buf_release(midEntry->resp_buf);
else else
cifs_small_buf_release(midEntry->resp_buf); cifs_small_buf_release(midEntry->resp_buf);
...@@ -97,8 +97,8 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) ...@@ -97,8 +97,8 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
something is wrong, unless it is quite a slow link or server */ something is wrong, unless it is quite a slow link or server */
if ((now - midEntry->when_alloc) > HZ) { if ((now - midEntry->when_alloc) > HZ) {
if ((cifsFYI & CIFS_TIMER) && if ((cifsFYI & CIFS_TIMER) &&
(midEntry->command != SMB_COM_LOCKING_ANDX)) { (midEntry->command != cpu_to_le16(SMB_COM_LOCKING_ANDX))) {
printk(KERN_DEBUG " CIFS slow rsp: cmd %d mid %d", printk(KERN_DEBUG " CIFS slow rsp: cmd %d mid %llu",
midEntry->command, midEntry->mid); midEntry->command, midEntry->mid);
printk(" A: 0x%lx S: 0x%lx R: 0x%lx\n", printk(" A: 0x%lx S: 0x%lx R: 0x%lx\n",
now - midEntry->when_alloc, now - midEntry->when_alloc,
...@@ -341,7 +341,7 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) ...@@ -341,7 +341,7 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
int error; int error;
error = wait_event_freezekillable(server->response_q, error = wait_event_freezekillable(server->response_q,
midQ->midState != MID_REQUEST_SUBMITTED); midQ->mid_state != MID_REQUEST_SUBMITTED);
if (error < 0) if (error < 0)
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -404,7 +404,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, ...@@ -404,7 +404,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
mid->receive = receive; mid->receive = receive;
mid->callback = callback; mid->callback = callback;
mid->callback_data = cbdata; mid->callback_data = cbdata;
mid->midState = MID_REQUEST_SUBMITTED; mid->mid_state = MID_REQUEST_SUBMITTED;
cifs_in_send_inc(server); cifs_in_send_inc(server);
rc = smb_sendv(server, iov, nvec); rc = smb_sendv(server, iov, nvec);
...@@ -454,11 +454,11 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) ...@@ -454,11 +454,11 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
{ {
int rc = 0; int rc = 0;
cFYI(1, "%s: cmd=%d mid=%d state=%d", __func__, mid->command, cFYI(1, "%s: cmd=%d mid=%llu state=%d", __func__,
mid->mid, mid->midState); le16_to_cpu(mid->command), mid->mid, mid->mid_state);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
switch (mid->midState) { switch (mid->mid_state) {
case MID_RESPONSE_RECEIVED: case MID_RESPONSE_RECEIVED:
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
return rc; return rc;
...@@ -473,8 +473,8 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) ...@@ -473,8 +473,8 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
break; break;
default: default:
list_del_init(&mid->qhead); list_del_init(&mid->qhead);
cERROR(1, "%s: invalid mid state mid=%d state=%d", __func__, cERROR(1, "%s: invalid mid state mid=%llu state=%d", __func__,
mid->mid, mid->midState); mid->mid, mid->mid_state);
rc = -EIO; rc = -EIO;
} }
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
...@@ -616,7 +616,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, ...@@ -616,7 +616,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
return rc; return rc;
} }
midQ->midState = MID_REQUEST_SUBMITTED; midQ->mid_state = MID_REQUEST_SUBMITTED;
cifs_in_send_inc(ses->server); cifs_in_send_inc(ses->server);
rc = smb_sendv(ses->server, iov, n_vec); rc = smb_sendv(ses->server, iov, n_vec);
cifs_in_send_dec(ses->server); cifs_in_send_dec(ses->server);
...@@ -638,7 +638,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, ...@@ -638,7 +638,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
if (rc != 0) { if (rc != 0) {
send_nt_cancel(ses->server, (struct smb_hdr *)buf, midQ); send_nt_cancel(ses->server, (struct smb_hdr *)buf, midQ);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->mid_state == MID_REQUEST_SUBMITTED) {
midQ->callback = DeleteMidQEntry; midQ->callback = DeleteMidQEntry;
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
cifs_small_buf_release(buf); cifs_small_buf_release(buf);
...@@ -656,7 +656,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, ...@@ -656,7 +656,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
return rc; return rc;
} }
if (!midQ->resp_buf || midQ->midState != MID_RESPONSE_RECEIVED) { if (!midQ->resp_buf || midQ->mid_state != MID_RESPONSE_RECEIVED) {
rc = -EIO; rc = -EIO;
cFYI(1, "Bad MID state?"); cFYI(1, "Bad MID state?");
goto out; goto out;
...@@ -665,7 +665,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, ...@@ -665,7 +665,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
buf = (char *)midQ->resp_buf; buf = (char *)midQ->resp_buf;
iov[0].iov_base = buf; iov[0].iov_base = buf;
iov[0].iov_len = get_rfc1002_length(buf) + 4; iov[0].iov_len = get_rfc1002_length(buf) + 4;
if (midQ->largeBuf) if (midQ->large_buf)
*pRespBufType = CIFS_LARGE_BUFFER; *pRespBufType = CIFS_LARGE_BUFFER;
else else
*pRespBufType = CIFS_SMALL_BUFFER; *pRespBufType = CIFS_SMALL_BUFFER;
...@@ -737,7 +737,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, ...@@ -737,7 +737,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
goto out; goto out;
} }
midQ->midState = MID_REQUEST_SUBMITTED; midQ->mid_state = MID_REQUEST_SUBMITTED;
cifs_in_send_inc(ses->server); cifs_in_send_inc(ses->server);
rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
...@@ -755,7 +755,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, ...@@ -755,7 +755,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
if (rc != 0) { if (rc != 0) {
send_nt_cancel(ses->server, in_buf, midQ); send_nt_cancel(ses->server, in_buf, midQ);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->mid_state == MID_REQUEST_SUBMITTED) {
/* no longer considered to be "in-flight" */ /* no longer considered to be "in-flight" */
midQ->callback = DeleteMidQEntry; midQ->callback = DeleteMidQEntry;
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
...@@ -772,7 +772,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, ...@@ -772,7 +772,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
} }
if (!midQ->resp_buf || !out_buf || if (!midQ->resp_buf || !out_buf ||
midQ->midState != MID_RESPONSE_RECEIVED) { midQ->mid_state != MID_RESPONSE_RECEIVED) {
rc = -EIO; rc = -EIO;
cERROR(1, "Bad MID state?"); cERROR(1, "Bad MID state?");
goto out; goto out;
...@@ -871,7 +871,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -871,7 +871,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
return rc; return rc;
} }
midQ->midState = MID_REQUEST_SUBMITTED; midQ->mid_state = MID_REQUEST_SUBMITTED;
cifs_in_send_inc(ses->server); cifs_in_send_inc(ses->server);
rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
cifs_in_send_dec(ses->server); cifs_in_send_dec(ses->server);
...@@ -885,13 +885,13 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -885,13 +885,13 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
/* Wait for a reply - allow signals to interrupt. */ /* Wait for a reply - allow signals to interrupt. */
rc = wait_event_interruptible(ses->server->response_q, rc = wait_event_interruptible(ses->server->response_q,
(!(midQ->midState == MID_REQUEST_SUBMITTED)) || (!(midQ->mid_state == MID_REQUEST_SUBMITTED)) ||
((ses->server->tcpStatus != CifsGood) && ((ses->server->tcpStatus != CifsGood) &&
(ses->server->tcpStatus != CifsNew))); (ses->server->tcpStatus != CifsNew)));
/* Were we interrupted by a signal ? */ /* Were we interrupted by a signal ? */
if ((rc == -ERESTARTSYS) && if ((rc == -ERESTARTSYS) &&
(midQ->midState == MID_REQUEST_SUBMITTED) && (midQ->mid_state == MID_REQUEST_SUBMITTED) &&
((ses->server->tcpStatus == CifsGood) || ((ses->server->tcpStatus == CifsGood) ||
(ses->server->tcpStatus == CifsNew))) { (ses->server->tcpStatus == CifsNew))) {
...@@ -921,7 +921,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -921,7 +921,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
if (rc) { if (rc) {
send_nt_cancel(ses->server, in_buf, midQ); send_nt_cancel(ses->server, in_buf, midQ);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->mid_state == MID_REQUEST_SUBMITTED) {
/* no longer considered to be "in-flight" */ /* no longer considered to be "in-flight" */
midQ->callback = DeleteMidQEntry; midQ->callback = DeleteMidQEntry;
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
...@@ -939,7 +939,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -939,7 +939,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
return rc; return rc;
/* rcvd frame is ok */ /* rcvd frame is ok */
if (out_buf == NULL || midQ->midState != MID_RESPONSE_RECEIVED) { if (out_buf == NULL || midQ->mid_state != MID_RESPONSE_RECEIVED) {
rc = -EIO; rc = -EIO;
cERROR(1, "Bad MID state?"); cERROR(1, "Bad MID state?");
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment