diff options
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 6abd1445c983..d77b6154cf22 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -36,6 +36,12 @@ | |||
36 | 36 | ||
37 | extern mempool_t *cifs_mid_poolp; | 37 | extern mempool_t *cifs_mid_poolp; |
38 | 38 | ||
39 | static void | ||
40 | wake_up_task(struct mid_q_entry *mid) | ||
41 | { | ||
42 | wake_up_process(mid->callback_data); | ||
43 | } | ||
44 | |||
39 | static struct mid_q_entry * | 45 | static struct mid_q_entry * |
40 | AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) | 46 | AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) |
41 | { | 47 | { |
@@ -58,7 +64,13 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) | |||
58 | /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ | 64 | /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ |
59 | /* when mid allocated can be before when sent */ | 65 | /* when mid allocated can be before when sent */ |
60 | temp->when_alloc = jiffies; | 66 | temp->when_alloc = jiffies; |
61 | temp->tsk = current; | 67 | |
68 | /* | ||
69 | * The default is for the mid to be synchronous, so the | ||
70 | * default callback just wakes up the current task. | ||
71 | */ | ||
72 | temp->callback = wake_up_task; | ||
73 | temp->callback_data = current; | ||
62 | } | 74 | } |
63 | 75 | ||
64 | atomic_inc(&midCount); | 76 | atomic_inc(&midCount); |
@@ -367,6 +379,9 @@ sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) | |||
367 | mid->mid, mid->midState); | 379 | mid->mid, mid->midState); |
368 | 380 | ||
369 | spin_lock(&GlobalMid_Lock); | 381 | spin_lock(&GlobalMid_Lock); |
382 | /* ensure that it's no longer on the pending_mid_q */ | ||
383 | list_del_init(&mid->qhead); | ||
384 | |||
370 | switch (mid->midState) { | 385 | switch (mid->midState) { |
371 | case MID_RESPONSE_RECEIVED: | 386 | case MID_RESPONSE_RECEIVED: |
372 | spin_unlock(&GlobalMid_Lock); | 387 | spin_unlock(&GlobalMid_Lock); |
@@ -389,7 +404,7 @@ sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) | |||
389 | } | 404 | } |
390 | spin_unlock(&GlobalMid_Lock); | 405 | spin_unlock(&GlobalMid_Lock); |
391 | 406 | ||
392 | delete_mid(mid); | 407 | DeleteMidQEntry(mid); |
393 | return rc; | 408 | return rc; |
394 | } | 409 | } |
395 | 410 | ||